API Keys

Create a new API key for the authenticated customer

Create a new API key. To prevent privilege escalation, the new key's scopes must be a subset of the calling key's scopes, and package_ids (if provided) must be a subset of the calling key's package restriction. If package_ids is omitted, the new key inherits the calling key's restriction.

The response includes the plaintext secret — this is the only time it is ever returned. Store it immediately in a secure location.

Requires the api-keys:write scope.

post/v1/api-keys/

Request

Request body

namestring required

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

scopesstring[] required

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

package_idsstring[] nullable

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

idstring required
namestring required
scopesstring[] required
package_idsstring[] nullable required
secretstring required
created_atstring date-time required

Changes

No recorded changes to this operation across all 1 revision of this API.