API keys
Public and secret keys, scopes, rotation.
5 endpoints.
GET /v1/keysPOST /v1/keysPATCH /v1/keys/{key_id}DELETE /v1/keys/{key_id}POST /v1/keys/{key_id}/rotate
GET
/v1/keysKeys List
Needs a key or a dashboard session
Responses
- 200Successful Response
ApiKeyOut[]
POST
/v1/keysCreate a key (the full key is returned once)
Needs a key or a dashboard session
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | null | no | Unique per logical write (8-255 chars). Retries with the same key are safe. · pattern ^[A-Za-z0-9_\-:.]{8,255}$ |
Request body application/json ApiKeyCreate
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | max length 100 |
kind | "public" | "secret" | yes | |
scopes | string[] | null | no | Default: search, events (public) or all non-admin scopes (secret). |
allowed_origins | string[] | no | Public keys: browser origins allowed. |
expires_at | string (date-time) | null | no |
Responses
- 201Successful Response
ApiKeyCreated
PATCH
/v1/keys/{key_id}Keys Update
Needs a key or a dashboard session
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
key_id | path | string | yes |
Request body application/json ApiKeyUpdate
| Name | Type | Required | Description |
|---|---|---|---|
name | string | null | no | max length 100 |
scopes | string[] | null | no | |
allowed_origins | string[] | null | no |
Responses
- 200Successful Response
ApiKeyOut
DELETE
/v1/keys/{key_id}Revoke a key now
Needs a key or a dashboard session
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
key_id | path | string | yes |
Responses
- 200Successful Response
Deleted
POST
/v1/keys/{key_id}/rotateNew key now; the old one works for grace_hours more
Needs a key or a dashboard session
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
key_id | path | string | yes |
Request body application/json ApiKeyRotate
| Name | Type | Required | Description |
|---|---|---|---|
grace_hours | integer | no | The old key keeps working this long.default 24 · min 0 · max 720 |
Responses
- 200Successful Response
ApiKeyCreated
Data shapes on this page
ApiKeyOut
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
name | string | yes | |
kind | "public" | "secret" | yes | |
prefix | string | yes | |
last4 | string | yes | |
scopes | string[] | yes | |
allowed_origins | string[] | yes | |
created_at | string (date-time) | yes | |
last_used_at | string (date-time) | null | no | |
expires_at | string (date-time) | null | no | |
revoked_at | string (date-time) | null | no |
ApiKeyCreate
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | max length 100 |
kind | "public" | "secret" | yes | |
scopes | string[] | null | no | Default: search, events (public) or all non-admin scopes (secret). |
allowed_origins | string[] | no | Public keys: browser origins allowed. |
expires_at | string (date-time) | null | no |
ApiKeyCreated
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
name | string | yes | |
kind | "public" | "secret" | yes | |
prefix | string | yes | |
last4 | string | yes | |
scopes | string[] | yes | |
allowed_origins | string[] | yes | |
created_at | string (date-time) | yes | |
last_used_at | string (date-time) | null | no | |
expires_at | string (date-time) | null | no | |
revoked_at | string (date-time) | null | no | |
key | string | yes | The full key. Shown ONCE; only a hash is stored. |
ApiKeyUpdate
| Name | Type | Required | Description |
|---|---|---|---|
name | string | null | no | max length 100 |
scopes | string[] | null | no | |
allowed_origins | string[] | null | no |
Deleted
| Name | Type | Required | Description |
|---|---|---|---|
deleted | boolean | no | default true |
id | string | yes |
ApiKeyRotate
| Name | Type | Required | Description |
|---|---|---|---|
grace_hours | integer | no | The old key keeps working this long.default 24 · min 0 · max 720 |