# API keys

> List and create API keys programmatically.

Source: https://tickos.dev/docs/api-keys

Manage the API keys of your workspace. Both endpoints require a key with admin permission. Revoking and deleting keys is only available from the dashboard (Settings > Developers); there is no API endpoint for it.

## GET /v1/keys -- List API keys

Permission: admin. Returns every key of the workspace, newest first, including revoked ones. The full token is never returned in list responses. The list is not paginated.

| Field | Type | Description |
|---|---|---|
| id | string | Key ID. |
| name | string | Descriptive name. |
| key_prefix | string | First characters of the token, to recognize the key. |
| permission | string | read, write or admin. |
| is_active | boolean | false when the key has been revoked. Revoked keys are rejected with 401. |
| last_used_at | string \| null | Last time the key was used. |
| created_at | string | Creation date (ISO 8601). |

```json
{
  "data": [
    {
      "id": "...",
      "name": "Production API",
      "key_prefix": "sk_1a2b3c4d",
      "permission": "write",
      "is_active": true,
      "last_used_at": "2026-10-12T18:30:00.000Z",
      "created_at": "2026-09-01T10:00:00.000Z"
    }
  ],
  "meta": { "total": 1 }
}
```

## POST /v1/keys -- Create an API key

Permission: admin. The new key belongs to the same workspace as the key making the request.

| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Descriptive name for the key. |
| permission | string | Yes | read, write, or admin. |

```bash
curl https://api.tickos.dev/v1/keys \
  -H 'Authorization: Bearer sk_your_api_key' \
  -H 'Content-Type: application/json' \
  -d '{ "name": "Production API", "permission": "write" }'
```

Returns 201 with id, name, token (the full sk_... key), key_prefix, permission, created_at and a warning reminder. Missing fields or an invalid permission return 400.

> **Save the token:** The full API token (sk_...) is only shown in the creation response. It cannot be retrieved later. Store it securely.
