Skip to content
Esc
↑↓navigate↵open⌘Jpreview

Get the current identity

Returns the user, their teams and the active team for the calling credential.

GET/me
Authorization
AuthorizationBearer token (varsafe CLI grant) · headerrequired

An opaque, database-backed credential obtained through the device authorization grant (POST /auth/cli/device) and revocable on the spot. Presented as Authorization: Bearer <token>. A route accepts it only when it declares CLI access; the scopes it must hold are listed per operation under x-varsafe-cli-scopes.

or
__Secure-varsafe.session_tokenAPI key · cookierequired

The browser session cookie issued to the dashboard (named varsafe.session_token without the __Secure- prefix on non-production deployments). Listed for completeness: it authorizes the same routes, but programmatic callers should use an API token or a CLI grant.

Responses
200

Success.

userobjectrequired
Show properties
idstringrequired
min length 1
emailstring<email>required
namestringrequired
min length 1 · max length 255
createdAtstringrequired
emailVerifiedboolean
hasPasswordboolean
twoFactorEnabledboolean
passkeyOnlyModeboolean
isPlatformAdminboolean
teamsobject[]required
Show properties
Array of object
idstring<uuid>required
namestringrequired
min length 1 · max length 255
rolestringrequired
Allowed:owneradmindeveloperoperatorviewerbilling
maxActiveSessionsnumberrequired
activeSessionCountnumberrequired
400

The request failed validation. field names the offending input.

statusCodeintegerrequired

HTTP status code, repeated in the body.

min -9007199254740991 · max 9007199254740991
codestringrequired

Stable machine-readable error code, e.g. SECRET_NOT_FOUND or FORBIDDEN. Branch on this, never on the message.

messagestringrequired

Human-readable explanation. Wording may change.

fieldstring

The offending request field, present on validation failures.

401

No credential was presented, or it is invalid or revoked.

statusCodeintegerrequired

HTTP status code, repeated in the body.

min -9007199254740991 · max 9007199254740991
codestringrequired

Stable machine-readable error code, e.g. SECRET_NOT_FOUND or FORBIDDEN. Branch on this, never on the message.

messagestringrequired

Human-readable explanation. Wording may change.

fieldstring

The offending request field, present on validation failures.

403

The credential is valid but lacks the required scope, role or team access.

statusCodeintegerrequired

HTTP status code, repeated in the body.

min -9007199254740991 · max 9007199254740991
codestringrequired

Stable machine-readable error code, e.g. SECRET_NOT_FOUND or FORBIDDEN. Branch on this, never on the message.

messagestringrequired

Human-readable explanation. Wording may change.

fieldstring

The offending request field, present on validation failures.

404

The resource does not exist, or is not visible to this credential.

statusCodeintegerrequired

HTTP status code, repeated in the body.

min -9007199254740991 · max 9007199254740991
codestringrequired

Stable machine-readable error code, e.g. SECRET_NOT_FOUND or FORBIDDEN. Branch on this, never on the message.

messagestringrequired

Human-readable explanation. Wording may change.

fieldstring

The offending request field, present on validation failures.

429

Rate limited. Retry after the interval named in the response.

statusCodeintegerrequired

HTTP status code, repeated in the body.

min -9007199254740991 · max 9007199254740991
codestringrequired

Stable machine-readable error code, e.g. SECRET_NOT_FOUND or FORBIDDEN. Branch on this, never on the message.

messagestringrequired

Human-readable explanation. Wording may change.

fieldstring

The offending request field, present on validation failures.

500

Unexpected server error. The body never carries internal detail.

statusCodeintegerrequired

HTTP status code, repeated in the body.

min -9007199254740991 · max 9007199254740991
codestringrequired

Stable machine-readable error code, e.g. SECRET_NOT_FOUND or FORBIDDEN. Branch on this, never on the message.

messagestringrequired

Human-readable explanation. Wording may change.

fieldstring

The offending request field, present on validation failures.

Try it
Server
Authorization
Request
curl -X GET 'https://api.varsafe.dev/me' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "user": {
    "id": "string",
    "email": "user@example.com",
    "name": "string",
    "createdAt": "string",
    "emailVerified": true,
    "hasPassword": true,
    "twoFactorEnabled": true,
    "passkeyOnlyMode": true,
    "isPlatformAdmin": true
  },
  "teams": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "string",
      "role": "owner"
    }
  ],
  "maxActiveSessions": 0,
  "activeSessionCount": 0
}