Developers
API documentation
How to request file translation, proofreading and bulk processing from your own code. Every request is charged on the same credit basis as the web app.
Contents
1. Overview
The localization.md API is a REST API that calls the same translation engines as the web app over HTTPS. Submit a file and get back a translation in the original format; the same flow also handles proofreading and bulk processing.
A single file, a few sentences or a large batch are all requested on the same credit basis. Each request is charged for the compute it actually uses.
Work that takes time runs asynchronously. You submit, receive a job ID, check the status and then download the result. Instead of asking for the status repeatedly, you can learn about completion from the event stream or webhooks.
Endpoints, headers and error codes are also described in the OpenAPI 3.1 definition openapi.yaml. Use it to generate client code or validate requests.
1.1 Job flow
| Request | What it does |
|---|---|
POST /api/translate | Sends a file and options to create a job. Responds 202 with the job ID and status. |
GET /api/jobs/{jobId} | Returns the job status. Once complete, downloadUrl is filled in. |
GET /api/jobs/{jobId}/download | Downloads the result file. Responds 409 if it is not ready yet. |
POST /api/jobs/{jobId}/edits | Edits the translated document's blocks by block id, through the same save path as the web viewer. Pass expected for optimistic concurrency; 409 EDIT_CONFLICT if it changed since you read it. |
1.2 Request types
File requests — translate or proofread a document file in its original format. The endpoints in this documentation are described for file requests.
Sentence requests — request by sentence, without a file. They don't start an engine container, so only translation tokens are deducted and the charge is naturally small. See section 6.
Bulk processing — large, non-urgent work grouped and processed asynchronously. It costs less, so it deducts less; there is no separate discount rate. See section 7.
2. Getting started
From setting up an account to receiving your first result file.
Account and credits
Sign in to the app and top up credits. The API deducts from the same balance as the web.
Create an API key
Create a key on the API keys screen in the app. The secret is shown only once, when it is issued.
Submit a file
Send a file and a target language to
POST /api/translateand receive a job ID.Check status and download
When the status becomes
ready, fetch the result file fromdownloadUrl.
2.1 Send your first request
A request that translates a report into Korean. Replace YOUR_API_KEY with the key you created.
curl -X POST https://localization.md/api/translate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-target-lang: ko" \
-F "file=@report.docx"import { readFile } from 'node:fs/promises';
const form = new FormData();
form.append('file', new Blob([await readFile('report.docx')]), 'report.docx');
const res = await fetch('https://localization.md/api/translate', {
method: 'POST',
headers: { Authorization: 'Bearer YOUR_API_KEY', 'x-target-lang': 'ko' },
body: form
});
const job = await res.json();
console.log(res.status, job.jobId, job.status);import requests
with open("report.docx", "rb") as f:
res = requests.post(
"https://localization.md/api/translate",
headers={"Authorization": "Bearer YOUR_API_KEY", "x-target-lang": "ko"},
files={"file": ("report.docx", f)},
)
job = res.json()
print(res.status_code, job["jobId"], job["status"])2.2 Read the response
An accepted submission returns 202 with the job details. Use jobId to check the status from then on.
{
"id": "JOB_ID",
"jobId": "JOB_ID",
"title": "report.docx",
"outputName": "report.docx",
"status": "queued",
"logs": [],
"downloadUrl": "",
"uniJson": false
}3. Authentication
Every request carries its credentials in the Authorization header. Server-to-server integrations use an API key; the Power Platform connector uses an OAuth 2.0 access token.
Missing or invalid credentials return 401 UNAUTHENTICATED. Accessing another user's job returns 403 FORBIDDEN.
3.1 API keys
You can create personal and organization API keys on the API keys screen in the app. The secret is shown only once, when it is issued, and keys can be rotated or revoked. Only organization admins manage organization keys.
Keys start with vte_. Only a hash of the key is stored on the server, so a lost key cannot be shown again — rotate it to get a new one. Lists show only the last 6 characters of a key.
A key has scopes and an optional expiry date. The default scopes are translation:submit (submit jobs) and translation:read (check status and download results).
3.2 Authorization header
Authorization: Bearer YOUR_API_KEY- Use keys only on your server. Never put them in browser code, app bundles or URL query strings.
3.3 OAuth 2.0 (Power Platform)
The Power Automate custom connector calls on the user's behalf with OAuth 2.0 (the Microsoft Entra ID authorization code flow). It uses a single scope, user_impersonation.
3.4 Per-key limits
Each API key has a monthly spend cap (default $100) and a rate limit. Exceeding the rate limit returns 429 RATE_LIMITED. See section 12.
4. Base URL and request format
Base URL
All endpoints live under the /api path of https://localization.md. Only HTTPS is accepted.
Requests
- File submissions are sent as
multipart/form-datawith a single file part, which must carry a file name (filename). The format is determined by the file extension. - Translation options (target language, task, processing mode and so on) are sent as request headers.
- Other requests with a body, such as estimates, are sent as
application/json. - CORS is not supported. The API is for server-to-server calls only, and responses carry no
Access-Control-Allow-Originheader.
Responses
- Response bodies are JSON. Only the result download returns the file itself.
- Error responses carry
"ok": falseand a machine-readablecode, plus numeric fields where relevant (e.g.limit,required). Branch oncode. See section 11. - Amounts are integers in µUSD (millionths of a US dollar).
5. Document translation
Document translation runs in three steps: submit → check status → download. The result file has the same format as the original.
Submitting the same file again creates a new job that is charged separately. Follow the guidance in section 12 for retries.
5.1 Submit a file
POST/api/translate
Submits one file and creates a translation (or proofreading) job. If the balance is below the minimum, no job is created and the response is 402.
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Required |
|
x-target-lang | string | Optional | Target language code (e.g. |
x-source-lang | string | Optional | Source language code. Send |
x-llm-model | string | Optional | Translation model ID. Available values come from |
x-exec-mode | string | Optional |
|
x-processing | string | Optional | Send |
x-context | string | Optional | Background information that is not translated (up to 2,000 characters), sent as base64url-encoded UTF-8 text. It reduces mistranslation of short titles and sentences; because it is part of the translation input, it is charged as input tokens. |
x-formality | string | Optional |
|
x-glossary-id | string | Optional | ID of the glossary to apply. Send |
x-task | string | Optional |
|
| Name | Type | Required | Description |
|---|---|---|---|
file | file | Required | One file to translate. The part must carry a file name; the format is determined by the extension. Supported formats are listed in 5.6. |
curl -X POST https://localization.md/api/translate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-source-lang: auto" \
-H "x-target-lang: en" \
-F "file=@slides.pptx"{
"ok": false,
"code": "INSUFFICIENT_CREDITS",
"required": 1000000,
"available": 250000
}5.2 Check job status
GET/api/jobs/{jobId}
Returns the job's current status and result details. Finished jobs also carry the final charged amount.
| Value | Meaning |
|---|---|
queued | Accepted and waiting to be processed. |
running | Being processed. |
batching | Waiting for, or being processed in, a bulk processing batch. |
ready | Complete. Fetch the result from downloadUrl. |
failed | Failed. The reason is in failCode and failSummary. |
cancelled | Cancelled on request. |
needs_decrypt | The file is encrypted with a sensitivity label and could not be processed. Resubmit a decrypted file. |
| Field | Type | Description |
|---|---|---|
jobId | string | Job ID (same value as id). |
status | string | A status value from the table above. |
title, outputName | string | Submitted file name and result file name. |
downloadUrl | string | Download path of a completed job. Empty string until complete. |
failCode, failSummary | string | Present only on failed jobs. |
settlement | object | Charge details of a finished job: status, chargedMicro, chargedUsd, balanceMicro. |
batch | object | Present only on bulk processing jobs. See section 7. |
curl https://localization.md/api/jobs/JOB_ID \
-H "Authorization: Bearer YOUR_API_KEY"{
"id": "JOB_ID",
"jobId": "JOB_ID",
"title": "report.docx",
"outputName": "report.docx",
"status": "ready",
"downloadUrl": "/api/jobs/JOB_ID/download",
"settlement": {
"status": "settled",
"chargedMicro": 412000,
"chargedUsd": "$0.41",
"balanceMicro": 9588000
},
"charged": 412000
}5.3 Progress stream
GET/api/jobs/{jobId}/events
Receives job progress as Server-Sent Events (text/event-stream). Each message's data is JSON and is sent whenever the state changes.
It removes the need to poll the status, so it is recommended wherever you can keep a connection open.
5.4 Download the result
GET/api/jobs/{jobId}/download
Returns the result file in the original format. Responds 409 NOT_READY if it is not ready yet and 404 NO_OUTPUT if there is no result file.
curl -L -o report.ko.docx \
https://localization.md/api/jobs/JOB_ID/download \
-H "Authorization: Bearer YOUR_API_KEY"5.5 Cancel a job
POST/api/jobs/{jobId}/cancel
Cancels a job in progress. The response reports the outcome in outcome and the new state in status.
5.6 Supported formats
| Category | Formats |
|---|---|
| Supported | PPT · PPTX · PDF · DOC · DOCX · HWPX · EPUB · AZW3 · MOBI · KFX |
| Other formats | The submission is accepted, but the job ends as failed. |
- What is and isn't translated in each format is described in Formats · languages · limits.
5.7 Language codes
Use the codes below in x-target-lang. The source language (x-source-lang) can be identified automatically with auto. The same list is available from GET /api/translate/languages; use type to get the source-language list and the target-language list separately.
| Code | Language |
|---|---|
ko | 한국어 |
en | English |
zh-Hans | 简体中文 |
zh-Hant | 繁體中文 |
ja | 日本語 |
de | Deutsch |
fr | Français |
es | Español |
pt-BR | Português (Brasil) |
it | Italiano |
ru | Русский |
ar | العربية |
tr | Türkçe |
vi | Tiếng Việt |
id | Bahasa Indonesia |
- Codes are case-insensitive. A malformed code returns 400
INVALID_LANGUAGE_CODE.
| Name | Type | Required | Description |
|---|---|---|---|
type | query | Optional |
|
supportsFormality | boolean | Optional | Present on each language when |
supportsGlossary | boolean | Optional | Present on each language when |
5.8 Glossaries
Register source terms and their translations per language pair (dictionary) in a glossary, then name it with x-glossary-id when you submit a file; the translation follows that pair's entries. One glossary can hold several language-pair dictionaries.
A glossary needs an explicit source language (x-source-lang; auto cannot be used). If the glossary has no dictionary for the source and target pair, the response is 400 GLOSSARY_LANGUAGE_MISMATCH. Proofreading jobs (x-task: proofread) use the glossary as spellings to keep for that language.
Send one entry per line as TSV (source, tab, translation) or CSV (source,translation). Put true in a third column to keep the source spelling untranslated. A dictionary holds up to 10,000 entries, a term is up to 1,024 bytes, and each account can create up to 1,000 glossaries.
Glossaries themselves are free. Applied entries go into the translation input, so they are charged as input tokens.
| Method | Path | Description |
|---|---|---|
| GET | /api/glossaries | List glossaries (yours and those shared in your organization) |
| POST | /api/glossaries | Create a glossary — name, optional dictionaries |
| GET | /api/glossaries/{glossaryId} | Glossary and its dictionaries |
| PATCH | /api/glossaries/{glossaryId} | Rename — name |
| DELETE | /api/glossaries/{glossaryId} | Delete the glossary (with its dictionaries) |
| GET | /api/glossaries/{glossaryId}/dictionaries?source_lang=&target_lang= | Dictionary entries — JSON, or format=tsv / format=csv |
| PUT | /api/glossaries/{glossaryId}/dictionaries?source_lang=&target_lang= | Replace a dictionary — TSV or CSV body (content-type: text/csv) |
| DELETE | /api/glossaries/{glossaryId}/dictionaries?source_lang=&target_lang= | Delete a dictionary |
- With an API key, reading needs
translation:read; creating, changing and deleting needtranslation:submit.
curl -X POST https://localization.md/api/glossaries \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{"name": "Product terms", "dictionaries": [{"sourceLang": "en", "targetLang": "ko", "entries": "invoice\t청구서\nContoso\t\ttrue"}]}'curl -X POST https://localization.md/api/translate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-source-lang: en" \
-H "x-target-lang: ko" \
-H "x-glossary-id: GLOSSARY_ID" \
-F "file=@contract.docx"6. Sentence translation
A sentence request sends short text without a file. It doesn't start an engine container, so only translation tokens are deducted, and each request has a minimum charge.
Short text is also submitted as a document file and processed with the flow in section 5.
6.1 Language detection
POST/api/translate/detect-language
Identifies the language of the body { "text": "…" } and returns lang (a code or null) and confidence (0–1). Use it to choose x-source-lang.
Detection is not charged. If the language can't be identified, the response is "ok": false with "lang": null — submit with x-source-lang: auto in that case.
7. Bulk processing
Submit large, non-urgent work with the x-processing: batch header. Bulk processing groups work and runs it asynchronously; it costs less, so it deducts less. There is no separate discount rate.
While waiting for bulk processing, the job status is batching. The batch object in the response holds the stage (stage) and the number of groups processed.
A request that can't use bulk processing (for example, translating with your own LLM key) is not rejected: it runs as an immediate job and the reason is recorded in batch.fallback.
x-processing: batch and x-exec-mode: sequential cannot be combined (400 PROCESSING_CONFLICT).
curl -X POST https://localization.md/api/translate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-target-lang: ja" \
-H "x-processing: batch" \
-F "file=@manual.pdf"8. Proofreading
Submit with x-task: proofread to correct spelling, grammar and style in the source language instead of translating. The result file has the same format as the original, and submitting, checking status and downloading work as in document translation.
A proofreading job sets the target language to the source language. If x-source-lang is omitted, the source language is identified automatically.
8.1 Proofreading changes
GET/api/jobs/{jobId}/proof-changes
Returns the list of changes made by a proofreading job. If the list can't be produced, the response is "available": false; downloading the proofread file still works.
curl -X POST https://localization.md/api/translate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-task: proofread" \
-F "file=@draft.docx"9. Webhooks
Get notified by webhook instead of asking for the status after every job. Register a name, a destination URL and event types on the Webhooks screen in the app; every delivery is signed, and the delivery log (delivered · pending · failed) and attempt counts are shown.
Check a registered webhook with a test delivery, and deactivate it when it's no longer needed. Webhooks are managed by organization admins.
9.1 Event types
| Event | Sent when |
|---|---|
translation.job.ready | A translation job completes |
translation.job.failed | A translation job fails |
document.viewer.ready | The result document can be opened in the viewer |
billing.invoice.created | An invoice is created |
support.ticket.updated | A support request is updated |
9.2 Delivery format and signature
Webhooks send a JSON body with POST and include the following headers.
| Name | Type | Required | Description |
|---|---|---|---|
x-vte-event-id | string | Always | Event ID. A redelivered event keeps the same value, so use it to avoid processing duplicates. |
x-vte-event-type | string | Always | Event type (a value from 9.1). |
x-vte-timestamp | string | Always | Signing time (Unix seconds). |
x-vte-signature | string | Always |
|
- A failed delivery is attempted up to 3 times. Respond quickly with a 2xx and do heavy work afterwards.
{
"id": "EVENT_ID",
"type": "translation.job.ready",
"tenantId": "TENANT_ID",
"createdAt": "2026-10-13T09:30:00.000Z",
"data": {}
}import { createHmac, timingSafeEqual } from 'node:crypto';
// rawBody: the request body exactly as received (string)
export function verifyWebhook(rawBody, headers, secret) {
const timestamp = headers['x-vte-timestamp'];
const expected = 'v1=' + createHmac('sha256', secret)
.update(`${timestamp}.${rawBody}`)
.digest('hex');
const given = String(headers['x-vte-signature'] || '');
return given.length === expected.length &&
timingSafeEqual(Buffer.from(given), Buffer.from(expected));
}10. Usage and pricing
The API deducts credits on the same basis as the web, for the compute actually used. Individual developers use topped-up credits (1:1) without a subscription. Enterprise developers can buy credits at a discount with an annual commitment.
Document edit API calls (POST /api/jobs/{jobId}/edits) have a monthly free allowance of 200 calls per account, counted per UTC month. Each call beyond it is charged $0.001. The same count applies whether the call uses an API key or comes from applying an agent suggestion.
If the balance is below the minimum at submission, the response is 402 INSUFFICIENT_CREDITS, with the required amount and current balance in µUSD in required and available. When the job finishes, the final amount appears in the job's settlement.
Context (x-context) goes into the translation input, so it is charged as input tokens.
Full pricing is on Pricing.
10.1 Estimate
POST/api/translate/estimate
Roughly calculates the expected cost and duration per file before you submit. Estimates are not charged and never block a submission.
| Name | Type | Required | Description |
|---|---|---|---|
items | array | Required | 1–50 files. Each item is |
targetLang | string | Optional | Target language code. |
model | string | Optional | Model ID (same values as |
processing | string | Optional |
|
curl -X POST https://localization.md/api/translate/estimate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{"items":[{"filename":"report.docx","bytes":482133}],"targetLang":"ko"}'{
"ok": true,
"currency": "USD",
"confidence": "rough",
"mode": "platform",
"items": [
{
"index": 0,
"format": "docx",
"bytes": 482133,
"costMicro": 180000,
"display": "$0.18",
"durationSec": { "min": 40, "max": 90 }
}
]
}10.2 Enterprise annual commitments
| Annual commitment | Discount |
|---|---|
| $10,000 | 15% |
| $50,000 | 25% |
| $200,000 | 35% |
- The discount applies to the price of acquiring credits; credits are deducted on the same basis. Any unused part of the commitment expires.
10.3 Your own LLM key (BYOK)
Register an OpenAI-family or Anthropic key on the app's 'My LLM keys' screen and translation uses that key. Keys are stored encrypted on the server and can't be viewed again after registration. You don't need to include the key in API requests.
When you translate with BYOK, LLM costs are billed directly to your LLM account; the platform deducts only the other compute plus 5% of the metered token cost.
11. Error codes
Error responses return an HTTP status code with a body of the form { "ok": false, "code": "…" }. Message wording may change, so branch on code.
Every /api response carries a request ID header, x-request-id, and error bodies carry the same value as requestId. If you send a well-formed x-request-id (letters, digits, _ and -, up to 128 characters), it is used as is. Include this value when you contact support.
11.1 HTTP status and codes
| HTTP | code | Meaning | What to do |
|---|---|---|---|
| 400 | INVALID_LANGUAGE_CODE | The language code is malformed. | Use a code from 5.7. |
| 400 | INVALID_LANGUAGE_TYPE | The type value for the language list is not source or target. | Use a value from 5.7. |
| 400 | INVALID_MODEL_ID | The model ID is malformed. | Use a value from GET /api/translate/models. |
| 400 | EXEC_MODE_INVALID · PROCESSING_INVALID · TASK_INVALID | A header value is outside the allowed range. | Use the values in 5.1. |
| 400 | CONNECTOR_SOURCE_INVALID · FILE_REQUIRED | The storage file reference (connectorSource) is malformed or the file is empty. | Check { connectorSource: { connectionId, path } } (a file dragged from the storage overlay). |
| 400 | DOCUMENT_SOURCE_INVALID | The document reference (documentSource) is malformed. | Check { documentSource: { documentId, assetId? } } (a document ID from your document list). |
| 400 | CONTEXT_INVALID · CONTEXT_TOO_LONG | x-context is not base64url UTF-8, or it is longer than 2,000 characters (limit). | Shorten the context and resend it as base64url. |
| 400 | FORMALITY_INVALID · FORMALITY_UNSUPPORTED | The x-formality value is out of range, or the target language does not support formality. | Use a value from 5.1, or use prefer_more / prefer_less. |
| 400 | PROCESSING_CONFLICT | Bulk processing and sequential execution were requested together. | Send only one of them. |
| 400 | MULTIPART_MALFORMED · UPLOAD_ABORTED | The body has no file part, or the upload was cut off. | Resend with a file part that carries a file name. |
| 400 | GLOSSARY_SOURCE_LANG_REQUIRED · GLOSSARY_TARGET_LANG_REQUIRED · GLOSSARY_LANGUAGE_MISMATCH | A glossary was named without a source or target language, or it has no dictionary for that pair. | Send x-source-lang and x-target-lang, and create a dictionary for that pair. |
| 400 | GLOSSARY_ENTRIES_INVALID · GLOSSARY_NAME_INVALID · GLOSSARY_LANGUAGE_INVALID | Glossary entries, name or language codes are malformed (line = entry line number). | Resend in the format in 5.8. |
| 400 | GLOSSARY_ID_INVALID · GLOSSARY_DICTIONARIES_INVALID | The glossary ID is malformed, or the dictionary list sent on creation is invalid (a duplicate language pair or too many dictionaries). | Resend in the format in 5.8. |
| 400 | INVALID_REQUEST · INVALID_JSON · INVALID_USER | The request body or a query value is malformed (field = the offending item). | Fix the request and resend it. |
| 400 | PERIOD_INVALID · LIMIT_OUT_OF_RANGE | The period or count is outside the allowed range (from·to, min·max). | Resend with a value inside the range given in the response. |
| 400 | IDEMPOTENCY_KEY_INVALID | The Idempotency-Key value is not 1–128 characters of letters, digits, ., _, : or -. | Resend with a well-formed key. |
| 404 | GLOSSARY_NOT_FOUND · GLOSSARY_DICTIONARY_NOT_FOUND | The glossary or dictionary doesn't exist. | Check the glossary ID and the language pair. |
| 409 | GLOSSARY_LIMIT_REACHED | The glossary count limit (limit) has been reached. | Delete glossaries you no longer use, then create it again. |
| 413 | GLOSSARY_TOO_LARGE | The dictionary has more entries than the limit (limit). | Split the dictionary. |
| 401 | UNAUTHENTICATED | Credentials are missing or invalid. API key requests carry a reason: KEY_INVALID (malformed or unknown key) · KEY_REVOKED (revoked key) · KEY_EXPIRED (expired key) · KEY_OWNER_INACTIVE (the key owner's account is inactive). | Check the Authorization header and the key status. |
| 402 | INSUFFICIENT_CREDITS | The balance is below the minimum (required, available). | Top up credits and resubmit. |
| 402 | SPEND_CAP_REACHED | The API key has reached its monthly spend cap (capMicro, usedMicro, resetsAt). Jobs that are already running finish. | Raise the cap on the API keys page, or resubmit after resetsAt. |
| 403 | FORBIDDEN | The job belongs to another user, or the key lacks permission. reason: SCOPE_DENIED (outside the key's scopes) · ROUTE_NOT_ALLOWED (a path that can't be called with an API key) · ORG_KEYS_DISABLED (organization keys not supported yet) · CONSENT_REQUIRED (copyright consent is needed before issuing a key). | Check the job ID, the key's scopes and the path. |
| 403 | PERMISSION_DENIED · TENANT_UNRESOLVED | You don't have permission to change shared organization glossaries, or the account's organization could not be determined. | Ask an organization admin for permission. |
| 404 | JOB_NOT_FOUND · NO_OUTPUT | The job doesn't exist, or there is no result file to download. | Check the job ID and status. |
| 404 | NOT_FOUND | The requested path or resource doesn't exist. | Check the path and the ID. |
| 404 | ASSET_UNAVAILABLE | The document file to translate (documentSource or estimate documentId) is missing. | Check the document status or upload the original file again. |
| 409 | NOT_READY | The result is not ready yet. | Download after the status becomes ready. |
| 409 | IDEMPOTENCY_IN_PROGRESS | A request with the same Idempotency-Key is still being processed (retryAfterSeconds). | Wait for Retry-After, then resend with the same key to get the job that was created. |
| 410 | FILE_EXPIRED · RESULT_PURGED | The document file was removed after its retention period, or by the delete-after-job setting. | Upload the original file again and submit. |
| 413 | PAYLOAD_TOO_LARGE | The upload exceeds the size limit (limit). | Split the file and submit the parts. |
| 422 | UPLOAD_INCOMPLETE | The received file is incomplete (receivedBytes). This happens when a file is uploaded while it is still being saved. | Resubmit once the file has finished saving. |
| 429 | RATE_LIMITED | Too many requests (retryAfterSeconds). API key responses carry X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers. | Wait for Retry-After, then resend. |
| 500 | GLOSSARY_STORE_ERROR | The glossary store returned an error. | Try again shortly. |
| 502 | TRANSLATION_UNAVAILABLE | The translation service could not be reached temporarily. | Try again shortly. |
| 502 | COWORK_SOURCE_FAILED | The file could not be read from the connected storage. | Try again shortly or check the storage connection. |
| 502 | DOCUMENT_SOURCE_FAILED | The document file could not be read. | Try again shortly. |
| 502 | BILLING_UNAVAILABLE · ESTIMATE_UNAVAILABLE · LANGUAGES_UPSTREAM_ERROR · LANGUAGES_UPSTREAM_INVALID · LANGUAGES_UPSTREAM_UNAVAILABLE | The balance, estimate or language list service could not be reached temporarily. | Try again shortly. |
| 503 | GLOSSARY_UNAVAILABLE · AUTH_UNAVAILABLE | Glossaries can't be applied, or API keys can't be checked, for the moment (the reason for AUTH_UNAVAILABLE is AUTH_BACKEND_UNAVAILABLE). | Try again shortly. This is not a key problem, so there is no need to change the key. |
| 400 · 502 | GLOSSARY_STAGE_FAILED | The glossary could not be prepared for the job. | Check the glossary entries, then resubmit. |
| 4xx · 5xx | SUBMIT_FAILED · OUTPUT_NOT_FOUND · PROOF_CHANGES_FAILED | The translation service rejected the request without a code (its HTTP status is passed through). | For 5xx, try again shortly; for 4xx, check the request and the job status. |
| 409 | EDIT_CONFLICT | A document edit (POST /api/jobs/{jobId}/edits) was sent with an expected version that no longer matches; current has the latest patchCount and editedAt. | Re-read the document and resend with the new expected. |
11.2 Job failures
Problems that occur during processing after a submission is accepted (for example, an unsupported format) are reported as job status failed, not as HTTP errors. The reason is in the job's failCode and failSummary.
12. Limits and retries
Limits
- Uploads have a size limit. Exceeding it returns 413
PAYLOAD_TOO_LARGEwith the allowed number of bytes (limit). - Each API key has a monthly spend cap and a rate limit. Exceeding the rate limit returns 429
RATE_LIMITEDwith aRetry-Afterheader. - An estimate request accepts up to 50 files at a time.
Retries
- 429 and 5xx responses (e.g. 502
TRANSLATION_UNAVAILABLE) are safe to retry. Wait forRetry-Afterwhen present; otherwise wait with growing intervals (exponential backoff). - Other 4xx responses repeat until the request is fixed. For 422
UPLOAD_INCOMPLETE, resubmit once after the file has finished saving. - Each submission creates a new job and is charged separately. If you didn't receive a response, check whether a job was already created before submitting again.
Recommendations
- Use API keys only on your server; never put them in browser code or URLs.
- Don't poll the status at short intervals — use the progress stream or webhooks. If you do poll, lengthen the interval over time.
- Before sending a large batch, check the cost with an estimate and make sure the balance covers it.
12.1 Example: wait for completion
const BASE = 'https://localization.md';
const headers = { Authorization: 'Bearer YOUR_API_KEY' };
const DONE = ['ready', 'failed', 'cancelled', 'needs_decrypt'];
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
export async function waitForJob(jobId) {
let delay = 2000;
for (;;) {
const res = await fetch(`${BASE}/api/jobs/${jobId}`, { headers });
if (res.ok) {
const job = await res.json();
if (DONE.includes(job.status)) return job;
} else if (res.status !== 429 && res.status < 500) {
throw new Error(`HTTP ${res.status}`);
}
const retryAfter = Number(res.headers.get('retry-after'));
await sleep(retryAfter > 0 ? retryAfter * 1000 : delay);
delay = Math.min(delay * 2, 30000);
}
}import time
import requests
BASE = "https://localization.md"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
DONE = {"ready", "failed", "cancelled", "needs_decrypt"}
def wait_for_job(job_id):
delay = 2
while True:
res = requests.get(f"{BASE}/api/jobs/{job_id}", headers=HEADERS)
if res.ok and res.json()["status"] in DONE:
return res.json()
if not res.ok and res.status_code != 429 and res.status_code < 500:
res.raise_for_status()
retry_after = int(res.headers.get("Retry-After", 0) or 0)
time.sleep(retry_after or delay)
delay = min(delay * 2, 30)13. Integrations
The Power Automate custom connector wraps the same API and offers three actions: translate a file (TranslateFile), get job status (GetJob) and download the result (DownloadResult). It authenticates with the OAuth 2.0 flow in 3.3.
Add the connector to a flow to translate files posted to a Teams channel or a SharePoint document library and put the translations back. Setup details are on Integrations.
To connect the API from other tools, import the OpenAPI 3.1 definition openapi.yaml.
14. Changelog
| Date | Change |
|---|---|
| 2026-10-13 | Published the first edition of this API documentation. |
| 2026-10-13 | Added proofreading jobs (x-task: proofread) and the proofreading changes list (GET /api/jobs/{jobId}/proof-changes). |
| 2026-10-13 | Added bulk processing (x-processing: batch) and the batching job status. |
| 2026-10-11 | Added execution mode selection (x-exec-mode). |
| 2026-10-11 | Added 422 UPLOAD_INCOMPLETE, which catches incomplete uploads before a job is created. |