---
title: "Inspect the calling API key (caller introspection)"
method: GET
path: "/api-keys/whoami"
tags: ["Auth"]
---

# Inspect the calling API key (caller introspection)

`GET /api-keys/whoami`

## Request

- Base URL: `https://api.mnemom.ai/v1`
- URL: `https://api.mnemom.ai/v1/api-keys/whoami`
- Auth: API key in header `X-Mnemom-Api-Key`

Returns the resolved API key's identity: its scopes (capabilities), bound user/agent/org, and last-used metadata. Useful for clients to confirm scope and identity before issuing privileged calls.

## Response `200`

Caller identity.

- ApiKeyWhoAmI: Caller introspection — the principal authenticated for this request. Returned by `GET /v1/api-keys/whoami`. The handler is generalized across `cookie`, `jwt`, and `api_key` auth methods, so the API-key-specific fields (`key_id`, `account_id`, `scopes`) are null on cookie/JWT principals.
  - `user_id` string, required: Authenticated principal identifier (Supabase user UUID for cookie/JWT auth; api-key-bound user UUID for api_key auth).
  - `email` string, nullable
  - `auth_method` 'cookie' | 'jwt' | 'api_key', required
  - `key_id` string, nullable: API key id (e.g. `mnk_...`), or null for cookie/JWT auth.
  - `account_id` string, nullable: Billing account id, or null for cookie/JWT auth.
  - `org_id` string, nullable
  - `scopes` string[], nullable: Capability scopes (ADR-049) for api-key auth; null for cookie/JWT. e.g., ['gateway.send', 'gateway.observe'].
  - `is_admin` boolean, nullable

## Other responses

- `401`: Authentication required
- `404`: Resource not found
- `429`: Rate-limit exceeded. The global per-IP limiter (100 requests/minute, applied to every `/v1/*` route) rejected this request. Back off until the window resets — `Retry-After` carries the cooldown in seconds and `X-RateLimit-Reset` the absolute reset time.
- `500`: Server error — request was well-formed but the server failed to fulfill it. Typically a downstream dependency (DB / RPC / external API) returned an unexpected error.

---

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