# WhoamiResult

The WhoamiResult type of the TypeScript SDK, which auth.whoami take or answer.

```ts
type WhoamiResult = {
  accountId: string | null
  credentialId: string | null
  domains?: string[]
  idleExpiresAt: number | null
  keyId: string | null
  kind: string | null
  mailboxId: string | null
  permittedRecipients?: string[]
  scope: ('read' | 'write' | 'send' | 'full') | null
  type: ('system' | 'account' | 'mailbox')
}
```

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `accountId` | `string` \| `null` | Owning account ID, or null for system keys |
| `credentialId` | `string` \| `null` | Credential ULID for mailbox app passwords, or null |
| `domains` | `string[]` | Optional. An account key's domain scope (migration 0078), sorted — ABSENT for an unscoped key and for every other credential kind. Present, this key reaches only these domains' directory and the mailboxes with an address on them; a call outside that answers 404 (a resource) or 403 account_credentials_required (the account tier, and JMAP). |
| `idleExpiresAt` | `number` \| `null` | The idle deadline computed from the key's recorded last use (or creation if no use is recorded), in epoch seconds, or null when it never lapses. Usage updates are best-effort and coalesced with a five-minute interval, so successful use may not immediately advance this deadline. This response can precede its own request's renewal. |
| `keyId` | `string` \| `null` | API key ID for system or account bearers, or null for mailbox app passwords |
| `kind` | `string` \| `null` | What this key is ('cli' for one the browser login minted), or null — including for every mailbox app password, which has no key row. Display metadata; nothing authorizes on it. |
| `mailboxId` | `string` \| `null` | Mailbox ULID for mailbox app passwords, or null |
| `permittedRecipients` | `string[]` | Optional. A mailbox credential's OWN outbound recipient allowlist (design D50) — exact addresses and `*@domain` wildcards, INTERSECTED with the identity's at every submission site, so this list is a bound and not a promise that everything in it is deliverable. ABSENT when this credential carries no list of its own (the `domains` convention), which is not the same fact as `[]`: an empty array is a credential permitted to send to NOBODY. Here so an agent door learns its correspondents up front instead of discovering them as a per-recipient `recipient_not_permitted` |
| `scope` | `('read' \| 'write' \| 'send' \| 'full') \| null` | A mailbox credential's scope — 'read', 'write', 'send' or 'full' — or null for an API key. What this bearer may do of what its mailbox may do; a call outside it answers 403 credential_scope naming the rung it needs |
| `type` | `('system' \| 'account' \| 'mailbox')` | Bearer credential permission scope |

## Used by

| Method | What it does |
| --- | --- |
| [`auth.whoami`](/docs/sdks/typescript/auth/whoami) | Get current authenticated identity |
