Adds a key to a branch.
HTTP
POST /branches/{branchId}/keysAccess: Session token, or an API key with the keys:write scope.
Role: Any role in the project.
Path parameters #
| Parameter | Description |
|---|---|
branchId | The id of the branch. |
Request body #
JSON.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Up to 190 characters, no control characters. |
source | string | no | The 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 #
| Field | Type | Description |
|---|---|---|
id | string | The id of the key. |
name | string | The name of the key. |
source | string or null | The source text. null until it has one. |
translation | object or null | The translation in the requested language: value and status (draft, review, changes or approved). null when there is none. |
Errors #
| Status | error | When |
|---|---|---|
| 401 | unauthenticated | The token is missing or not valid. |
| 404 | not_found | The branch does not exist, you have no access to its project, or branchId is not a UUID. |
| 409 | branch_frozen | The branch is frozen. The same call also fails with project_frozen when the project is frozen. |
| 402 | plan_limit | The branch is main and the plan has no room for more keys. |
| 409 | conflict | The branch already has a key with this name. |
| 422 | invalid_request | name is empty or has invalid characters, or source is too long. |
| 429 | rate_limited | Too many requests, see Rate limiting. |
See Errors for the error format.
Notes #
Triggers the key.created webhook.