whoami API

whoami

Introspect the admin API key being used. Returns the key's identity, the org it belongs to, the scopes it carries (legacy NULL-scope keys are expanded to the fallback set), and the creator if known.

GET /v1/whoami

Identify the admin API key on this request

Auth: Admin API key

Responses

200 Auth context for the current request
created_at
- ISO 8601 timestamp the key was minted
created_by
- Object with user_id, name, email — null if the creator was deleted or for legacy pre-#1282 keys
key_id
- UUID of the admin API key
key_name
- Human-readable name set at mint time
key_prefix
- First 12 characters of the key (e.g. eb_admin_INl)
last_used_at
- ISO 8601 timestamp of the most recent authenticated request — null if the key has never been used
org_id
- UUID of the org the key belongs to
org_name
- Display name of the org
scopes
- Array of granted scope strings
401 Missing or invalid admin API key

Example

Request
curl https://api.tripswitch.dev/v1/whoami \
  -H "Authorization: Bearer eb_admin_..."
Response
{
  "key_id": "550e8400-e29b-41d4-a716-446655440000",
  "key_prefix": "eb_admin_INl",
  "key_name": "CI deploy key",
  "org_id": "770e8400-e29b-41d4-a716-446655440000",
  "org_name": "Tripswitch",
  "scopes": ["projects:read", "breakers:write"],
  "created_by": {
    "user_id": "880e8400-e29b-41d4-a716-446655440000",
    "name": "Matt Carlone",
    "email": "matt@example.com"
  },
  "created_at": "2026-01-15T10:23:00Z",
  "last_used_at": "2026-05-20T14:01:33Z"
}