Skip to main content
GET
/
api
/
auth
/
me
Get Current User
curl --request GET \
  --url https://api.example.com/api/auth/me \
  --header 'Authorization: <authorization>'
{
  "success": true,
  "data": {
    "id": "<string>",
    "email": "<string>",
    "fullName": "<string>",
    "phone": {},
    "avatar": {},
    "emailVerified": true,
    "lastLoginAt": {},
    "createdAt": "<string>",
    "isPlatformAdmin": true,
    "globalPermissions": [
      {
        "key": "<string>",
        "description": "<string>",
        "grantedAt": "<string>"
      }
    ],
    "companies": [
      {
        "id": "<string>",
        "name": "<string>",
        "slug": "<string>",
        "logo": {},
        "status": "<string>",
        "membershipId": "<string>",
        "membershipStatus": "<string>",
        "roles": [
          {
            "id": "<string>",
            "name": "<string>",
            "color": "<string>"
          }
        ],
        "permissions": [
          {}
        ]
      }
    ]
  }
}
Retrieves the complete profile of the currently authenticated user, including platform admin status, global permissions, and company memberships with their associated roles and permissions.

Authentication

Authorization
string
required
Bearer token with a valid access token.Format: Bearer <access_token>

Response

success
boolean
Indicates if the request was successful.
data
object
Contains the user profile and related data.

Error Responses

401 Unauthorized
Missing or invalid access token.
{
  "success": false,
  "error": {
    "message": "Unauthorized",
    "statusCode": 401
  }
}
404 Not Found
User not found in the database.
{
  "success": false,
  "error": {
    "message": "User not found",
    "statusCode": 404
  }
}

Example Request

curl -X GET https://api.example.com/api/auth/me \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Example Response

{
  "success": true,
  "data": {
    "id": "clx1234567890abcdef",
    "email": "[email protected]",
    "fullName": "John Doe",
    "phone": "+1234567890",
    "avatar": "https://example.com/avatars/user.jpg",
    "emailVerified": true,
    "lastLoginAt": "2026-03-04T10:30:00.000Z",
    "createdAt": "2026-01-15T08:20:00.000Z",
    "isPlatformAdmin": false,
    "globalPermissions": [
      {
        "key": "users:manage",
        "description": "Manage all platform users",
        "grantedAt": "2026-02-01T12:00:00.000Z"
      }
    ],
    "companies": [
      {
        "id": "clx9876543210zyxwvu",
        "name": "Acme Corporation",
        "slug": "acme-corp",
        "logo": "https://example.com/logos/acme.png",
        "status": "ACTIVE",
        "membershipId": "clx5555555555aaaaa",
        "membershipStatus": "ACTIVE",
        "roles": [
          {
            "id": "clx7777777777bbbbb",
            "name": "Admin",
            "color": "#FF5733"
          }
        ],
        "permissions": [
          "company:manage",
          "members:invite",
          "projects:create",
          "projects:delete"
        ]
      }
    ]
  }
}

Notes

  • Only returns active memberships (status: ‘ACTIVE’)
  • Permissions are deduplicated across all roles within each company
  • Global permissions are separate from company-specific permissions
  • Platform admin status is determined by the presence of a platformAdmin record

Build docs developers (and LLMs) love