> ## Documentation Index
> Fetch the complete documentation index at: https://docs.elanlanguages.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Translation

> On this page, we'll dive into the translation job endpoints for creating and managing translation jobs.

Translation jobs allow you to translate files from one language to multiple target languages using AI. You can provide source files directly or connect to a Translation Management System (TMS) like memoQ, Phrase, or XTM.

## Create a translation job

**`POST /v1/jobs/translation`**

This endpoint allows you to create a new translation job. You can either provide source files directly or configure a TMS connection.

### Required attributes

<ParamField body="mode" type="string" required>
  The translation mode. Possible values: `ai`, `human`. Currently only `ai` is supported.
</ParamField>

### Optional attributes

<ParamField body="domain" type="string">
  Content domain for the translation (e.g., "technical", "legal", "marketing").
</ParamField>

<ParamField body="glossaries" type="array of integers">
  List of glossary IDs to use for terminology consistency.
</ParamField>

<ParamField body="context_stores" type="array of integers">
  List of context store IDs to provide reference materials (styleguide content).
</ParamField>

<ParamField body="segmentation" type="string">
  Segmentation mode: `default`, `sentence`, `paragraph`, or `document`.
</ParamField>

<ParamField body="instructions" type="string">
  Additional instructions for the AI translator.
</ParamField>

<ParamField body="source_files" type="array of strings">
  List of source file paths to translate. Required if no TMS is configured.
</ParamField>

<ParamField body="source_language" type="string">
  Source language code (e.g., "en"). Required if `source_files` is provided.
</ParamField>

<ParamField body="target_languages" type="array of strings">
  Target language codes (e.g., \["de", "fr"]). Required if `source_files` is provided.
</ParamField>

<ParamField body="tms" type="object">
  TMS configuration object. Required if `source_files` is not provided. Contains `name` (memoq, phrase, or xtm) and `project_identifier`.
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.elanlanguages.ai/v1/jobs/translation \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}" \
    -H "Content-Type: application/json" \
    -d '{
      "mode": "ai",
      "domain": "technical",
      "source_files": ["/translations/document.docx"],
      "source_language": "en",
      "target_languages": ["de", "fr", "es"],
      "glossaries": [1, 2],
      "instructions": "Use formal tone"
    }'
  ```
</CodeGroup>

```json Response theme={null}
{
  "job_id": "job_abc123def456",
  "status": "queued",
  "message": "Translation job created successfully",
  "created_at": "2025-12-21T10:34:41.135Z"
}
```

***

## Create a post-editing job

**`POST /v1/jobs/post-editing`**

This endpoint allows you to create a new AI post-editing (AIPE) job. Post-editing jobs revise machine-translated content to improve quality.

### Required attributes

<ParamField body="mode" type="string" required>
  The post-editing mode. Possible values: `ai`, `human`. Currently only `ai` is supported.
</ParamField>

<ParamField body="tms" type="object" required>
  TMS configuration object. Contains `name` (memoq, phrase, or xtm) and `project_identifier`.
</ParamField>

### Optional attributes

<ParamField body="domain" type="string">
  Content domain for the post-editing (e.g., "technical", "legal", "marketing").
</ParamField>

<ParamField body="glossaries" type="array of integers">
  List of glossary IDs to use for terminology consistency.
</ParamField>

<ParamField body="context_stores" type="array of integers">
  List of context store IDs to provide reference materials (styleguide content).
</ParamField>

<ParamField body="segmentation" type="string">
  Segmentation mode: `default`, `sentence`, `paragraph`, or `document`.
</ParamField>

<ParamField body="instructions" type="string">
  Additional instructions for the AI post-editor.
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.elanlanguages.ai/v1/jobs/post-editing \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}" \
    -H "Content-Type: application/json" \
    -d '{
      "mode": "ai",
      "domain": "technical",
      "tms": {
        "name": "memoq",
        "project_identifier": "project-123"
      },
      "glossaries": [1],
      "instructions": "Ensure formal tone"
    }'
  ```
</CodeGroup>

```json Response theme={null}
{
  "job_id": "job_pe_abc123def456",
  "status": "queued",
  "message": "Post-editing job created successfully",
  "created_at": "2025-12-21T10:34:41.135Z"
}
```

***

## Create a quality estimation job

**`POST /v1/jobs/quality-estimation`**

