Skip to navigation

Create an API key

Mints an API key for the caller’s organization. The key is tagged with the caller’s environment (production, or sandbox when the dashboard is in Sandbox mode). Both use the same host; the key itself selects the environment it reaches.

scopes is required: at least one scope, no duplicates, each one from the grantable list, never the * wildcard (400 validation_failed otherwise).

The secret is returned only in this response; store it immediately.

Requires scope api_keys:manage (dashboard org:admin sessions; not grantable to API keys). Returns 404 if the organization has not been provisioned yet.

Authentication

AuthorizationBearer

Session JWT or API key (ak_...)

Request

This endpoint expects an object.
namestringRequired1-100 characters
scopeslist of enumsRequired

Scopes to grant. The * wildcard is rejected.

descriptionstringOptional
secondsUntilExpirationdoubleOptional

Time in seconds until the key expires; omit for a key that never expires.

Response

The created key, including its one-time secret

dataobjectOptional

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error
500
Internal Server Error