REST API
API: API Keys
Programmatic access credentials. All endpoints require authentication unless noted. 6 endpoints.
GET /api/apikeys
Section titled “GET /api/apikeys”List your API keys
Responses: 200 · 400 · 401
POST /api/apikeys
Section titled “POST /api/apikeys”Generate a new API key
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | yes | |
scopes |
string | no | Comma-separated scopes: read (view and read-only queries), write (create, change, delete), admin (both), or named scopes such as source:read, dashboard:write, query:execute. AI features (the chat, Explain with AI, Analyze with a narrative, Summarize and the other AI actions) are available in the DataSquares app only: no scope lets a key use them, and an AI scope such as ai_chat:view is refused. A key never exceeds its owner’s role. Send the key in the X-API-Key header. |
expiresInDays |
integer | no | Key lifetime in days (default 90; keys always expire) |
Responses: 201 · 400 · 401 · 409
DELETE /api/apikeys/{id}
Section titled “DELETE /api/apikeys/{id}”Delete an API key
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | yes |
Responses: 204 — No content · 401 · 404
POST /api/apikeys/{id}/deactivate
Section titled “POST /api/apikeys/{id}/deactivate”Deactivate an API key
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | yes |
Responses: 204 — No content · 401 · 404
POST /api/apikeys/{id}/reactivate
Section titled “POST /api/apikeys/{id}/reactivate”Reactivate an API key
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | yes |
Responses: 204 — No content · 401 · 404
POST /api/apikeys/bulk-delete
Section titled “POST /api/apikeys/bulk-delete”Delete multiple API keys in bulk
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
ids |
array of string | yes |
Responses: 200 · 400 · 401 · 404