> ## Documentation Index
> Fetch the complete documentation index at: https://docs.boltroute.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create API key

> Create a new API key.

## Overview

Create a new API key for integrations; the plaintext key is returned once in the response.

## POST /api/v1/api-keys

Purpose: create a new API key. The plaintext key is returned only once.

Body:

```json theme={null}
{ "name": "My Production Key", "purpose": "zapier" }
```

Allowed `purpose` values: `zapier`, `n8n`, `google sheets`, `custom`.

Example request:

```bash theme={null}
curl -X POST \
  'https://api.boltroute.ai/api/v1/api-keys' \
  -H 'Content-Type: application/json' \
  -d '{"name":"My Production Key","purpose":"zapier"}'
```

### Response

Status: `201 Created`

Example response:

```json theme={null}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "user_id": "550e8400-e29b-41d4-a716-446655440000",
  "key": "sk_live_example",
  "name": "My Production Key",
  "purpose": "zapier",
  "created_at": "2025-01-01T12:00:00Z"
}
```

Response fields:

* `key`: plaintext key (store securely; it can be retrieved later with `GET /api/v1/api-keys?reveal=true`).

Errors:

* `400` invalid request.
* `401` unauthorized.
* `500` internal error (including missing `ENCRYPTION_KEY`).
