A session is created at each sign-in (magic link, OTP, passkey, OAuth, SAML and the other methods) and for each M2M token. It holds the refresh token and tracks where the session was last used. Two shapes appear in the API: the token set returned when a session starts, and the session object returned when sessions are listed.
The token set#
Returned when a user signs in or a session is refreshed. The auth API pages say which call returns it.
| Field | Type | Description |
|---|---|---|
| access | string | The access token: an RS256 JWT. Send it in X-Authorization: Bearer. |
| access_expires_at | string | When the access token expires. |
| refresh | string | The refresh token. Left out when the app does not return refresh tokens in the payload. |
| refresh_expires_at | string | When the refresh token expires. Left out with refresh. |
| csrf | string | CSRF token. Sent as X-CSRF-Token with a refresh. |
| key_id | string | kid of the key that signed the tokens, as published in the app's JWKS. |
| user_id | string | UUID of the app user. |
{ "csrf": "kQ2...", "access": "eyJhbGciOiJSUzI1NiIsImtpZCI6...", "access_expires_at": "2026-11-18T11:00:00.000Z", "refresh": "eyJhbGciOiJSUzI1NiIsImtpZCI6...", "refresh_expires_at": "2026-11-25T10:00:00.000Z", "key_id": "...", "user_id": "0193f900-aaaa-bbbb-cccc-eeeeeeeeeeee"}The access token's payload carries uuid (the app user's UUID), aid (the app's public id), wid (the workspace UUID) and, for users of an MSP's workspace, msp_id.
M2M token set#
POST /v1/apps/:app_id/m2m/token returns the same fields without user_id, plus:
| Field | Type | Description |
|---|---|---|
| short_token | string | The opaque scm2m_... token. Shown once. |
| client_name | string | The name given to the token. |
| scopes | array | read, write or both. |
| expires_at | string | When the token stops working. |
The session object#
Returned by the session lists: GET /v1/auth/:app_id/sessions (the signed-in user's own), GET /v1/:app_id/users/:id/sessions (one user's, for the app's backend), GET /v1/apps/:app_id/m2m/sessions (the app's M2M tokens), and in sessions of the detailed user object.
| Field | Type | Description |
|---|---|---|
| id | string | UUID of the session. |
| type | string | How it started: webauthn, magic, xlogin, oauth, misc, otp, workspace, m2m, mfa, challenge or impersonation. |
| status | boolean | true while the refresh token has not expired. |
| current | boolean | true for the session behind the caller's access token. |
| display_name | string | Name the user gave the session, or null. |
| user_agent | string | User agent at sign-in. |
| platform | string | Operating system read from the user agent, or null. |
| browser | string | Browser read from the user agent, or null. |
| user_agent_shortname | string | Short name built from the user agent. |
| nickname | string | Same value as user_agent_shortname. |
| credential_id | string | WebAuthn credential id, for passkey sessions. |
| last_used_at | string | Last use of the session. |
| last_used_at_ip | string | Address of the last use. |
| refresh_expiration | string | When the refresh token expires. |
| access_expiration | string | M2M only: when the token expires. |
| client_name | string | M2M only: the token's name. |
| short_token_preview | string | M2M only: first and last characters of the scm2m_ token. The full token is never listed. |
| short_token | string | M2M only: a masked preview, kept for older clients. |
| scopes | array | M2M only: read, write or both. |
| expires_at | string | M2M only: when the token stops working. |
| created_at, updated_at | string | ISO 8601 times. |
{ "id": "0193f950-1111-7222-8333-444444444444", "type": "magic", "status": true, "current": false, "display_name": null, "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...", "credential_id": null, "last_used_at": "2026-11-18T10:00:00.000Z", "last_used_at_ip": "203.0.113.7", "refresh_expiration": "2026-11-25T10:00:00.000Z", "access_expiration": null, "client_name": null, "scopes": null, "expires_at": null, "created_at": "2026-11-18T09:58:00.000Z", "updated_at": "2026-11-18T10:00:00.000Z"}The example shows a subset of the fields.