Skip to main content

Get Current User Info

Get comprehensive information about the currently authenticated user.

Endpoint

GET /api/v1/auth/me

Headers

HeaderRequiredDescription
AuthorizationYesBearer <access_token>

Response

Success (200)

{
"success": true,
"data": {
"user": {
"id": 123,
"display_name": "John Doe",
"primary_email": "user@example.com",
"profile_image_url": "https://...",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T12:00:00Z",
"is_system_admin": false,
"disabled_at": null,
"profile": {},
"user_metadata": {}
},
"emails": [
{
"email": "user@example.com",
"verified": true,
"is_primary": true,
"created_at": "2024-01-01T00:00:00Z"
}
],
"organizations": [
{
"id": 1,
"name": "Acme Corp",
"domain": "acme.com",
"plan": "enterprise",
"is_admin": true,
"joined_at": "2024-01-01T00:00:00Z",
"source": "signup"
}
],
"workspaces": [
{
"id": 1,
"name": "Default Workspace",
"slug": "default-workspace",
"is_default": true,
"created_at": "2024-01-01T00:00:00Z"
}
],
"security": {
"mfa_enabled": true,
"mfa_methods": ["totp"],
"social_accounts_count": 1,
"connected_providers": ["github"],
"total_login_attempts": 45,
"active_sessions": 3
}
},
"message": "User information retrieved successfully"
}

Error Codes

StatusCodeDescription
401UNAUTHORIZEDInvalid or missing token
422VALIDATION_ERRORRequest validation failed

Data Flow

  1. Authentication

    • Verify access token
    • Extract user ID from token
    • Get user from database
  2. User Information Collection

    • Get user profile data
    • Get user emails (all emails)
    • Identify primary email
  3. Organization Data

    • Query memberships
    • Get organization details
    • Get workspace details
    • Determine admin status
  4. Security Information

    • Check MFA status and methods
    • Get connected social accounts
    • Count login attempts from audit logs
    • Count active sessions
  5. Response Assembly

    • Combine all data into response
    • Format dates as ISO strings
    • Include security summary

Features

  • Requires valid OAuth2 access token
  • Returns complete user profile
  • Includes all emails with verification status
  • Lists all organizations and workspaces
  • Shows security information (MFA, social accounts, sessions)
  • Provides account statistics

Example

curl -X GET https://api.rivergen.com/api/v1/auth/me \
-H "Authorization: Bearer <access_token>"