---
title: "Create an API key"
method: POST
path: "/v1/accounts/api-keys"
tags: ["account"]
---

# Create an API key

`POST /v1/accounts/api-keys`

## Request

- Base URL: `https://api.replylayer.ai`
- URL: `https://api.replylayer.ai/v1/accounts/api-keys`
- Auth: HTTP bearer

## Request body

- object
  - `label` string
  - `mailbox_ids` string[]
  - `role` 'admin' | 'agent', required

## Response `201`

Created

- object
  - `api_key` string, required
  - `id` string, required
  - `label` string, nullable
  - `mailbox_ids` string[], required
  - `role` 'admin' | 'agent', required

## Other responses

- `400`: Validation error
- `401`: Missing or invalid API key (code: UNAUTHORIZED)
- `403`: Forbidden
- `422`: Unprocessable entity
- `429`: Rate limited (code: RATE_LIMITED)
- `500`: Internal error (code: INTERNAL_ERROR)

---

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