Document Translation API
Download OpenAPI DocumentTranslate Office documents one at a time or in batches, with their layout kept intact.
Translate Word, PowerPoint, Excel, CSV, PDF and InDesign files, structured text files (JSON, XML, HTML, XLIFF) and plain text, keeping each document's layout and formatting. Every translation runs through one of your translation memories: matches are reused, the rest is machine translated and stored back. New here? Read Document Translation for the whole flow.
Every request
Send your organization API key in the x-api-key header; it starts with uvk_. Create one in the Universe app under Settings → API keys. The key and organization limits count requests over a rolling minute. See Authentication and Rate limits.
The usual flow: send the file with Translate a document (for a file over 25 MB, first get an upload URL), poll Get a translation until status is DONE, then download the translated file. Each call translates into one language; call it again for each further language, or translate many files at once with Translate a batch of files.
Translations run in the background, so every call returns straight away. They are charged per source word when they start: Count billable words first if you want the count, and see the current rates on Translate a document. Without enough credits you get 402 and nothing is created. See Credits.
Uploads
Files up to 25 MB go straight into Translate a document as the file part. For a Word, PowerPoint, Excel, PDF or InDesign file up to 500 MB, get a presigned upload URL, PUT the file to it, and translate it by its objectKey.
Get an upload URL
Get a text file upload URL
Get an edited picture upload URL
Translations
A translation is one document (or one piece of text) in one target language. Start it, poll it until it is DONE or FAILED, and retry, rename or delete it.
- POST/v1/galaxy/playground/document/translate
- POST/v1/galaxy/playground/document/translate/word-count
- GET/v1/galaxy/playground/document/logs/{id}
- GET/v1/galaxy/playground/document/logs/{id}/text-result
- GET/v1/galaxy/playground/document/logs
- POST/v1/galaxy/playground/document/logs/{id}/retry
- POST/v1/galaxy/playground/document/logs/{id}/restart
- PUT/v1/galaxy/playground/document/rename
- POST/v1/galaxy/playground/document/translate/images
Translate a document
Count billable words
Get a translation
Get a text result
List translations
Retry a failed translation
Restart a stalled translation
Rename a translation
List a document's pictures
Batches
Translate many files in one call: up to 20 uploaded files into one language, or every matching file in a folder of your assets into several languages. Each file becomes its own translation, grouped in a batch you can follow. These endpoints must be turned on for your organization.
Translate a batch of files
Get a batch
List batches
Preview a folder translation
Translate a folder
Translate every matching file under a folder of your assets into each target language: one translation per file and language, grouped one batch per language and format. The folder is listed again when you call this, so the run takes what it holds now; send the preview's totals.credits as expectedCredits to refuse a run whose price changed. Each translation is saved, as it finishes, into a new <folder> (translated) folder next to the original, laid out by layout. Returns once everything is queued; follow each batch with Get a batch.
Permission: playground.document:create and asset:read. An API key acts with the role of the member who created it.
Credits: Charged up front for the whole run: every file times every target language, on each file's billable words, all or nothing (402 and nothing created when short). Each translation is settled on the words actually translated when it finishes; one that fails, or cannot be queued, is refunded on its own. Refused with 402 while your organization owes credits.
| Rate | What it covers | Price |
|---|---|---|
| Text translation | Translating plain text in the playground. Charged per source word. | 0.5 credits per word |
| JSON translation | Translating a JSON file in the playground. Charged per source word. | 0.5 credits per word |
| XML translation | Translating an XML file in the playground. Charged per source word. | 0.5 credits per word |
| HTML translation | Translating an HTML file in the playground. Charged per source word. | 0.5 credits per word |
| XLIFF translation | Translating an XLIFF file in the playground. Charged per source word. | 0.5 credits per word |
| Word translation | Translating a Word (.docx) file in the playground. Charged per source word. | 0.5 credits per word |
| PowerPoint translation | Translating a PowerPoint (.pptx) file in the playground. Charged per source word. | 0.5 credits per word |
| Excel translation | Translating an Excel (.xlsx) file in the playground. Charged per source word. | 0.5 credits per word |
| CSV translation | Translating a CSV file in the playground. Charged per source word, for the columns selected. | 0.5 credits per word |
| PDF translation | Translating a PDF in the playground, keeping its layout. Charged per source word. | 0.5 credits per word |
| InDesign translation | Translating an InDesign (.idml) file in the playground, keeping its layout and styles. Charged per source word. | 0.5 credits per word |
| DITA translation | Translating a DITA topic or map in the playground, keeping its structure and markup. Charged per source word. | 0.5 credits per word |
| Markdown translation | Translating a Markdown (.md) file in the playground, keeping its formatting, links and code. Charged per source word. | 0.5 credits per word |
| YAML translation | Translating the text values of a YAML (.yaml, .yml) file in the playground, keeping its keys and structure. Charged per source word. | 0.5 credits per word |
Bodyrequiredapplication/json
Formats to translate, picked by file extension (TEXT is .txt, DITA takes .dita, .ditamap and .bookmap, XLIFF also .xlf, MARKDOWN .md and .markdown, YAML .yaml and .yml). Files of other types are skipped. Several can be combined in one run.
Language of the files, as a code your translation memory uses (BCP 47).
Languages to translate into (BCP 47), at most 10. Each file is translated into each one: one translation per file and language. The source language and duplicates are dropped.
Translation memory every translation uses. It must be one your organization owns or that is shared with it.
The folder in your organization's assets (Drive) to translate. Send this or assetIds.
Instead of a folder: the files to translate, picked in your assets (files of different formats can be mixed; each is translated by its own format). Listed again when you call this, so a file deleted meanwhile is left out. The output folder sits next to the files' folder.
Optional label for where the request comes from, stored on the translation and shown in lists. Any text up to 40 characters; defaults to WEB.
Include files in subfolders (default true).
Files to skip, as gitignore-style patterns (at most 20): config*.json matches at any depth, web/*.json only in web, **/fixtures/** a whole subtree.
How translations are laid out in the output folder: language-folder (hi-IN/emails/welcome.json, the default) or language-suffix (emails/welcome.hi-IN.json).
Project to file every translation of the run under; omit for none. See List projects. Not related to folderId (the Drive folder).
The totals.credits of the preview you approved. When sent, a run that now costs a different amount (files added, removed or changed since the preview) is refused with 409 and nothing is charged.
Run a QE report (AI quality evaluation) on the translation as soon as it finishes. Needs the aiqe:create permission (403 otherwise, before anything is charged) and a VitraTM memory — with a Phrase memory the translation runs and the report is skipped. The report is charged separately, per source word evaluated, when it starts; without enough credits it is skipped and the translation kept. When the organization requires Auto QE (Organization settings), the report runs whatever this field says.
With autoQe: evaluate only the segments still awaiting review (unverified, the default — cheaper, the score covers part of the document) or every segment (all).
Also translate the text inside the pictures of the folder's DOCX / PPTX / XLSX / PDF files (default false). Charged per picture per language; the preview counts them.
Responses
201The run was queued.
ID of the run.
The Drive folder the translations are saved to as they finish.
Show child attributes
Folder ID.
Folder name.
Files translated per language.
Target languages.
Translations queued.
Translations that could not be queued (refunded).
Files skipped, as in the preview.
One batch per target language and format.
Show child attributes
Batch ID. Read it with Get a batch.
Target language of the batch.
Format of the batch’s files.
Files queued.
Files that could not be queued.
Translations that could not be queued. Empty when all were.
Show child attributes
Path of the file inside the folder.
Target language.
Why it could not be queued.
400Nothing was started. A field failed validation, or: `Pick at least one target language.`, `There are no files to translate in “<folder>”.`, `PDF translation into <languages> is not supported yet …`, a too-large folder (see Preview a folder translation), or a translation memory your organization cannot use.
HTTP status code, repeated in the body.
What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.
Short name of the status.
401The `x-api-key` header is missing, or the key is invalid, expired or deleted.
HTTP status code, repeated in the body.
What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.
Short name of the status.
402Not enough credits for the counted words, or your organization owes credits. Nothing was created or started.
HTTP status code.
Always InsufficientCredits.
What happened, in plain words.
Credits this request needs.
Credits your organization can spend now.
Credits your organization owes from earlier jobs (0 when nothing is owed). While anything is owed, every paid request is refused until it is repaid.
403The key lacks the permission.
HTTP status code, repeated in the body.
What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.
Short name of the status.
404`folderId` is not a folder of your organization's assets (`Folder not found`), or `projectId` is not a project in it (`Project not found`).
HTTP status code, repeated in the body.
What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.
Short name of the status.
409The run now costs a different amount than `expectedCredits` (`FolderRunChanged`, with `credits` and `expectedCredits`). Preview again. Nothing was charged.
HTTP status code, repeated in the body.
What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.
Short name of the status.
429Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.
HTTP status code, repeated in the body.
What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.
Short name of the status.
500Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.
HTTP status code, repeated in the body.
What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.
Short name of the status.
503A PDF is still being read or rendered (`This PDF is still being read. Please try again in a moment.`, `PdfStillPreparing`), or several PDFs are already being prepared for your organization (`PdfEngineBusy`). Nothing was charged. Retry after `retryAfterSeconds` (10).
HTTP status code, repeated in the body.
What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.
Short name of the status.
curl '{{API_BASE_URL}}/v1/galaxy/playground/document/translate/folder' \
--request POST \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"folderId": "6b2e8d4f-1a3c-4e5b-9d7f-2c1b0a9e8d7c",
"assetIds": [
"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
],
"formats": [
"DOCX",
"PPTX"
],
"sourceLanguage": "en-US",
"targetLanguages": [
"hi-IN",
"bn-BD"
],
"tmId": "5c8d2e1f-9a3b-4c6d-8e7f-1a2b3c4d5e6f",
"suite": "WEB",
"includeSubfolders": true,
"exclude": [
"config*.json"
],
"layout": "language-folder",
"projectId": "4e7a1b9c-3d2f-4c8e-9a6b-0d1c2b3a4f5e",
"expectedCredits": 4380,
"autoQe": false,
"qeScope": "unverified",
"translateImages": false
}'{
"runId": "8f1d3c5b-7a9e-4b2d-8c6f-4e3d2c1b0a9f",
"outputFolder": {
"id": "6b2e8d4f-1a3c-4e5b-9d7f-2c1b0a9e8d7c",
"name": "locales"
},
"files": 12,
"targets": 2,
"queued": 24,
"rejected": 0,
"skipped": 1,
"batches": [
{
"batchId": "2a6f1c8e-4b3d-4e9a-8c7b-5d1e2f3a4b5c",
"targetLanguage": "hi-IN",
"format": "JSON",
"queued": 12,
"rejected": 0
}
],
"failures": [
{
"path": "emails/welcome.json",
"targetLanguage": "hi-IN",
"error": "This file could not be queued for translation."
}
]
}Results
Download a finished translation in its original format, or save it to your organization's assets. The file is rebuilt on every call, so it includes the latest edits.
- GET/v1/galaxy/playground/document/logs/{id}/export
- POST/v1/galaxy/playground/document/logs/{id}/save-to-assets
- GET/v1/galaxy/playground/document/logs/{id}/images
- POST/v1/galaxy/playground/document/logs/{id}/images/translate
- PUT/v1/galaxy/playground/document/logs/{id}/images/{imageId}/edited
- POST/v1/galaxy/playground/document/logs/{id}/images/{imageId}/revert
Download the translated file
Save to your assets
List pictures
Translate pictures
Use an edited picture
Revert a picture
Editing
Review a translation segment by segment: read the source and translated text, correct it, mark segments verified or approved, and keep the result in sync with your translation memory.
- GET/v1/galaxy/playground/document/logs/{id}/segments
- PUT/v1/galaxy/playground/document/update-phrase
- PUT/v1/galaxy/playground/document/bulk-verify-phrases
- PUT/v1/galaxy/playground/document/sync-to-tm
- PUT/v1/galaxy/playground/document/sync-from-tm
- GET/v1/galaxy/playground/document/logs/{id}/segments/{ordinal}/translation-origin
List segments
Edit a segment
Set review status
Sync edits to the translation memory
Update from the translation memory
Explain a segment translation
DITA maps
- POST/v1/galaxy/playground/document/packages/upload/presign
- POST/v1/galaxy/playground/document/packages/quote
- POST/v1/galaxy/playground/document/packages
- GET/v1/galaxy/playground/document/packages
- GET/v1/galaxy/playground/document/packages/{id}
- PATCH/v1/galaxy/playground/document/packages/{id}
- GET/v1/galaxy/playground/document/packages/{id}/export
- GET/v1/galaxy/playground/document/packages/{id}/file