Skip to main content
API-key routes require an admin-capable key. A personal access token can manage keys for an explicit project through /projects/{project_id}/api-keys. Its effective permission for that project must be admin. The top-level /api-keys aliases remain useful for project keys and for a PAT when project selection is unambiguous.

API key resource

The raw token is returned only in the response that creates the key. This applies to both POST /api-keys and POST /projects/{project_id}/api-keys.

List API keys

Query parameters: Response:

Create API key

Request:
scope accepts read, write, or admin; omitting it defaults to admin for backward compatibility. expires_in_days accepts 30, 90, 365, or null for no expiry. Response status is 201.
Store token immediately. It is not returned again. For CI automation with a PAT, create a project key directly:

Revoke API key

key_id may include the key_ prefix. The response is the revoked API-key resource with revoked_at set.