A small API, authenticated with a project API key, for pulling and pushing one project's translations: CI pipelines, build-time code generation, pull and push scripts. Its paths, parameters and responses are stable, so a script written against it keeps working.
The base URL is https://localizator.carcutter.io. Every path below starts with /api/v1/projects/{projectId}; the project id is in the project's address in the app and under Settings › Environment variables.
| Endpoint | Does |
|---|---|
GET /api/v1/projects/{projectId}/status | Lists the project's languages |
GET /api/v1/projects/{projectId}/files/download | Downloads one language as JSON or ARB |
POST /api/v1/projects/{projectId}/files | Imports one language's translations |
Authentication
Every request needs an API key of the project, created under Settings › API keys (see Pull translations in CI). Send it in the X-Api-Token header or as Authorization: Bearer:
X-Api-Token: lt_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Authorization: Bearer lt_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxA key works for the project it was created in only. A missing, invalid or revoked key gets 401. A key of a different project gets the same 404 as a project that doesn't exist, so a leaked key can't be used to find out which project ids exist.
Errors
Errors are JSON shaped { "error": string }. Validation errors also have an issues array.
| Status | Meaning |
|---|---|
400 | Malformed request: a missing field, or file content that can't be read |
401 | Missing, invalid or revoked API key |
404 | Project or language not found, or the key belongs to another project |
422 | The request body failed validation |
503 | The database can't be reached right now |
Project status
GET /api/v1/projects/{projectId}/statusLists the project's languages, so a script can find which locale codes exist before downloading or uploading. The source language comes first.
curl -H "X-Api-Token: $API_TOKEN" \
"https://localizator.carcutter.io/api/v1/projects/$PROJECT_ID/status"{
"id": "cmq6pqqdy04v8tkxfp4vknobz",
"name": "Mobile app",
"defaultLocale": "en",
"languages": [
{ "langCode": "en", "name": "English", "isDefault": true },
{ "langCode": "de", "name": "German", "isDefault": false }
]
}Download a locale
GET /api/v1/projects/{projectId}/files/downloadReturns one language's translations as the file itself: a JSON object or a Flutter ARB file, not wrapped in anything.
| Query parameter | Required | Description |
|---|---|---|
lang_codes | Yes | One locale, such as en or fr-CA (or the language's id). One language per request |
type | No | json (default) or arb |
export_empty_as | No | main fills empty values from the source language; by default they stay empty |
nested | No | false returns flat, dot-path JSON (JSON only) |
# Nested JSON (the default)
curl -H "X-Api-Token: $API_TOKEN" \
"https://localizator.carcutter.io/api/v1/projects/$PROJECT_ID/files/download?lang_codes=en"
# Flat, dot-path JSON
curl -H "X-Api-Token: $API_TOKEN" \
"https://localizator.carcutter.io/api/v1/projects/$PROJECT_ID/files/download?lang_codes=en&nested=false"
# Flutter ARB, filling empty values from the source language
curl -H "X-Api-Token: $API_TOKEN" \
"https://localizator.carcutter.io/api/v1/projects/$PROJECT_ID/files/download?lang_codes=fr&type=arb&export_empty_as=main" \
-o app_fr.arbSee File formats for what the files look like.
Load (upload) a locale
POST /api/v1/projects/{projectId}/filesImports translations for one language, the push side of download. Keys that don't exist are created. By default, existing non-empty values are overwritten; send overwrite as false to only fill empty cells.
Each call also:
- archives what was sent,
- writes an import entry to the project's activity log,
- queues a Google Drive sync if the project has one.
Values written this way show as Pushed via API in the editor, and its source filter finds them, until someone edits them.
Send a file, or a JSON body, whichever suits your client. JSON content must be nested: a key name containing a dot, such as "home.title", is refused.
Option A: a file (multipart/form-data)
| Field | Required | Description |
|---|---|---|
file | Yes | The JSON or ARB file |
lang_code | Yes | The target locale (or the language's id) |
format | No | JSON or ARB; guessed from the file name if left out |
overwrite | No | "true" (default) or "false" |
curl -X POST "https://localizator.carcutter.io/api/v1/projects/$PROJECT_ID/files" \
-H "X-Api-Token: $API_TOKEN" \
-F "file=@de.json" \
-F "lang_code=de"Option B: JSON body with the translations
curl -X POST "https://localizator.carcutter.io/api/v1/projects/$PROJECT_ID/files" \
-H "X-Api-Token: $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"lang_code": "de",
"translations": { "greeting": "Hallo", "nav": { "home": "Startseite" } }
}'Option C: JSON body with a file's text
Useful when you already have a JSON or ARB document as a string and don't want to send a multipart request.
curl -X POST "https://localizator.carcutter.io/api/v1/projects/$PROJECT_ID/files" \
-H "X-Api-Token: $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"lang_code": "de",
"format": "JSON",
"content": "{\"greeting\": \"Hallo\"}"
}'Response
The same for all three:
{
"added": 12,
"updated": 3,
"total": 15,
"blobUrl": "s3://…/imports/…"
}blobUrl is where the upload was archived, not a download link. It's empty where the installation doesn't archive files; the import works either way.