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

# Create API Key

> Create a new API key

## Endpoint

```
POST https://api.documind.cloud/api/v1/auth/api-keys
```

## Authentication

Requires `api_keys:write` scope.

## Request Body

| Field             | Type    | Required | Description                                      |
| ----------------- | ------- | -------- | ------------------------------------------------ |
| `name`            | string  | Yes      | API key name                                     |
| `description`     | string  | No       | API key description                              |
| `scopes`          | array   | No       | Permission scopes                                |
| `expires_in_days` | number  | No       | Expiration in days                               |
| `org_wide`        | boolean | No       | Associate the key with the caller's organization |
| `project_name`    | string  | No       | Project label stored with the key                |

## Response

```json theme={null}
{
  "id": "key-id",
  "key": "your-api-key-here",
  "name": "Production Key",
  "description": "Production automation",
  "prefix": "abc12345",
  "scopes": ["extractions:read", "extractions:write"],
  "is_active": true,
  "is_revoked": false,
  "project_name": "Invoices",
  "expires_at": null,
  "last_used_at": null,
  "revoked_at": null,
  "created_at": "2026-06-02T10:00:00Z",
  "updated_at": "2026-06-02T10:00:00Z"
}
```

<Warning>
  The full API key is only returned once upon creation. Store it securely.
</Warning>
