---
title: "Who this credential is, its scopes, its connection's caps and spend, and the account and organization it acts in."
method: GET
path: "/v1/whoami"
tags: ["status"]
---

# Who this credential is, its scopes, its connection's caps and spend, and the account and organization it acts in.

`GET /v1/whoami`

## Request

- Base URL: `https://api.50heads.com`
- URL: `https://api.50heads.com/v1/whoami`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://auth.50heads.com/authorize`, token URL `https://auth.50heads.com/token`; client credentials, token URL `https://auth.50heads.com/token`)

Any key, connected app, service account or signed-in person; no scope needed. `organization` is null unless organizations are switched on for the team (and, for keys and apps, machine identities too).

## Response `200`

OK

- WhoamiResponse
  - `principal` object, required
    - `type` 'person' | 'service_account', required
    - `id` string, required
    - `email` string, nullable, required
  - `auth` 'session' | 'api_key' | 'oauth' | 'device', required: How this request signed in.
  - `scopes` string[], nullable, required: What the key or grant may do; null for a person signed in at 50heads.com or in the app (every scope).
  - `connection` object, nullable, required: The key's or connected app's connection, with its caps and spend; null for a person's session.
    - `id` string, required
    - `kind` 'oauth' | 'key' | 'app', required
    - `clientId` string, nullable, required
    - `clientName` string, required
    - `host` string, nullable, required
    - `scopes` string[], required
    - `capDailyPence` integer, required
    - `spentTodayPence` integer, required
    - `spentMonthPence` integer, required
    - `protocolVersion` string, nullable, required
    - `validatesIss` boolean, nullable, required
    - `createdAt` string, required
    - `lastUsedAt` string, nullable, required
    - `capMonthlyPence` integer, nullable
    - `capQuestionPence` integer, nullable
    - `teamId` string, nullable
  - `account` object, required: The account this request acts for (personal, or the team in the account header or the key's team).
    - `kind` 'personal' | 'team', required
    - `teamId` string, nullable, required
    - `teamName` string, nullable, required
    - `role` 'owner' | 'admin' | 'member' | 'viewer' | 'billing', nullable, required
  - `organization` object, nullable, required: The team's organization, where organizations are switched on for it; otherwise null.
    - `id` string, required
    - `name` string, required
    - `admin` boolean, required

## Other responses

- `401`: No key or token, or it expired or was revoked.
- `403`: The key or token lacks the scope (`insufficient_scope`), or the action is not allowed.
- `429`: Too many requests; wait for Retry-After.

---

[API](https://skmtc.dev/50heads/apis/50heads-api.md) · [All operations](https://skmtc.dev/50heads/apis/50heads-api/llms.txt) · [OpenAPI document](https://skmtc.dev/50heads/apis/50heads-api/revisions/20175e8b00e3?raw)
