---
title: "Who am I (Bearer whoami)"
method: GET
path: "/agent/identity"
tags: ["OAuth"]
---

# Who am I (Bearer whoami)

`GET /agent/identity`

## Request

- Base URL: `https://codeatlas.com.br`
- URL: `https://codeatlas.com.br/agent/identity`
- Auth: OAuth 2 (client credentials, token URL `https://codeatlas.com.br/oauth2/token`, scopes: `api:write`)

Returns the identity behind a Bearer token: client_id, scopes, audience, expiry and, for service_auth registrations, the confirmed email. Accepts production and sandbox tokens. 401 with a WWW-Authenticate Bearer challenge when the token is missing or invalid.

## Response `200`

The caller.

- AgentIdentity
  - `client_id` string, required
  - `audience` string, uri, required
  - `scopes` string[], required
  - `expires_at` string, date-time, required
  - `issued_at` string, date-time, required
  - `issuer` string, uri, required
  - `email` string, nullable, required: Confirmed email for service_auth registrations, otherwise null.
  - `registration_type` 'dynamic_client' | 'service_auth', required
  - `sandbox` boolean, required

## Other responses

- `401`: Missing, malformed, expired or wrong-audience Bearer token. WWW-Authenticate carries the resource metadata URL.
- `405`: The HTTP method is not supported.

---

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