# Create API key

URL: /en/docs/api/v1/integrations/api-keys/post
Last Updated: 2026-07-30T21:15:30.112Z

## Description
No description available.

## Available Actions
- Execute POST request
- View request parameters
- View response schema
- Get code examples
- Navigate to related topics
- View step-by-step instructions
- Get best practices

## Content
### POST /api/v1/integrations/api-keys

**Create API key**

Create a new API key with specified permissions and metadata. The encrypted bearer API key is returned once.

**Authentication:** Bearer token (`Authorization: Bearer <token>`)

**Request body** (`application/json`) - required:

- `name` (string, required): Human-readable name for the API key
- `description` (string): Description of the API key purpose
- `role` (enum: account_manager | admin | content_manager | viewer, required): Role/permissions for this API key
- `expiration` (enum: 30days | 90days | 1year | never): Optional expiration preset

Example (Basic API key):

```json
{
  "name": "Production Integration",
  "role": "account_manager"
}
```

**Responses:**

- `201` - API key created successfully
  - `success` (boolean)
  - `data` (object)
    - `token` (object)
      - `id` (string (uuid)): The API key ID
      - `name` (string): The API key name
      - `description` (string): The API key description
      - `token` (string): Encrypted bearer API key. The API returns this value only once. The format is tc_ak1.v1.<base64url-iv>.<base64url-authentication-tag>.<base64url-ciphertext>.
      - `role` (string): Directus role identifier assigned to the API key user
      - `expires_at` (string (date-time)): When the API key expires (null if never expires)
      - `created_at` (string (date-time)): When the API key was created
    - `id` (string (uuid)): The user ID created for this API key
- `400` - Bad Request - validation failed
  - `error` (string, required)
- `401` - Unauthorized
- `403` - Forbidden - Admin role required
- `500` - Internal server error

**Code samples:**

cURL:

```bash
curl -X POST "https://app.orbiqhq.com/api/v1/integrations/api-keys" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Production API Key",
  "role": "account_manager"
}'
```

