---
title: "The current principal and the org it acts in"
method: GET
path: "/v1/whoami"
tags: ["Account"]
---

# The current principal and the org it acts in

`GET /v1/whoami`

Returns the calling principal (API key or user session) and the organization the request acts in. 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.

## Response `200`

The caller's principal + acting org

- Whoami
  - `availableOrgs` OrgMembership[] — Every org the user belongs to (session only).
    - `features` OrgFeatures, required — Per-org feature entitlements the dashboard gates its UI on.
      - `batch` boolean, required — The org is allowlisted for the Batch API (batch-api.md §8).
      - `fabric` boolean, required — The org is allowlisted for the compute-fabric Pod product (FABRIC_ENABLED fleet-wide or FABRIC_ORGS). Gates the dashboard Pods surface (shadow rollout).
      - `perVmSshKeys` boolean, required — The org is allowlisted for per-VM SSH key scoping (the gateway honors each VM's sshKeyIds instead of accepting any org key). Gates the dashboard's per-VM key management (shadow rollout).
      - `publicEndpoint` boolean, required — Vestigial, always false. The public-endpoint feature is GA (ungated); this field is kept only to avoid a breaking response-contract change and will be removed in a follow-up deprecation PR.
    - `name` string, required
    - `organizationId` string, required
    - `role` string, required
  - `email` string — Set for a user session.
  - `organizationId` string, 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).
  - `organizationName` string
  - `principalType` 'api_key' | 'user', required — Whether the caller authenticated with an API key or a user session.
  - `role` string — The user's role in the acting org (session only).
  - `scopes` string[] — The API key's scopes (key principal only).
  - `userId` string — Set for a user session.

## Other responses

- `401` — Missing or invalid API key

---

[API](https://skmtc.net/openrelay/apis/openrelay-api.md) · [All operations](https://skmtc.net/openrelay/apis/openrelay-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openrelay/openrelay-api/versions/32905b8f44f8/schema)
