Manual
CLI
API
Log in Get started free

Create a project key

Creates an API key that works on this project only. The full key is in the response and is not shown again.

Creates an API key that works on this project only. The full key is in the response and is not shown again.

HTTP
POST /projects/{projectId}/api-keys

Access: Session token only. API keys get 403 with insufficient_scope.

Role: Project manager (organisation owners and admins are managers of every project).

Path parameters #

ParameterDescription
projectIdThe id of the project.

Request body #

JSON.

FieldTypeRequiredDescription
namestringyesA name to recognise the key by. At most 80 characters.
scopeslist of stringyesAt least one of translations:read, translations:write, keys:write and projects:read.
expiresInDaysintegernoDays until the key expires, 1 to 3650. Without it the key does not expire, unless the organisation limits the lifetime of API keys: then it is required and at most that limit.
JSON
{ "name": "CI", "scopes": ["projects:read", "keys:write", "translations:read"] }

Response 201 #

The key is created.

JSON
{
  "token": "ct_live_3f9a...7f3a",
  "keys": [ ... ]
}

Response fields #

FieldTypeDescription
tokenstringThe full key. Store it now.
keyslist of objectAll keys of the project, as in List project keys.

Errors #

StatuserrorWhen
401unauthenticatedThe token is missing or not valid.
404not_foundThe project does not exist in your organisation, you have no access to it, or projectId is not a UUID.
403forbiddenYou are a member of the project, but not a manager.
422invalid_requestname is empty, scopes is empty or holds an unknown scope, or expiresInDays is not between 1 and 3650 or is exceeds_policy (the organisation limits the lifetime of API keys, see settings.security.apiKeyMaxDays).
429rate_limitedToo many requests, see Rate limiting.

See Errors for the error format.