Skip to main content
POST
Create API key

Headers

X-API-Key
string | null
X-Assistant-Service-Key
string | null

Body

application/json

Request payload for creating an API key.

name
string
required

The display name for this API key. Max 255 characters.

Maximum string length: 255
principal_id
string<uuid> | null

The ID of the principal to create the API key for. Required when using service credential authentication; ignored when using principal API key authentication.

scopes
string[]

The access scopes for this key. Use ["*"] for full access, or restrict with resource:action format (for example, ["wallet:read", "wallet:write"]). Possible actions: read, write, status.

expires_at
string<date-time> | null

The expiry timestamp for this key, in ISO 8601 format. If omitted, the key does not expire.

Response

Already exists (idempotent). Successful Response

result
ApiKeyCreateResultPublic · object
required

Create API key result payload without delegation internals.

success
boolean
default:true
suggestion
string
default:""
message
string
default:""
meta
PaginationMeta · object | null

Pagination metadata for list responses.

Supports both legacy offset-based and cursor-based pagination. Cursor fields (has_more, after, before) are populated for cursor-paginated endpoints. Legacy fields (offset, limit) are populated when the caller uses the deprecated offset parameter.