Account

The current principal and the org it acts in

Changed on

Returns the calling principal (API key or user session) and the organization the request acts in, with the org's name and, for a key, its id, name and budget. For an API key that org is fixed by the key; for a session it is the active org, and availableOrgs lists every org the user belongs to. Unlike /v1/me this works for API keys and does not onboard.

Requires the self.read permission. See Permissions for the roles and API key permissions that include it.

get/v1/whoami

Request

  • Base URL
    https://api.openrelay.inc
  • URL
    https://api.openrelay.inc/v1/whoami
  • Auth
    HTTP bearer

Response

The caller's principal + acting org

emailstring

Set for a user session.

keyKind'personal' | 'org' | 'legacy'

Key principal only.

organizationIdstring required

The org this request acts in (fixed for a key, the active org for a session; may be empty for a session mid-onboarding).

organizationNamestring
ownerUserIdstring

A personal key's owner.

permissionsstring[]

Every action this caller may perform in the acting organization, after its role, key restrictions and guardrails (permissions enabled, or a personal key).

platformAdminboolean

Whether this caller may use the /v1/admin/* surface. Absent means no, so a client that ignores the field fails closed. This is the whole answer for every principal: true for the session of an allowlisted platform admin and for the platform admin token, never for a customer API key. principalType answers a different question, how the caller authenticated, and the two do not line up: an allowlisted session is principalType "user" with platformAdmin true. Read this field, not that one, to decide what an admin surface may show.

principalType'api_key' | 'user' | 'platform_admin' required

Whether the caller authenticated with an API key, a user session, or the platform admin token.

rolestring

The user's role in the acting org (session only).

roleNamestring

The role's display name (permissions enabled only).

scopesstring[]

The API key's scopes (key principal only).

userIdstring

Set for a user session.

Changes

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      removed the service enum value from the response property for the response status