Skip to main content
POST
Create a new API key for the authenticated customer

Authorizations

Authorization
string
header
required

API key secret (starts with s_live_). Create keys in the dashboard under Settings → API keys, or via POST /v1/api-keys/. Send it as Authorization: Bearer <secret>.

Body

application/json

Request schema for POST /v1/api-keys endpoint.

name
string
required

Human-readable name for the key (shown in the dashboard and key listings).

scopes
string[]
required

Scopes to grant. Must be a subset of the calling key's own scopes.

package_ids
string[] | null

Optional list of package IDs the key is restricted to. Must be a subset of the calling key's own restriction. Omit to inherit the calling key's restriction; null on an unrestricted caller creates an unrestricted key.

Response

Successful Response

Response schema for POST /v1/api-keys endpoint.

Includes the plaintext secret, which is only revealed at creation time and can never be retrieved again. The secret should be immediately stored by the client in a secure location.

id
string
required
name
string
required
scopes
string[]
required
package_ids
string[] | null
required
secret
string
required
created_at
string<date-time>
required