Skip to main content
A
Docs

Translate API reference

Endpoints, request and response examples, and errors for the Translate API: translation, glossaries, translation memory and the editor.

Authentication

Send a token as Authorization: Bearer <token>. Read API conventions.

Endpoints

MethodPathPurposeRole
POST/api/v1/translateTranslate textAny
POST/api/v1/translate/batchTranslate more than one textAny
POST/api/v1/translate/documentTranslate a TXT or DOCX fileAny
POST/api/v1/translate/detectDetect the language of a textAny
POST/api/v1/translate/check-piiFind personal data before you translateAny
GET/api/v1/translate/historyTranslation historyAny
GET/api/v1/translate/translations/searchSearch translationsAny
GET/api/v1/translate/statsTranslation statisticsAny
POST/api/v1/glossariesCreate a glossaryAny
GET/api/v1/glossariesList glossariesAny
GET/api/v1/glossaries/{glossary_id}Get a glossaryAny
PUT/api/v1/glossaries/{glossary_id}Change a glossaryAny
DELETE/api/v1/glossaries/{glossary_id}Delete a glossaryadmin
GET/api/v1/glossaries/{glossary_id}/statsGlossary statisticsAny
POST/api/v1/glossaries/{glossary_id}/entriesAdd a glossary entryAny
GET/api/v1/glossaries/{glossary_id}/entriesList glossary entriesAny
PUT/api/v1/glossaries/{glossary_id}/entries/{entry_id}Change a glossary entryAny
DELETE/api/v1/glossaries/{glossary_id}/entries/{entry_id}Delete a glossary entryadmin
POST/api/v1/glossaries/{glossary_id}/terms/batch-addAdd more than one termAny
POST/api/v1/glossaries/{glossary_id}/terms/batch-deleteDelete more than one termadmin
POST/api/v1/translation-memoryAdd a translation memory entryAny
GET/api/v1/translation-memoryList translation memory entriesAny
GET/api/v1/translation-memory/searchSearch translation memoryAny
GET/api/v1/translation-memory/{entry_id}Get an entryAny
PUT/api/v1/translation-memory/{entry_id}Change an entryAny
DELETE/api/v1/translation-memory/{entry_id}Delete an entryadmin
DELETE/api/v1/translation-memory/bulkDelete more than one entryadmin
GET/api/v1/translation-memory/exportExport translation memory as TMXAny
POST/api/v1/translation-memory/importImport a TMX fileadmin
POST/api/v1/editor/projectsCreate an editor projectAny
GET/api/v1/editor/projectsList editor projectsAny
GET/api/v1/editor/projects/{project_id}Get a project and its segmentsAny
DELETE/api/v1/editor/projects/{project_id}Delete a projectadmin
POST/api/v1/editor/projects/{project_id}/statusSet the status of more than one segmentAny
PUT/api/v1/editor/segments/{segment_id}Edit a segmentAny
POST/api/v1/editor/segments/{segment_id}/statusSet the status of a segmentAny
POST/api/v1/editor/segments/{segment_id}/lockLock a segment while you edit itAny
POST/api/v1/editor/segments/{segment_id}/unlockUnlock a segmentAny
GET/api/v1/editor/segments/{segment_id}/revisionsList the revisions of a segmentAny
GET/api/v1/healthHealth checkNone

Translate text

curl https://translate.example.gov/api/v1/translate \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text": "The applicant must submit a valid trade licence.", "source_lang": "en", "target_lang": "ar", "domain": "administrative"}'
FieldTypeRequiredMeaning
textstringYesUp to 50,000 characters
source_langstringNoar, en or auto. The default is auto.
target_langstringNoar or en. The default is en. It must differ from the source.
domainstringNogeneral, legal, technical, administrative, medical or financial

Response

{
  "id": "tr_41aa",
  "source_text": "The applicant must submit a valid trade licence.",
  "translated_text": "يجب على مقدم الطلب تقديم رخصة تجارية سارية.",
  "source_lang": "en",
  "target_lang": "ar",
  "domain": "administrative",
  "quality_score": 0.92,
  "model_used": "provider/your-model",
  "tokens_used": 64,
  "created_at": "2026-11-18T09:30:00Z"
}

Import translation memory

Send a .tmx or .xml file to POST /api/v1/translation-memory/import. You need the admin role.

Errors

StatusCause
400The file type is not supported, the file is too large, the batch has more than 50 texts, or the import file is not TMX
403Your role cannot delete or import
422The text is too long, or the source and target languages are the same