Manual
CLI
API
Log in Get started free

Create a key

Adds a key to a branch.

Adds a key to a branch.

HTTP
POST /branches/{branchId}/keys

Access: Session token, or an API key with the keys:write scope.

Role: Any role in the project.

Path parameters #

ParameterDescription
branchIdThe id of the branch.

Request body #

JSON.

FieldTypeRequiredDescription
namestringyesUp to 190 characters, no control characters.
sourcestringnoThe source text. At most 5000 characters.
JSON
{ "name": "checkout.title", "source": "Checkout" }

Response 201 #

The key.

JSON
{ "id": "0197a3c9-7086-7d77-8ace-2e6b8f3d5097", "name": "checkout.title", "source": "Checkout", "translation": null }

Response fields #

FieldTypeDescription
idstringThe id of the key.
namestringThe name of the key.
sourcestring or nullThe source text. null until it has one.
translationobject or nullThe translation in the requested language: value and status (draft, review, changes or approved). null when there is none.

Errors #

StatuserrorWhen
401unauthenticatedThe token is missing or not valid.
404not_foundThe branch does not exist, you have no access to its project, or branchId is not a UUID.
409branch_frozenThe branch is frozen. The same call also fails with project_frozen when the project is frozen.
402plan_limitThe branch is main and the plan has no room for more keys.
409conflictThe branch already has a key with this name.
422invalid_requestname is empty or has invalid characters, or source is too long.
429rate_limitedToo many requests, see Rate limiting.

See Errors for the error format.

Notes #

Triggers the key.created webhook.