Skip to main content
POST
Mint a key

Authorizations

Authorization
string
header
required

A Custral API key, created in Settings → Developers → Applications, sent as Authorization: Bearer sk_…. The X-Api-Key header is also accepted and takes precedence. Use a secret key (sk_…) from your server; a publishable key (pk_…) may hold only objects:read and usage:write. Never expose a secret key in a browser.

Path Parameters

id
string
required

The application id.

Body

application/json
type
enum<string>
required
Available options:
publishable,
secret
name
string
Example:

"Production server"

scopes
enum<string>[]

What the key may do. A key with no scopes authenticates but is refused everywhere except GET /v1/me, so always pass them.

A permission a key can hold. A publishable (pk_…) key may hold only objects:read and usage:write.

Available options:
records:read,
records:write,
objects:read,
documents:read,
documents:write,
conversations:read,
conversations:write,
property_agents:read,
property_agents:write,
tasks:read,
usage:read,
usage:write,
quotes:write,
billing:read,
billing:admin,
billing:portal,
applications:manage,
webhooks:manage,
connectors:read,
connectors:manage,
mcp:read,
mcp:write,
widget:identify,
widget:manage
environment
enum<string>

Defaults to live.

Available options:
live,
test
expiresInDays
integer | null

Expire the key after this many days. Omit, or send null, for a key that never expires.

Required range: x >= 1

Response

200 - application/json

The new key and its secret.

data
object
reqId
string

A per-request id (req_…). Quote it to support when reporting a problem.

Example:

"req_2a1f9c8e7b6d5"