---
title: "Get the calling credential"
method: GET
path: "/v1/whoami"
tags: ["Whoami"]
---

# Get the calling credential

`GET /v1/whoami`

## Request

- Base URL: `https://api.samva.dev`
- URL: `https://api.samva.dev/v1/whoami`
- Auth: API key in header `x-api-key`

Returns the organization the request acts in and the credential it presents: an API key with its name, prefix, and access, or a signed-in user with their role. Any valid credential may call it, whatever its grants.

## Response `200`

Whoami

- Whoami
  - `organization` WhoamiOrganization, required
    - `id` string, required
    - `slug` string, required
    - `name` string, required
  - `credential` union, required
    - WhoamiApiKeyCredential
      - `type` 'apiKey', required
      - `id` string, required
      - `name` string, required
      - `start` string, nullable, required
      - `access` union, required
        - object
          - `mode` 'full', required
        - object
          - `mode` 'restricted', required
          - `resources` ApiKeyResourceAccess, required
            - `messages` 'read' | 'write', nullable
            - `email` 'read' | 'write', nullable
            - `domains` 'read' | 'write', nullable
            - `phoneNumbers` 'read' | 'write', nullable
            - `contacts` 'read' | 'write', nullable
            - `conversations` 'read' | 'write', nullable
            - `templates` 'read' | 'write', nullable
            - `webhooks` 'read' | 'write', nullable
            - `apiKeys` 'read' | 'write', nullable
            - `organization` 'read' | 'write', nullable
            - `billing` 'read' | 'write', nullable
            - `analytics` 'read' | 'write', nullable
          - `mailboxes` ApiKeyMailboxAccess
            - `permissions` string[], required: `read` reads mailboxes, threads, and messages; `update` changes thread state, labels, drafts, and notes; `send` sends and replies; `quarantine.read` reads quarantined mail.
            - `mailboxIds` MailboxId[], nullable: The mailboxes the key may act on. Omit to reach every mailbox the owner can.
            - `sendMode` 'send' | 'approval': How the grantee's sends execute: `send` runs them within account limits; `approval` holds each one until a different member approves it.
          - `namespaceId` string
    - WhoamiUserCredential
      - `type` 'user', required
      - `user` WhoamiUser, required
        - `id` string, required
        - `name` string, required
        - `email` string, required
      - `role` 'member' | 'admin' | 'owner', required

## Other responses

- `401`: UnauthorizedError
- `403`: ForbiddenError
- `422`: ValidationError
- `500`: InternalError
- `504`: GatewayTimeoutError

---

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