Translation Memory API
Download OpenAPI DocumentTranslation memories, glossaries, term bases and style guides, and the translation that uses them.
Store your approved translations in translation memories and translate new text with them. Each memory can use term bases, glossaries and a style guide, so every translation follows your terminology and voice. New here? Read Translation Memory 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 typical flow: create a translation memory, attach term bases, glossaries and a style guide, then translate texts. Machine translations are saved to the memory as unverified; review them with List terms and Set a term status.
Languages are BCP-47 codes such as en-US, hi-IN or fr-FR. Memories, term bases, glossaries and style guides live with a provider, VitraTM by default. When the provider fails, you get 502 or 503 with error: "TranslationServiceError" and a message you can show; retry with backoff.
Memories
A translation memory stores your approved translations, one source text at a time, and is reused by every translation you run with it. Create one on VitraTM (the default) or link a memory that already exists on Phrase, then use its id everywhere else.
Create a translation memory
List translation memories
Get a translation memory
Update a translation memory
List providers
List provider memories
Imports and exports
Load existing translations into a memory as JSON or as a TMX, XLIFF, XLSX, CSV or TSV file, and download a memory as a file. Imports run in the background: poll them with Get an import. File import and export work for VitraTM memories.
Import terms
Get an upload URL for a file import
Import a file
Get an import
Download an import template
Export a translation memory
Terms
The contents of a memory: each source text with its translations and their review status (unverified, verified, approved). Read them, correct them and mark them reviewed. Review status is a VitraTM feature; Phrase memories have none.
List terms
Update a term
Set a term status
Set term statuses in bulk
Explain a translation
Translation
Translate texts through a memory. Stored translations are reused first and the rest is machine translated, then saved back to the memory for next time. Phrase's pretranslate_job method runs in the background and gives you an operation to poll.
Translate texts
Translate a list of texts into one or more languages with a translation memory. Stored translations are reused first (exact matches, filtered by leverageMinStatus); the rest is machine translated, following the memory's style guide, glossaries and term bases, and saved back to the memory as unverified. Target languages the memory does not have yet are added. VitraTM and Phrase language_ai answer in the request with status: "COMPLETED". VitraTM requests of more than 50 texts run as a background job while the request waits, so allow several minutes. Phrase pretranslate_job, the Phrase default, answers at once with status: "RUNNING" and an operationId to poll with Get a translation operation.
Permission: translation_memory:read. An API key acts with the role of the member who created it.
Bodyrequiredapplication/json
ID of the translation memory to translate with. It can be one your organization owns or one shared with it.
The texts to translate, in order. Either an array of strings, or an array of { text_to_translate, meta } objects that give each text its own context (text is accepted for text_to_translate). Do not mix the two forms. VitraTM passes meta to the model and returns it with the result; Phrase ignores it. The same text sent with two different meta values is translated twice, but the memory stores only the first translation.
Languages to translate into, as BCP-47 codes. A language the memory does not have yet is added to it.
Language of the texts (BCP-47). Defaults to the memory's primary source language. VitraTM accepts any supported language and adds it to the memory; Phrase accepts only the memory's source.
How to translate. VitraTM: llm_translate (the default and only choice). Phrase: pretranslate_job (the default; runs in the background and returns an operationId) or language_ai (answers in the request).
The lowest review status a stored translation needs to be reused as is. verified reuses only verified and approved translations, so unreviewed machine output is translated again. Omit it to reuse any. VitraTM only.
An extra instruction for the model on this request only, on top of the style guide. VitraTM only; ignored by Phrase and by the azure and deepl engines.
Also return why each translation reads as it does: what the model was shown, which of it the translation uses, what the model says it followed and what was left out (translations[].origin), plus the rules those origins name (originCatalog per language). VitraTM only. Adds about 1-5 KB per translation.
Responses
201Either the translations (`status: "COMPLETED"`), or, for Phrase `pretranslate_job`, an operation to poll (`status: "RUNNING"`).
400A field failed validation (languages must be supported BCP-47 codes such as `en-US`), `sourceTexts` mixes strings and objects (`sourceTexts must be all strings or all objects, not a mix of both`), the `method` does not fit the provider (`Method '<method>' is not valid for the '<provider>' provider.`), a Phrase memory got another `sourceLanguage` (`The 'phrase' provider only supports its configured source language '<code>'.`), or a Phrase memory has no project for `pretranslate_job` (`This translation memory has no Phrase project id configured (required for pretranslate_job).`).
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.
403Not allowed: the API key's role lacks the permission (`PermissionDenied`), the product is not enabled for your organization, or it has been turned off.
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.
404No translation memory with this `id` is owned by or shared with your organization (`Translation memory 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.
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.
500A VitraTM request of more than 50 texts ran as a background job that failed (`Translation memory job failed: <reason>`) or took over 20 minutes (`Translation memory job timed out; please retry.`). Retry, or send fewer texts per request.
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.
502The translation service rejected or could not complete the request. The body is `{ statusCode, message, error: "TranslationServiceError" }`, with a message such as `The translation service couldn’t complete this request. Please try again, or contact support if it keeps happening.` A request the translation service rejects as invalid (a file it cannot read, a name already taken, an ID it does not know) is answered with its own 4xx status and message instead, and a Phrase memory whose sign-in fails with 424 `Phrase sign-in failed. …`.
HTTP status code.
What went wrong, in plain words.
Always TranslationServiceError.
503The translation service is busy or unavailable (`TranslationServiceError`). Wait a few seconds and retry.
HTTP status code.
What went wrong, in plain words.
Always TranslationServiceError.
curl '{{API_BASE_URL}}/v1/translation-memory/translate' \
--request POST \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"tmId": "6f1c2a4e-8b3d-4c5a-9e7f-2d1b0a9c8e77",
"sourceTexts": [
"Open an account in minutes",
"Your savings, your rules"
],
"targetLanguages": [
"hi-IN",
"fr-FR"
],
"sourceLanguage": "en-US",
"method": "llm_translate",
"leverageMinStatus": "verified",
"additionalPrompt": "Keep the tone playful and use second person.",
"includeOrigin": true
}'{
"status": "COMPLETED",
"data": [
{
"targetLanguage": "hi-IN",
"translations": [
{
"sourceText": "Open an account in minutes",
"targetText": "मिनटों में खाता खोलें",
"matchType": "mt",
"score": 1,
"status": "unverified",
"meta": {
"key": "onboarding.cta"
},
"origin": {
"v": 1,
"decidedBy": "llm",
"path": "sync",
"promptVersion": "3c1d…",
"shown": {
"references": [
{
"id": "R1",
"kind": "similar",
"score": 0.92,
"status": "verified",
"source": "Save file",
"target": "Datei speichern"
}
],
"terms": [],
"anchors": [],
"rules": [
"S1"
],
"tmContext": false,
"meta": false,
"additionalPrompt": false
},
"evidence": {
"spans": [
{
"start": 15,
"end": 24,
"by": "R1",
"kind": "tm_reference"
}
],
"terms": [],
"references": [
{
"id": "R1",
"overlap": 0.41,
"copied": false
}
],
"anchors": [],
"llmShare": 0.59
}
}
}
],
"originCatalog": {
"styleGuideId": "b2f0…",
"defaultRules": "de-DE",
"rules": [
{
"id": "D1",
"scope": "default",
"text": "Write compound nouns as one word."
},
{
"id": "S1",
"scope": "general",
"ruleId": "7a9e…",
"text": "Use the infinitive for button labels."
}
]
}
}
],
"matchMode": "match",
"stored": true
}Get a translation operation
Term bases
A term base holds your organization's approved terminology: product names, fixed wordings and words translators must not use. Attach a term base to one or more translation memories, and translation through those memories follows its approved terms. Fill it by hand with concepts, or import an XLSX, CSV or TBX file.
List term bases
Create a term base
Get a term base
Update a term base
List memories using a term base
Set memories using a term base
Get an upload URL for term base files
Import a term base file
Export a term base
Download a term base template
Concepts
A concept is one idea in a term base, named by terms in one or more languages: for example dashboard in English and tableau de bord in French. Each term has a review state; translation treats approved terms as binding and new ones as suggestions.
List concepts
Create a concept
Update a concept
Add a term to a concept
Update a concept term
Glossaries
A glossary is a flat list of terms with the wording to use in each language: brand names, product names and fixed UI labels. Attach it to a memory and translation follows it; where a glossary and a term base match the same words, the glossary wins. Move entries in and out in bulk with XLSX or CSV files.
List glossaries
Create a glossary
Get a glossary
Update a glossary
List memories using a glossary
Set memories using a glossary
Get an upload URL for a glossary file
Import a glossary file
Export a glossary
Download a glossary template
Glossary entries
An entry is one term in one language, with its translations, a description and tags. Set translatable to false for a do-not-translate entry: the term then stays exactly as written in every translation.
List glossary entries
Add a glossary entry
Update a glossary entry
Style guides
A style guide holds your translation style as rules, each for one or more languages or for all of them. Upload your style documents and the rules are extracted from them, or write the rules yourself. Memories that follow the guide send its active rules to the model with every translation.
- GET/v1/style-guide
- POST/v1/style-guide/upload/presign
- POST/v1/style-guide
- GET/v1/style-guide/{id}
- PATCH/v1/style-guide/{id}
- POST/v1/style-guide/files/upload/presign
- POST/v1/style-guide/{id}/files
- PATCH/v1/style-guide/{id}/files/{fileId}
- GET/v1/style-guide/{id}/files/{fileId}/content
- POST/v1/style-guide/{id}/extract
- GET/v1/style-guide/{id}/memories
- PUT/v1/style-guide/{id}/memories
List style guides
Get an upload URL for new style guides
Create a style guide
Get a style guide
Update a style guide
Get an upload URL for style guide files
Add style guide files
Update a style guide file
Download a style guide file
Re-extract style guide rules
List memories using a style guide
Set memories using a style guide
Style guide rules
Edit the rules of a style guide one by one or many at a time. Every write returns the whole guide as it now is, plus an outcome that says what the write did.
Add a rule
Update a rule
Update rules in bulk
Reorder rules
Copy rules to another language
Linked resources
Choose the term bases, glossaries and style guide a memory uses when it translates, and read the terminology and style guidance that apply to one target language.
- GET/v1/translation-memory/{id}/term-bases
- PUT/v1/translation-memory/{id}/term-bases
- GET/v1/translation-memory/{id}/glossaries
- PUT/v1/translation-memory/{id}/glossaries
- GET/v1/translation-memory/{id}/style-guide
- PUT/v1/translation-memory/{id}/style-guide
- GET/v1/translation-memory/{id}/terminology
- GET/v1/translation-memory/linked-resources
- GET/v1/translation-memory/{id}/glossary-terminology
List attached term bases
Set attached term bases
List attached glossaries
Set attached glossaries
Get the style guide of a memory
Set the style guide of a memory
Get terminology for a memory
Linked resources of many memories
Get glossary entries for a memory
Sharing
A parent organization can share a memory it owns with its direct child organizations. They translate with it and edit its terms under their own permissions; only the owner decides who it is shared with.