Manual
CLI
API
Log in Get started free

Push source strings

Makes the keys of a branch match the source strings you send, like `ct push`. A branch that does not exist is created. Translations of changed strings go back to `draft`.

Makes the keys of a branch match the source strings you send, like ct push. A branch that does not exist is created. Translations of changed strings go back to draft.

HTTP
POST /projects/{projectId}/push

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

Role: Any role in the project for an API key. A session token needs the manager role.

Path parameters #

ParameterDescription
projectIdThe id of the project.

Request body #

JSON.

FieldTypeRequiredDescription
branchstringyesThe branch name. Letters, digits, ., _, - and /, starting with a letter or digit. At most 60 characters. Use main for the protected branch.
keysobjectyesThe source strings as { "key.name": "text" }. At most 20000 keys. A name has at most 190 characters without control characters; a text at most 5000 characters.
basestringnoThe branch to create a new branch from. Default main. Ignored when the branch exists.
prunebooleannotrue deletes keys of the branch that are not in keys. Default false.
dryRunbooleannotrue saves nothing and reports what would happen. The branch must exist. Default false.
translationsobjectnoTranslations to import as { "de-de": { "key.name": "text" } }. Needs the translations:write scope. Existing translations are only replaced when the project allows overwriting on import, and imported translations go to review unless the project says otherwise.
JSON
{
  "branch": "main",
  "keys": { "checkout.title": "Checkout", "checkout.pay": "Pay now" },
  "prune": false
}

Response 200 #

What changed.

JSON
{
  "branch": "main",
  "added": 1,
  "changed": 0,
  "removed": 0,
  "unchanged": 1,
  "keysSkipped": 0,
  "translationsImported": 0,
  "translationsSkipped": { "unknownKey": 0, "unknownLanguage": 0, "empty": 0, "existing": 0 },
  "dryRun": false
}

Response fields #

FieldTypeDescription
branchstringThe branch name.
addedintegerNew keys.
changedintegerKeys whose source text changed.
removedintegerKeys deleted because of prune.
unchangedintegerKeys that already matched.
keysSkippedintegerNew keys that were left out because a session token was used and the project does not allow creating keys on import.
translationsImportedintegerTranslations saved from translations.
translationsSkippedobjectTranslations left out: unknownKey, unknownLanguage (not a language of the project or inactive), empty (empty or longer than 5000 characters) and existing (already translated and overwriting is off).
dryRunbooleanWhether this was a dry run.

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 use a session token and are not a manager.
403insufficient_scopetranslations is sent and the key has no translations:write scope.
409project_frozenThe project is frozen, see the freeze flag in Get project settings.
409branch_frozenThe branch is frozen.
402plan_limitNew keys on main would pass the key limit of the plan.
404not_founddryRun is true and the branch does not exist.
422invalid_requestkeys is not an object of texts, a name or text is not valid, branch is not a valid name, or base is not a branch (unknown).
429rate_limitedToo many requests, see Rate limiting.

See Errors for the error format.