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

# Api keys

## API Keys

Manage your API keys.

### List keys

GET `/api/v1/api-keys/`

Response

```json theme={null}
{
  "api_keys": [
    {
      "id": 1,
      "name": "Server key",
      "prefix": "a1b2c3d4",
      "is_active": true,
      "last_used": "2025-06-09T11:22:33Z",
      "created_at": "2025-06-08T12:00:00Z",
      "updated_at": "2025-06-08T12:00:00Z"
    }
  ]
}
```

### Create key

POST `/api/v1/api-keys/`

Body

```json theme={null}
{ "name": "Server key" }
```

Response (note: `key` is only returned once)

```json theme={null}
{
  "id": 2,
  "name": "Server key",
  "prefix": "9f84ab12",
  "is_active": true,
  "last_used": null,
  "created_at": "2025-06-09T10:00:00Z",
  "updated_at": "2025-06-09T10:00:00Z",
  "key": "9f84ab12.qwerty..."
}
```

### Rotate key

POST `/api/v1/api-keys/{id}/rotate/`

Response

```json theme={null}
{
  "id": 2,
  "name": "Server key",
  "prefix": "6c3a9d77",
  "is_active": true,
  "last_used": null,
  "created_at": "2025-06-09T10:00:00Z",
  "updated_at": "2025-06-09T10:05:00Z",
  "key": "6c3a9d77.abcd..."
}
```

* Old key is invalidated immediately

### Revoke key

POST `/api/v1/api-keys/{id}/revoke/`

Response

```json theme={null}
{ "success": true }
```

### Notes

* Store the `key` securely when creating/rotating; you won’t be able to retrieve the secret again.
* Use the `prefix` to identify keys without exposing the full secret.