This endpoint allows you to create a new AI quality estimation (AIQE) job. Quality estimation jobs assess the quality of translations without a reference translation. The job runs against a TMS project configured via the `tms` object.

### Optional attributes

<ParamField body="tms" type="object">
  TMS configuration object. Contains `name` (memoq, phrase, or xtm) and `project_identifier`.
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.elanlanguages.ai/v1/jobs/quality-estimation \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}" \
    -H "Content-Type: application/json" \
    -d '{
      "tms": {
        "name": "phrase",
        "project_identifier": "project-456"
      }
    }'
  ```
</CodeGroup>

```json Response theme={null}
{
  "job_id": "job_qe_abc123def456",
  "status": "queued",
  "message": "Quality estimation job created successfully",
  "created_at": "2025-12-21T10:34:41.135Z"
}
```

***

## Create a term extraction job

**`POST /v1/jobs/term-extraction`**

This endpoint allows you to create a new term extraction job. Term extraction jobs extract terminology from a TMS project and create a new glossary with the extracted terms. Currently only memoQ is supported.

### Required attributes

<ParamField body="glossary_name" type="string" required>
  The name for the new glossary to be created with the extracted terms.
</ParamField>

### Optional attributes

<ParamField body="domain" type="string">
  Content domain for the term extraction (e.g., "technical", "legal", "marketing").
</ParamField>

<ParamField body="tms" type="object">
  TMS configuration object. Contains `name` (memoq, phrase, or xtm) and `project_identifier`.
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.elanlanguages.ai/v1/jobs/term-extraction \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}" \
    -H "Content-Type: application/json" \
    -d '{
      "glossary_name": "Technical Terms Q1",
      "tms": {
        "name": "memoq",
        "project_identifier": "project-123"
      }
    }'
  ```
</CodeGroup>

```json Response theme={null}
{
  "job_id": "job_te_abc123def456",
  "status": "queued",
  "message": "Term extraction job created successfully",
  "created_at": "2025-12-21T10:34:41.135Z"
}
```

***

## Create a language rewrite job

**`POST /v1/jobs/language-rewrite`**

This endpoint allows you to create a new language rewrite job. Language rewrite jobs transform content according to the selected rewrite type. You can either provide source files directly or configure a TMS connection.

### Required attributes

<ParamField body="mode" type="string" required>
  The rewrite mode. Possible values: `ai`, `human`. Currently only `ai` is supported.
</ParamField>

<ParamField body="type" type="string" required>
  The rewrite type. Possible values: `simplify`, `summarize`, `elaborate`, `continue`, `align`.
</ParamField>

### Optional attributes

<ParamField body="domain" type="string">
  Content domain for the rewriting (e.g., "technical", "legal", "marketing").
</ParamField>

<ParamField body="context_stores" type="array of integers">
  List of context store IDs to provide reference materials (styleguide content).
</ParamField>

<ParamField body="segmentation" type="string">
  Segmentation mode: `default`, `sentence`, `paragraph`, or `document` (default: `default`).
</ParamField>

<ParamField body="instructions" type="string">
  Additional instructions for the rewriting.
</ParamField>

<ParamField body="glossaries" type="array of integers">
  List of glossary IDs to use for terminology consistency.
</ParamField>

<ParamField body="template" type="integer">
  Explicit prompt template ID override. If not specified, falls back to the organization default or system default for the given rewrite type.
</ParamField>

<ParamField body="source_files" type="array of strings">
  List of source files to rewrite. Required if no TMS is configured.
</ParamField>

<ParamField body="source_language" type="string">
  Source language code (e.g., "en"). Required if `source_files` is provided.
</ParamField>

