Skip to main content
API keys let you authenticate requests to the Knowledge Stack API without a user session. They are intended for server-to-server integrations where there is no interactive user login. Pass your key in the Authorization header of every request:
Authorization: Bearer <your-api-key>
The full key value is only returned once, immediately after creation. Store it securely — you cannot retrieve it again.

Create API key

Creates a new API key and returns its full value. Store the returned key immediately.
POST https://api-staging.knowledgestack.ai/v1/api-keys
name
string
required
A human-readable label for this key (1–100 characters). Use a descriptive name so you can identify the key’s purpose later.
Example
curl -X POST https://api-staging.knowledgestack.ai/v1/api-keys \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"name": "production-ingest-service"}'
ResponseCreateApiKeyResponse
id
string
UUID of the API key.
name
string
The label you assigned to this key.
key
string
The full API key value. This is the only time it will be shown. Copy it now and store it securely (e.g. in a secrets manager).
key_suffix
string
The last few characters of the key, shown in list views so you can identify keys without exposing the full value.
created_at
string
ISO 8601 timestamp of key creation.
Example response
{
  "id": "k1k2k3k4-...",
  "name": "production-ingest-service",
  "key": "ks_live_abcdefghijklmnopqrstuvwxyz123456",
  "key_suffix": "3456",
  "created_at": "2026-04-04T10:00:00Z"
}

List API keys

Returns metadata for all API keys in the current tenant. The full key value is never returned in list or get responses.
GET https://api-staging.knowledgestack.ai/v1/api-keys
page
integer
Page number (1-indexed).
page_size
integer
Number of results per page.
Example
curl https://api-staging.knowledgestack.ai/v1/api-keys \
  -H "Authorization: Bearer <your-api-key>"
ResponsePaginatedResponse[ApiKeyResponse]
id
string
UUID of the API key.
name
string
Label assigned to the key.
key_suffix
string
Last few characters of the key for identification purposes.
created_at
string
ISO 8601 timestamp of key creation.

Get API key

Returns metadata for a single API key. The full key value is not included.
GET https://api-staging.knowledgestack.ai/v1/api-keys/{api_key_id}
api_key_id
string
required
UUID of the API key.
Example
curl https://api-staging.knowledgestack.ai/v1/api-keys/k1k2k3k4-... \
  -H "Authorization: Bearer <your-api-key>"
ResponseApiKeyResponse

Revoke API key

Permanently deletes an API key. Any requests using this key will immediately start returning 401 Unauthorized.
DELETE https://api-staging.knowledgestack.ai/v1/api-keys/{api_key_id}
api_key_id
string
required
UUID of the API key to revoke.
Revocation is immediate and irreversible. Ensure you’ve rotated the key in all services that use it before revoking.
Example
curl -X DELETE https://api-staging.knowledgestack.ai/v1/api-keys/k1k2k3k4-... \
  -H "Authorization: Bearer <your-api-key>"