Current User
Get the currently authenticated user's information.
GET /api/auth/me
Returns information about the currently authenticated user.
Auth: Required — any authenticated user; no x-tenant-id header needed
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer <access_token> |
Example
curl https://api.reten.ai/api/auth/me \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."const response = await fetch("https://api.reten.ai/api/auth/me", {
headers: { "Authorization": "Bearer <token>" },
});
const data = await response.json();import requests
response = requests.get(
"https://api.reten.ai/api/auth/me",
headers={"Authorization": "Bearer eyJhbGciOiJIUzI1NiIs..."},
)
data = response.json()Response 200 OK
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"username": "jdoe",
"roles": ["viewer"],
"permissions": [
"project:view",
"user:view",
"activity:view",
"commerce-lifecycle-snapshot:view"
],
"tenantIds": ["660e8400-e29b-41d4-a716-446655440000"],
"activeTenantId": ""
}| Field | Type | Description |
|---|---|---|
id | UUID | User ID |
username | string | Username |
roles | string[] | Role values of the user (see Roles & Permissions) |
permissions | string[] | Permissions granted by all of the user's roles; the order is not guaranteed |
tenantIds | string[] | Tenants the user belongs to |
activeTenantId | string | Always "" with an access token: this endpoint does not read x-tenant-id |
roles, permissions and tenantIds come from the access token, so they reflect the user as of the last login or refresh. The response has no email, firstName or lastName; those come in the login response.
With an API key, the response describes the key: roles is [], permissions holds the key's effective permissions, tenantIds and activeTenantId hold the key's tenant, and two more fields appear — isApiKey: true and apiKeyId.
Error Responses
| Status | Description |
|---|---|
401 | Invalid or expired access token |