Skip to main content
GET
/
api
/
auth
/
me
Get Current User
curl --request GET \
  --url https://api.example.com/api/auth/me
{
  "success": true,
  "data": {
    "id": "<string>",
    "email": "<string>",
    "display_name": {},
    "role": "<string>",
    "created_at": "<string>",
    "updated_at": "<string>",
    "github_username": {},
    "gitlab_username": {}
  }
}

Endpoint

Returns the user profile and account information for the currently authenticated session.

Authentication

Requires a valid session token via:
  • Authorization: Bearer <token> header, or
  • heimdall_session cookie

Request

No request body or query parameters required.

Example

curl https://heimdall.example.com/api/auth/me \
  -H "Authorization: Bearer <your_session_token>"

Response

Success Response

success
boolean
Always true for successful requests
data
object
User object
{
  "success": true,
  "data": {
    "id": "01932e4a-7b2c-7890-abcd-1234567890ab",
    "email": "[email protected]",
    "display_name": "Alice",
    "role": "user",
    "created_at": "2026-03-10T10:30:00Z",
    "updated_at": "2026-03-12T15:45:00Z",
    "github_username": "alice",
    "gitlab_username": null
  }
}

Error Responses

{
  "success": false,
  "error": {
    "code": 401,
    "message": "Authentication required"
  }
}
{
  "success": false,
  "error": {
    "code": 401,
    "message": "Invalid or expired session"
  }
}
{
  "success": false,
  "error": {
    "code": 500,
    "message": "Internal server error"
  }
}

Use Cases

  • Profile display — Show user information in navigation bar or settings
  • Permission checks — Verify user role before showing admin features
  • Session validation — Check if the current session is still valid
  • Account linking status — Determine which OAuth providers are connected

Build docs developers (and LLMs) love