<ParamField body="tms" type="object">
  TMS configuration object. Contains `name` (memoq, phrase, or xtm) and `project_identifier`. Required if `source_files` is not provided.
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.elanlanguages.ai/v1/jobs/language-rewrite \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}" \
    -H "Content-Type: application/json" \
    -d '{
      "mode": "ai",
      "type": "simplify",
      "domain": "technical",
      "source_files": ["/rewrites/document.docx"],
      "source_language": "en",
      "instructions": "Use plain language"
    }'
  ```
</CodeGroup>

```json Response theme={null}
{
  "job_id": "job_lr_abc123def456",
  "status": "queued",
  "message": "Language rewrite job created successfully",
  "created_at": "2025-12-21T10:34:41.135Z"
}
```

***

## Create a quality assurance job

**`POST /v1/jobs/quality-assurance`**

This endpoint allows you to create a new quality assurance (QA) job for a TMS project. Once the job has completed, you can retrieve the results as an HTML report via the [Get QA report](#get-qa-report) endpoint.

### Required attributes

<ParamField body="mode" type="string" required>
  The quality assurance mode. Possible values: `ai`, `human`. Currently only `ai` is supported.
</ParamField>

<ParamField body="tms" type="object" required>
  TMS configuration object. Contains `name` (memoq, phrase, or xtm) and `project_identifier`.
</ParamField>

### Optional attributes

<ParamField body="domain" type="string">
  Content domain for the quality assurance (e.g., "technical", "legal", "marketing").
</ParamField>

<ParamField body="context_stores" type="array of integers">
  List of context store IDs to provide reference materials (styleguide content).
</ParamField>

<ParamField body="glossaries" type="array of integers">
  List of glossary IDs to use for terminology consistency.
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.elanlanguages.ai/v1/jobs/quality-assurance \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}" \
    -H "Content-Type: application/json" \
    -d '{
      "mode": "ai",
      "domain": "technical",
      "tms": {
        "name": "memoq",
        "project_identifier": "project-123"
      },
      "glossaries": [1]
    }'
  ```
</CodeGroup>

```json Response theme={null}
{
  "job_id": "job_qa_abc123def456",
  "status": "queued",
  "message": "QA job created successfully",
  "created_at": "2025-12-21T10:34:41.135Z"
}
```

***

## Get QA report

**`GET /v1/jobs/qa-reports/:job_id`**

This endpoint allows you to retrieve the QA report for a completed quality estimation job. The response is an HTML document containing the quality assessment results.

### Optional parameters

<ParamField query="api_key" type="string">
  API key for authentication (alternative to the Authorization header, useful for browser access).
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -G https://api.elanlanguages.ai/v1/jobs/qa-reports/job_qe_abc123def456 \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}"
  ```
</CodeGroup>

***

## List translation jobs

**`GET /v1/jobs`**

This endpoint allows you to list recent jobs for your organization.

### Optional parameters

<ParamField query="limit" type="integer">
  Maximum number of jobs to return (default: 50).
</ParamField>

<ParamField query="category" type="string">
  Filter by UI category (one of `video`, `audio`, `document`, `tms`, `system`, `human_task`, `other`).
</ParamField>

<ParamField query="job_type" type="string">
  Filter by exact workflow handler name (e.g. `dub_video`, `aimt`, `ppt_translation`).
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -G https://api.elanlanguages.ai/v1/jobs \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}"
  ```
</CodeGroup>

```json Response theme={null}
{
  "jobs": [
    {
      "job_id": "job_abc123def456",
      "status": "completed",
      "job_type": "translation",
      "source_language": "en",
      "target_languages": ["de", "fr", "es"],
      "tms": null,
      "project_identifier": null,
      "source_files": ["/translations/document.docx"],
      "target_files": [
        "/translations/document_de.docx",
        "/translations/document_fr.docx",
        "/translations/document_es.docx"
      ],
      "created_at": "2025-12-21T10:34:41.135Z",
      "started_at": "2025-12-21T10:34:45.000Z",
      "ended_at": "2025-12-21T10:40:12.000Z"
    }
  ],
  "total": 1,
  "queue_length": 0
}
```

***

## Get job status

**`GET /v1/jobs/:job_id`**

This endpoint allows you to retrieve the status of a specific job, including results if completed.

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.elanlanguages.ai/v1/jobs/job_abc123def456 \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}"
  ```
</CodeGroup>

```json Response theme={null}
{
  "job_id": "job_abc123def456",
  "status": "completed",
  "created_at": "2025-12-21T10:34:41.135Z",
  "started_at": "2025-12-21T10:34:45.000Z",
  "ended_at": "2025-12-21T10:40:12.000Z",
  "result": {
    "translated_files": [
      "/translations/document_de.docx",
      "/translations/document_fr.docx",
      "/translations/document_es.docx"
    ],
    "word_count": 1500
  },
  "error": null
}
```

***

## Cancel a job

**`DELETE /v1/jobs/:job_id`**

This endpoint allows you to cancel a job if it's still running.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE https://api.elanlanguages.ai/v1/jobs/job_abc123def456 \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}"
  ```
</CodeGroup>
