Skip to content
PreviewThis is built and live, but young. Details on this page can still change.

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

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.

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.
  • 120 requests per key every 60 seconds.
  • Request bodies up to 1 MiB; POST /v1/imports up to 16 MiB.
  • List routes return at most 100 items a page. Follow nextCursor or nextOffset until it is null.

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).

RouteDoesPermission
GET /v1/activityRecent changes in the projectproject:read
GET /v1/ai/batch-translationsAI batch translation jobstranslations:read
POST /v1/ai/batch-translationsAI-translate every untranslated key of a language, as draftsai:translate
GET /v1/exportDownload translations as files in a chosen formattranslations:read
GET /v1/glossaryGlossary termsproject:read
POST /v1/glossaryAdd a glossary termglossary:write
DELETE /v1/glossary/:termIdDelete a glossary termglossary:write
PATCH /v1/glossary/:termIdChange a glossary termglossary:write
POST /v1/importsImport translation fileskeys:write
GET /v1/imports/:importIdOne import job: status, progress and reportproject:read
POST /v1/imports/:importId/cancelCancel an importkeys:write
POST /v1/imports/:importId/resumeResume a failed importkeys:write
GET /v1/imports/activeThe import that is running or waiting, if anyproject:read
GET /v1/keysSearch and filter keystranslations:read
POST /v1/keysCreate a key, optionally with source textkeys:write
DELETE /v1/keys/:keyIdDelete a key and its translationskeys:write
GET /v1/keys/:keyIdOne key with its textstranslations:read
PATCH /v1/keys/:keyIdChange a key's descriptionkeys:write
GET /v1/keys/:keyId/commentsComments on a keytranslations:read
POST /v1/keys/:keyId/commentsComment on a keytranslations:write
PUT /v1/keys/:keyId/comments/resolvedResolve or reopen a key's commentstranslations:write
GET /v1/keys/:keyId/translation-memorySimilar approved translationstranslations:read
PUT /v1/keys/:keyId/translations/:localeWrite a key's text in one languagetranslations:write
POST /v1/keys/:keyId/translations/:locale/ai-translateGet an AI suggestion for one key (not saved)ai:translate
POST /v1/keys/:keyId/translations/:locale/approveApprove a translationtranslations:review
GET /v1/keys/:keyId/translations/:locale/historyEarlier versions of a translationtranslations:read
POST /v1/keys/:keyId/translations/:locale/request-changesSend a translation back with a commenttranslations:review
GET /v1/namespacesNamespaces with their key countsproject:read
GET /v1/projectThe project, its languages and translation progressproject:read
PATCH /v1/projectRename the project or change its languagesproject:write
GET /v1/releasesRecent releases and which one is livereleases:read
POST /v1/releasesPublish reviewed translationsreleases:publish
POST /v1/releases/:releaseId/activateMake an earlier release live againreleases:publish
GET /v1/style-guidesStyle guides per languageproject:read
PUT /v1/style-guides/:localeReplace a language's style guideglossary:write
GET /v1/translation-contextKeys to translate into one language, with glossary terms, similar translations and the style guidetranslations: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.

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.

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.

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.