API Documentation
Note This page is available only in English
Getting an API token
Go to Project Settings > General Settings to get project's API token. Only
project creators have access to the API token.
Setting a Webhook
Go to Project Settings > General Settings to set a webhook. Webhook will get a
POST request with updates info when translations are updated and language files have to be rebuilt.
Webhook should answer with with a 200 http status code.
Check HTTP_X_LOCALIZATION header to validate incoming requests. It will contain
a HMAC-sha256 hash, where your project API Token is used as a message and your webhook url address
is used as a key.
Making requests
Use this url for making API requests:
Replace
{api_token} with API token for your project and {method_name} with one of the following methods
found below.
The response contains a JSON object, which always has a Boolean field 'ok' and
may have an optional String field 'description' with a human-readable description of the result. If
'ok' equals True, the request was successful and the result of the query can be found in the
'result' field. In case of an unsuccessful request, 'ok' equals false and theerror is explained in
the 'description'.
Types
Label
This object represents a label
| Field | Type | Required | Description |
|---|---|---|---|
| label_id | String | Yes | md5 string representing an id of a label obtained from getLabels method |
| label_value | Integer or String | Yes | Value of the label. Can be 0 or 1 for checkbox or String for input and select labels |
Methods
Get languages
Use this method to get project languages list
Get categories
Use this method to get project categories list
Get labels
Use this method to get project labels list
Create a New Category
Use this method to create a new category. Returns a new category id on success
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | Name for the category. Must be unique in parent directory |
| parent_id | Integer | Optional | id of parent category. Pass 0 or ignore to create a new category in the root directory |
| description | String | Optional | Description for the category |
Create a New String
Use this method to create a new string with a default string translation.
Returns
a new string id and string key on success
| Parameter | Type | Required | Description |
|---|---|---|---|
| string_id | Integer | Optional | id of the string. Must be unique for the project |
| category_id | Integer | Yes | id of category |
| string_key | String | Yes | String key (slug). Must be unique for a category |
| default_translation_language | Integer | Optional | id of default translation language. Can be ignored if copy_translations_from is provided |
| default_translation_value | String | Optional | Default translation text. Can be ignored if copy_translations_from is provided |
| copy_translations_from | Integer | Optional | id of another string which translations will be copied to this string |
| string_context | String | Optional | Notes about how this string is used in the app (e.g. "button label in the document editor toolbar", "error shown when login fails"). Visible to anyone working with this string — developers, translators, AI tools, support — and returned in API exports. Not shown to end users. Hard limit: 2500 characters; longer payloads are rejected with {"ok":"false","description":"string_context exceeds the 2500-character limit ..."}. |
| labels | Mixed | Optional | Labels to attach to the new string. Any of the following shapes is accepted:
|
Delete a String
Use this method to delete a string and all of its translations,
suggestions, labels and uploaded illustrations. Returns the deleted string_id on
success.
Disabled by default. Because a leaked API token with this
method enabled can wipe every string in the project, you must explicitly opt-in: go to
Project Settings > API and webhook and tick "Allow deleteString via API".
Calls to a project where the toggle is off return
{"ok":"false","description":"API method 'deleteString' is disabled for this
project. ..."}.
| Parameter | Type | Required | Description |
|---|---|---|---|
| string_id | Integer | Yes | id of the string to delete (the string_id returned by createString or getTranslations) |
Add a translation
Use this method to set the API bot's translation for a (string_id, language)
pair. The call is idempotent — if the bot already has a translation for that pair, its value is
updated in place; otherwise a new suggestion is created. Returns the translation id on success.
| Parameter | Type | Required | Description |
|---|---|---|---|
| string_id | Integer | Yes | id of the string |
| translation_language | Integer | Yes | id of the translation language |
| translation_value | String | Yes | Translation text |
| approve | Boolean | Optional | Pass 'true' to approve this translation immideatly. If string is already has approved translation for selected language, it will be disapproved |
Update a translation
Use this method to overwrite the value of an already-approved translation
in place. The original author and approval state are preserved, so this is the right way to
fix typos in published strings without disturbing attribution or suggestion history. Returns
the updated translation id on success. If no approved translation exists for the given pair,
returns ok:false — use addTranslation
to create one.
Disabled by default. Because a leaked API token with this
method enabled can silently rewrite every translation in the project, you must explicitly
opt-in: go to Project Settings > API and webhook and tick "Allow
updateTranslation via API". Calls to a project where the toggle is off return
{"ok":"false","description":"API method 'updateTranslation' is disabled for this
project. ..."}.
| Parameter | Type | Required | Description |
|---|---|---|---|
| string_id | Integer | Yes | id of the string |
| translation_language | Integer | Yes | id of the translation language |
| translation_value | String | Yes | New translation text |
Disapprove all translations of a string
Use this method to flip every approved translation of a string back
to "suggestion" state (approve=0) across every language at once. Mirrors the
"Disapprove all approved translations of this string" checkbox on the
edit-string modal in the UI, but is not paired with an edit — so it operates on
every language without exception. Nothing is deleted; the previous values stay
in history as non-approved suggestions and can be re-approved later. Language
builds are rebuilt for every affected language via the same webhook the UI
uses. Returns the number of translations that were disapproved.
Disabled by default. Because a leaked API token with this
method enabled can wipe every approved translation in the project, you must
explicitly opt-in: go to Project Settings > API and webhook and tick
"Allow disapproveAllTranslations via API". Calls to a project where the
toggle is off return
{"ok":"false","description":"API method 'disapproveAllTranslations' is disabled
for this project. ..."}.
| Parameter | Type | Required | Description |
|---|---|---|---|
| string_id | Integer | Yes | id of the string whose approved translations should be flipped back to "suggestion" state |
Delete all suggestions of a string
Use this method to drop every non-approved suggestion of a string
across every language. Mirrors the "Delete all suggested translations of this
string" checkbox on the edit-string modal in the UI. Approved translations are
untouched — to also remove the approved ones, call
disapproveAllTranslations
first (which converts approvals into suggestions), then call this method.
Notifications and logs tied to the deleted suggestions are cleaned up the same
way the UI does. Returns the number of suggestions that were deleted.
Disabled by default. Because a leaked API token with this
method enabled can wipe every pending suggestion in the project, you must
explicitly opt-in: go to Project Settings > API and webhook and tick
"Allow deleteAllSuggestions via API". Calls to a project where the toggle is
off return
{"ok":"false","description":"API method 'deleteAllSuggestions' is disabled for
this project. ..."}.
| Parameter | Type | Required | Description |
|---|---|---|---|
| string_id | Integer | Yes | id of the string whose non-approved suggestions should be deleted |
Get strings Translations
Use this method to get string(s) translations for a selected language
| Parameter | Type | Required | Description |
|---|---|---|---|
| translation_language | Integer | Yes | id of the translation language |
| category_id | Integer | Optional | Pass a category_id to get all translations for strings in selected category |
| string_id | Integer | Optional | Pass a string_id to get a translation for selected string |
| format | Mixed | Optional | Pass a format to get a translation in one of the following formats: json (or 0) - Default JSON format, xml-android (or 1) - Android Strings XML, ios-strings (or 2) - iOS (.strings), json-clean (or 3) - React Clean JSON, php-array (or 4) - Laravel (PHP Array), arb (or 5) - Flutter (.arb), csv (or 6) - Excel (.csv), po (or 7) - Gettext (.po), properties (or 8) - Java Properties (.properties) |