REST API
The REST API lets a script or a CI job do what a project member does in the editor: read and write keys and translations, import and export files, and publish. The command-line tool is built on it.
Base URL: https://api.localize.work/v1
Authentication
Section titled “Authentication”Send a secret project API key as a bearer token:
Authorization: Bearer lw_sec_…Create the key in the editor under Project settings → API keys. A key belongs to one project, and every request acts on that project. No route takes a project id.
An AI agent can instead sign in for you and send its access token. It works
for a whole organization, so it names the project in a Localize-Project
header. See Set up with an AI agent.
A key carries permissions, chosen when it is created, and may be limited to
some target languages. A request that needs a permission the key lacks is
answered with 403 and names the permission in error.details.requiredScope.
Requests and responses
Section titled “Requests and responses”Bodies are JSON. Successful responses are JSON objects. A route that creates
something answers 201; POST /v1/imports answers 202 while its import is
still running.
Errors have one shape:
{ "error": { "code": "invalid_argument", "message": "The request is not valid", "details": { "issues": [{ "path": "limit", "message": "Expected number, received string" }] } }}| Status | error.code |
Meaning |
|---|---|---|
400 |
invalid_argument |
A field is missing, unknown or out of range. |
401 |
unauthorized |
No key, or not a valid secret key. |
402 |
plan_limit |
The organization’s plan does not allow it, such as more keys. |
403 |
forbidden |
The key lacks a permission or a language. |
404 |
not_found |
No such route, key, release or import in this project. |
409 |
conflict, nothing_to_publish |
Another change is in the way, such as a running import. |
429 |
rate_limited |
Too many requests. Wait for the seconds in Retry-After. |
503 |
unavailable |
A dependency is down or not configured. Retry later. |
Limits
Section titled “Limits”- 120 requests per key every 60 seconds.
- Request bodies up to 1 MiB;
POST /v1/importsup to 16 MiB. - List routes return at most 100 items a page. Follow
nextCursorornextOffsetuntil it isnull.
Routes
Section titled “Routes”Query parameters and body fields are the inputs of the route’s operation. A
field the operation does not know is refused, so a typo cannot be silently
ignored. The “Permission” column is what the key needs. The inputs are those
of the MCP tool of the same operation; for example GET /v1/keys takes every
search_keys input, so GET /v1/keys?unusedDays=30
lists keys no app has reported using in 30 days
(refused until apps have reported usage for 30 days, and while no app has
reported usage in the last 7 days; the shortest period is 7 days).
| Route | Does | Permission |
|---|---|---|
GET /v1/activity | Recent changes in the project | project:read |
GET /v1/ai/batch-translations | AI batch translation jobs | translations:read |
POST /v1/ai/batch-translations | AI-translate every untranslated key of a language, as drafts | ai:translate |
GET /v1/export | Download translations as files in a chosen format | translations:read |
GET /v1/glossary | Glossary terms | project:read |
POST /v1/glossary | Add a glossary term | glossary:write |
DELETE /v1/glossary/:termId | Delete a glossary term | glossary:write |
PATCH /v1/glossary/:termId | Change a glossary term | glossary:write |
POST /v1/imports | Import translation files | keys:write |
GET /v1/imports/:importId | One import job: status, progress and report | project:read |
POST /v1/imports/:importId/cancel | Cancel an import | keys:write |
POST /v1/imports/:importId/resume | Resume a failed import | keys:write |
GET /v1/imports/active | The import that is running or waiting, if any | project:read |
GET /v1/keys | Search and filter keys | translations:read |
POST /v1/keys | Create a key, optionally with source text | keys:write |
DELETE /v1/keys/:keyId | Delete a key and its translations | keys:write |
GET /v1/keys/:keyId | One key with its texts | translations:read |
PATCH /v1/keys/:keyId | Change a key's description | keys:write |
GET /v1/keys/:keyId/comments | Comments on a key | translations:read |
POST /v1/keys/:keyId/comments | Comment on a key | translations:write |
PUT /v1/keys/:keyId/comments/resolved | Resolve or reopen a key's comments | translations:write |
GET /v1/keys/:keyId/translation-memory | Similar approved translations | translations:read |
PUT /v1/keys/:keyId/translations/:locale | Write a key's text in one language | translations:write |
POST /v1/keys/:keyId/translations/:locale/ai-translate | Get an AI suggestion for one key (not saved) | ai:translate |
POST /v1/keys/:keyId/translations/:locale/approve | Approve a translation | translations:review |
GET /v1/keys/:keyId/translations/:locale/history | Earlier versions of a translation | translations:read |
POST /v1/keys/:keyId/translations/:locale/request-changes | Send a translation back with a comment | translations:review |
GET /v1/namespaces | Namespaces with their key counts | project:read |
GET /v1/project | The project, its languages and translation progress | project:read |
PATCH /v1/project | Rename the project or change its languages | project:write |
GET /v1/releases | Recent releases and which one is live | releases:read |
POST /v1/releases | Publish reviewed translations | releases:publish |
POST /v1/releases/:releaseId/activate | Make an earlier release live again | releases:publish |
GET /v1/style-guides | Style guides per language | project:read |
PUT /v1/style-guides/:locale | Replace a language's style guide | glossary:write |
GET /v1/translation-context | Keys to translate into one language, with glossary terms, similar translations and the style guide | translations:read |
The same operations are available to AI agents over MCP, under
the same keys and permissions. File export (GET /v1/export, below) has no MCP
tool; use this API or the CLI for it. MCP import_translations
reads i18next JSON only: it has no format option, so import ICU files here.
Export files
Section titled “Export files”GET /v1/export?format=i18next&locale=et&locale=de&minStatus=reviewed| Parameter | Meaning |
|---|---|
format |
An export format. Default i18next. |
locale |
A language to export. Repeat it for several, up to every language of the project. Default: every language the key can read; leave it out to export them all, since a very long list of language codes can make the URL longer than the server accepts. |
namespace |
A namespace to export. Repeat it for several. Default: all. |
minStatus |
draft (default, everything), translated or reviewed. Source text is always included. |
cursor |
nextCursor of the previous page. |
The response holds the files as text:
{ "project": "your-project", "format": "i18next", "minStatus": "reviewed", "locales": ["et", "de"], "files": [ { "locale": "et", "namespace": "common", "path": "et/common.json", "content": "{\n \"title\": \"Tere\"\n}\n" } ], "warnings": [], "warningsTruncated": false, "nextCursor": null}A page ends after a namespace once it holds about 4 MB of files. Request the
next page with cursor until nextCursor is null. warnings names anything
a format could not carry over, such as a key left out because its name clashes
with another.
The export reads the editor’s current text, not the published release.
Import files
Section titled “Import files”POST /v1/imports{ "mode": "apply", "status": "translated", "format": "i18next", "files": [ { "locale": "en", "namespace": "common", "content": { "title": "Hello" } }, { "locale": "et", "namespace": "common", "contentJson": "{\"title\":\"Tere\"}" } ]}| Field | Meaning |
|---|---|
mode |
dry-run reports what would change; apply changes it. |
files |
1 to 200 files. Each has locale, namespace and either content (the document as an object) or contentJson (the file’s text). |
status |
Status of imported target-language text: draft, translated (default) or reviewed. reviewed needs the translations:review permission and is the only status that replaces approved text. |
format |
i18next (default; nested or flat), icu, icu-flat, or i18next-v3 for i18next files with the older v3 plural keys (how they are read). |
An import creates missing keys and updates changed text. It never deletes.
Importing target languages also needs translations:write.
The report warns about target-language text whose placeholders ({{name}},
<1>…</1>) differ from the key’s source text. The import still writes it, so
run a dry-run first, correct what it reports and repeat it until none remain.
A file lists at most 50 such entries and counts the rest in one line, and an
answer with warningsTruncated: true leaves warnings out: dry-run fewer keys
at a time until it is false. Regional variants such as de-AT are not
checked.
One import carries at most 200,000 values, counted after the files are read: a plural counts once per form it fills, so one ICU plural message for Arabic counts as six values.
apply runs as an import job. A small import finishes within the request and
answers 200 with jobStatus: "completed" and the report. A large one answers
202 with jobStatus: "running" and importId; poll
GET /v1/imports/{importId} until status is completed, failed or
cancelled. A failed job keeps what it wrote and waits to be resumed or
cancelled. Until then the project accepts no other import and cannot be
published.
Publish
Section titled “Publish”POST /v1/releases{ "confirmProjectSlug": "your-project", "requestId": "0b8f6c1e-6d1c-4a43-9a0e-3d0f2c1b7a55", "notes": "Autumn campaign copy"}confirmProjectSlug must equal the project’s slug; it guards against
publishing the wrong project with the wrong key. requestId is a UUID you
choose. Sending the same requestId again returns the same release, so a
timed-out request can be retried safely. The key must not be limited to some
languages.