Skip to content

Create a new API key (secret or public) for an environment

POST
/keys

Request body for POST /keys endpoint Creates a new API key for an environment

object
keyType
required

Type of key to create - secret for server-to-server, public for client-side

string
Allowed values: secret public
environmentId

Optional environment ID to scope the key to a specific environment

string
name
required

Human-readable name/description for the key

string

Successful response

Response body for POST /keys endpoint Returns the newly created API key (only time the full key is returned)

object
id
required

Unique identifier for the key (jti)

string
key
required

The full API key string - ONLY returned on creation, never shown again

string
keyType
required

Type of API key that was created

string
Allowed values: secret public
environmentId

Environment ID if the key is scoped to a specific environment

string
name
required

Human-readable name/description for the key

string
createdAt
required

ISO 8601 timestamp when the key was created

string

Bad Request

Unauthorized

Internal Server Error