---
title: "Create API Key"
method: POST
path: "/v0/inboxes/{inbox_id}/api-keys"
tags: ["InboxesApiKeys"]
---

# Create API Key

`POST /v0/inboxes/{inbox_id}/api-keys`

**CLI:**
```bash
agentmail inboxes:api-keys create --inbox-id <inbox_id> --name "My Key"
```

## Path parameters

- `inbox_id` string, required — The ID of the inbox.

## Request body

- CreateApiKeyRequest
  - `name` string — Name of api key.
  - `permissions` ApiKeyPermissions — Granular permissions for the API key. When ommitted all permissions are granted. Otherwise, only permissions set to true are granted.
    - `inbox_read` boolean, nullable — Read inbox details.
    - `inbox_create` boolean, nullable — Create new inboxes.
    - `inbox_update` boolean, nullable — Update inbox settings.
    - `inbox_delete` boolean, nullable — Delete inboxes.
    - `thread_read` boolean, nullable — Read threads.
    - `thread_delete` boolean, nullable — Delete threads.
    - `message_read` boolean, nullable — Read messages.
    - `message_send` boolean, nullable — Send messages.
    - `message_update` boolean, nullable — Update message labels.
    - `label_spam_read` boolean, nullable — Access messages labeled spam.
    - `label_blocked_read` boolean, nullable — Access messages labeled blocked.
    - `label_trash_read` boolean, nullable — Access messages labeled trash.
    - `draft_read` boolean, nullable — Read drafts.
    - `draft_create` boolean, nullable — Create drafts.
    - `draft_update` boolean, nullable — Update drafts.
    - `draft_delete` boolean, nullable — Delete drafts.
    - `draft_send` boolean, nullable — Send drafts.
    - `webhook_read` boolean, nullable — Read webhook configurations.
    - `webhook_create` boolean, nullable — Create webhooks.
    - `webhook_update` boolean, nullable — Update webhooks.
    - `webhook_delete` boolean, nullable — Delete webhooks.
    - `domain_read` boolean, nullable — Read domain details.
    - `domain_create` boolean, nullable — Create domains.
    - `domain_update` boolean, nullable — Update domains.
    - `domain_delete` boolean, nullable — Delete domains.
    - `list_entry_read` boolean, nullable — Read list entries.
    - `list_entry_create` boolean, nullable — Create list entries.
    - `list_entry_delete` boolean, nullable — Delete list entries.
    - `metrics_read` boolean, nullable — Read metrics.
    - `api_key_read` boolean, nullable — Read API keys.
    - `api_key_create` boolean, nullable — Create API keys.
    - `api_key_delete` boolean, nullable — Delete API keys.
    - `pod_read` boolean, nullable — Read pods.
    - `pod_create` boolean, nullable — Create pods.
    - `pod_delete` boolean, nullable — Delete pods.

## Response `200`

- CreateApiKeyResponse
  - `api_key_id` string, required — ID of api key.
  - `api_key` string, required — API key.
  - `prefix` string, required — Prefix of api key.
  - `name` string, required — Name of api key.
  - `pod_id` string, nullable — Pod ID the api key is scoped to.
  - `inbox_id` string, nullable — Inbox ID the api key is scoped to.
  - `permissions` ApiKeyPermissions — Granular permissions for the API key. When ommitted all permissions are granted. Otherwise, only permissions set to true are granted.
    - `inbox_read` boolean, nullable — Read inbox details.
    - `inbox_create` boolean, nullable — Create new inboxes.
    - `inbox_update` boolean, nullable — Update inbox settings.
    - `inbox_delete` boolean, nullable — Delete inboxes.
    - `thread_read` boolean, nullable — Read threads.
    - `thread_delete` boolean, nullable — Delete threads.
    - `message_read` boolean, nullable — Read messages.
    - `message_send` boolean, nullable — Send messages.
    - `message_update` boolean, nullable — Update message labels.
    - `label_spam_read` boolean, nullable — Access messages labeled spam.
    - `label_blocked_read` boolean, nullable — Access messages labeled blocked.
    - `label_trash_read` boolean, nullable — Access messages labeled trash.
    - `draft_read` boolean, nullable — Read drafts.
    - `draft_create` boolean, nullable — Create drafts.
    - `draft_update` boolean, nullable — Update drafts.
    - `draft_delete` boolean, nullable — Delete drafts.
    - `draft_send` boolean, nullable — Send drafts.
    - `webhook_read` boolean, nullable — Read webhook configurations.
    - `webhook_create` boolean, nullable — Create webhooks.
    - `webhook_update` boolean, nullable — Update webhooks.
    - `webhook_delete` boolean, nullable — Delete webhooks.
    - `domain_read` boolean, nullable — Read domain details.
    - `domain_create` boolean, nullable — Create domains.
    - `domain_update` boolean, nullable — Update domains.
    - `domain_delete` boolean, nullable — Delete domains.
    - `list_entry_read` boolean, nullable — Read list entries.
    - `list_entry_create` boolean, nullable — Create list entries.
    - `list_entry_delete` boolean, nullable — Delete list entries.
    - `metrics_read` boolean, nullable — Read metrics.
    - `api_key_read` boolean, nullable — Read API keys.
    - `api_key_create` boolean, nullable — Create API keys.
    - `api_key_delete` boolean, nullable — Delete API keys.
    - `pod_read` boolean, nullable — Read pods.
    - `pod_create` boolean, nullable — Create pods.
    - `pod_delete` boolean, nullable — Delete pods.
  - `created_at` string, date-time, required — Time at which api key was created.

## Other responses

- `400`
- `404`

## Changes

- **2026-07-15** `394ddcdd9c29` — 7 info
  - added the optional property `code` to the response with the `400` status
  - added the optional property `code` to the response with the `404` status
  - added the optional property `docs` to the response with the `400` status
  - added the optional property `docs` to the response with the `404` status
  - …3 more
- **2026-04-08** `69e3767c5ada` — 2 info
  - the request property `name` became nullable
  - the request property `name` became optional
- **2026-03-31** `27965096e618` — 1 info
  - endpoint added
- **2026-03-28** `8a5b5e92ae2d` — 1 breaking
  - api path removed without deprecation
- **2026-03-23** `add9c40c7e57` — 70 warning, 70 info
  - removed the request property `permissions/create_api_key`
  - removed the request property `permissions/create_domain`
  - removed the request property `permissions/create_draft`
  - removed the request property `permissions/create_inbox`
  - …136 more

[Full history](https://skmtc.dev/agentmail-to/apis/api/changes/v0/inboxes/:inbox_id/api-keys/post.md)

---

[API](https://skmtc.dev/agentmail-to/apis/api.md) · [All operations](https://skmtc.dev/agentmail-to/apis/api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/agentmail-to/api/revisions/394ddcdd9c29/schema)
