Reten Docs

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

HeaderRequiredValue
AuthorizationYesBearer <access_token>
x-tenant-idNoTenant UUID, returned in activeTenantId. Ignored with an API key, which carries its own tenant

Example

curl https://api.reten.ai/api/auth/me \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
  -H "x-tenant-id: 660e8400-e29b-41d4-a716-446655440000"
const response = await fetch("https://api.reten.ai/api/auth/me", {
  headers: {
    "Authorization": "Bearer <token>",
    "x-tenant-id": "660e8400-e29b-41d4-a716-446655440000",
  },
});
const data = await response.json();
import requests

response = requests.get(
    "https://api.reten.ai/api/auth/me",
    headers={
        "Authorization": "Bearer eyJhbGciOiJIUzI1NiIs...",
        "x-tenant-id": "660e8400-e29b-41d4-a716-446655440000",
    },
)
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": "660e8400-e29b-41d4-a716-446655440000"
}
FieldTypeDescription
idUUIDUser ID
usernamestringUsername
rolesstring[]Role values of the user (see Roles & Permissions)
permissionsstring[]Permissions granted by all of the user's roles; the order is not guaranteed
tenantIdsstring[]Tenants the user belongs to
activeTenantIdstringWith an access token, the tenant sent in x-tenant-id, as received — this endpoint does not check it against tenantIds; "" without the header

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

StatusDescription
401Invalid or expired access token