Get Current User Info
Get comprehensive information about the currently authenticated user.
Endpoint
GET /api/v1/auth/me
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <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
| Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Invalid or missing token |
| 422 | VALIDATION_ERROR | Request validation failed |
Data Flow
-
Authentication
- Verify access token
- Extract user ID from token
- Get user from database
-
User Information Collection
- Get user profile data
- Get user emails (all emails)
- Identify primary email
-
Organization Data
- Query memberships
- Get organization details
- Get workspace details
- Determine admin status
-
Security Information
- Check MFA status and methods
- Get connected social accounts
- Count login attempts from audit logs
- Count active sessions
-
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>"
Related Endpoints
- Update Profile - Update user profile
- Login History - Get detailed login history
- Social Accounts - Get connected accounts