Skip to main content
POST
Mint an API key

Authorizations

Authorization
string
header
required

User session JWT or instance API key (iak_*). Send as Authorization: Bearer <token>.

Path Parameters

knowledgeBaseId
string
required

Knowledge base id. Legacy physical prefix vs_ (the kb_ rename is deferred).

Maximum string length: 128
Pattern: ^vs_[A-Za-z0-9-]+$

Body

application/json
expires_at
integer
required

Unix seconds. Required.

name
string
Maximum string length: 256
slug
string

Optional path-safe id. Auto-generated as kb-{knowledge_base_id}-{uuid} when omitted.

permissions
string[]

Optional storage:-prefixed permission strings. Falls back to config.api_key_default_permissions.

Response

Key created; secret present (once).

Per-knowledge-base API key metadata (no secret).

id
string
required

The key slug (also exposed as slug).

Pattern: ^kb-[A-Za-z0-9_-]+$
object
enum<string>
required
Available options:
knowledge_base.api_key
knowledge_base_id
string
required
Pattern: ^vs_[A-Za-z0-9-]+$
scope
string
required

Currently storage:vector_stores:{knowledge_base_id} (the storage:knowledge_bases:{id} rename is deferred with the platform allowlist change).

created_at
integer
required
name
string | null
Maximum string length: 256
slug
string | null

Path-safe key identifier (kb-{knowledge_base_id}-{uuid}, or caller-supplied at mint). Equal to id.

permissions
string[]

The storage:-prefixed permission strings the key grants (caller-provided at mint, else config.api_key_default_permissions).

prefix
string | null

Non-secret leading characters, for identification in lists.

last_used_at
integer | null
expires_at
integer | null
created_by
string | null
updated_at
integer