Manual
CLI
API
Log in Get started free

Update a key

Sets the source text, description or maximum translation length of a key. Send only what changes.

Sets the source text, description or maximum translation length of a key. Send only what changes.

HTTP
PATCH /keys/{keyId}

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

Role: Any role in the project; changing an existing source text or the maximum length needs the manager role.

Path parameters #

ParameterDescription
keyIdThe id of the key.

Request body #

JSON.

FieldTypeRequiredDescription
sourcestringnoThe new source text. At most 5000 characters.
descriptionstringnoA description for translators. At most 1000 characters.
maxLengthinteger or nullnoThe longest allowed translation, in characters, from 1 to 5000. null removes the limit.
JSON
{ "source": "Check out" }

Response 200 #

The key.

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

Response fields #

FieldTypeDescription
idstringThe id of the key.
namestringThe name.
sourcestring or nullThe source text.
maxLengthinteger or nullThe longest allowed translation, or null for no limit.

Errors #

StatuserrorWhen
401unauthenticatedThe token is missing or not valid.
404not_foundThe key does not exist, you have no access to its project, or keyId is not a UUID.
409branch_frozenThe branch is frozen. The same call also fails with project_frozen when the project is frozen.
403forbiddenYou change an existing source text or maxLength and you are not a manager.
422invalid_requestsource is empty or too long, or maxLength is not a whole number from 1 to 5000.
429rate_limitedToo many requests, see Rate limiting.

See Errors for the error format.