What it does
Creates a new API key for an application. The response contains the key value itself — this is the only time it is ever returned. Later reads expose the key’s metadata (name, expiry, status) but never the secret again.Endpoint
Headers
string
required
Secret key in
Bearer sk_... format. See Secret Key authentication.string
required
Always
application/json.Path parameters
string
required
Application ID the key is issued for. Must belong to the organization (otherwise
404).Request Body
string
required
A label for the key. Use something that identifies where the key is deployed (
prod-backend, ci-pipeline) — it is how you will recognise the key later, since the value itself is not visible.string
ISO-8601 timestamp at which the key stops working. Must be in the future.
Response
boolean
true when the key was created.object
The created key.
Examples
Demo 1 — create a key with an expiry
Demo 1 — create a key with an expiry
data.key now — the next read of this key will not include it.Demo 2 — error: missing name → 400
Demo 2 — error: missing name → 400
Demo 3 — error: expiresAt in the past → 422
Demo 3 — error: expiresAt in the past → 422
Errors
object
Error details with
code, group, and description; isSuccess is false.Next steps
Authentication
How keys are presented on requests.
Update Webhook
Point the app’s events at your server.