# Identity

Who the calling key is and what it can do.

API reference. Base URL: `https://api.mirabase.dev`

## Read the current identity

`GET /v2/whoami`

The authenticated principal, the key in use, and the effective capabilities. Needs no capability, so a key that lost all of them can still see what it has left.

**Capability** No capability is checked.

Guide: [Authentication and API keys](https://mirabase.io/developers/authentication.md#whoami)

### Responses

- `200` `application/json` `DevWhoami`

### Error statuses

`400` `401` `403` `404` `422` `429` `500` `503` See [Errors](https://mirabase.io/developers/conventions.md#errors) for the error shape and [Error codes](https://mirabase.io/developers/errors.md) for what each code means.

### Example request

```bash
curl "https://api.mirabase.dev/v2/whoami" \
  -H "Authorization: Bearer $MIRABASE_API_KEY"
```

### Example response

```json
{
  "tenant_id": "<tenant_id>",
  "principal": {
    "id": "<id>",
    "kind": "human",
    "roles": [
      "<roles>"
    ],
    "capabilities": [
      "knowledge:read"
    ],
    "created_at": "2026-11-06T00:00:00Z"
  },
  "effective_capabilities": [
    "knowledge:read"
  ]
}
```
