APIBeta
Documents

Generate a translation of a document

POST
/v1/documents/{id}/translations/{code}/generate

Generates the translated file of one language of the document. The document must be INDEXED, and the translation must be CONFIRMED, or CREATED with confirm=true, which confirms it first.

The generation runs in the background. The answer holds the translation, now GENERATING. Poll its self link, the same as GET /v1/documents/{id}/translations/{code}, every 10 to 30 seconds until the translation is GENERATED, then follow the download link of this answer.

Generating spends words of the plan. When the plan has not enough words left, the call answers 402 and the generation does not start. A translation confirmed by the same call stays CONFIRMED: once words are added, call again without confirm.

Authorization

apiKey
headerAuthorizationBearer <token>

The key the team leader created in Redokun, sent as Authorization: Bearer rdk_.... A read key is rejected on every call that writes (any method other than GET, HEAD or OPTIONS).

Path Parameters

id*integer

Identifier of the document

Range1 <= value <= 2147483647
code*string

Code of the target language, as in the language of the translation, e.g. it or pt-BR. Not case sensitive

Match^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{1,8})*$

Query Parameters

confirm?string

Confirms a CREATED translation before generating it. Confirming locks the translation: it can no longer be edited until it is unlocked in the web app. Without it, a CREATED translation answers 409

Default"false"
Value in"true""false"
confirmDrafts?string

Also confirms the draft segments of the translation, so they are saved in the translation memories of the team. Only allowed together with confirm=true. The drafts are confirmed only with the translation: on a translation already CONFIRMED the call answers 409

Default"false"
Value in"true""false"

Response Body

The generation is queued. The translation, now GENERATING

application/json
  1. response
id*integer

Identifier of the translation. Each revision of the document has its own translations, so the id changes when a new revision is uploaded

language*

Language of the translation

status*string

CREATED: the translation is open for work. PRE_TRANSLATING: a pre-translation that includes this language is queued or running. CONFIRMED: the translation was confirmed and the file can be generated. GENERATING: the translated file is being generated. GENERATED: the translated file is ready.

Value in"CREATED""PRE_TRANSLATING""CONFIRMED""GENERATING""GENERATED"
progress*
translators*array<>

The people assigned to translate this language

createdAt*string

When the language was added to the document

Formatdate-time
updatedAt*|

When the translation last changed. Null if it never did

Formatdate-time
links*array<>

The resources related to this one. Follow these links instead of building the URLs yourself, so a change of path does not break the client

Example Request
curl -X POST 'https://api.redokun.com/v1/documents/1/translations/string/generate'
Example Response
{  "id": 4512,  "language": {    "name": "Italian",    "code": "it"  },  "status": "GENERATING",  "progress": {    "totalSegments": 120,    "translatedSegments": 120,    "confirmedSegments": 120,    "draftSegments": 0,    "completedPercentage": 100  },  "translators": [],  "createdAt": "2026-09-16T11:40:00+00:00",  "updatedAt": "2026-09-16T11:55:00+00:00",  "links": [    {      "rel": "self",      "href": "https://api.redokun.com/v1/documents/981/translations/it"    },    {      "rel": "translations",      "href": "https://api.redokun.com/v1/documents/981/translations"    },    {      "rel": "document",      "href": "https://api.redokun.com/v1/documents/981"    },    {      "rel": "download",      "href": "https://api.redokun.com/v1/documents/981/translations/it/download"    }  ]}

Download a translation of a document GET

A URL to download the translated file of one language of the document. The translation must be `GENERATED`: check its status with `GET /v1/documents/{id}/translations/{code}`. The file is stored a few seconds after the translation becomes `GENERATED`, and until then the call answers 409. The answer does not hold the file. Download it with a GET to `url`, with no `Authorization` header, before `expiresAt`: the URL works for 15 minutes. Ask for a new URL after that. Anyone who holds the URL can download the file, so do not share or log it. An id that belongs to an older revision of the document answers 303 and points to the download of the same language in the latest revision. Following the redirect is a second call, and counts against the rate limit like any other.

A translation of a document GET

The status and the progress of one language the document is translated into: the same item as in `GET /v1/documents/{id}/translations`. Poll it every 10 to 30 seconds while you wait for a single language. Each revision of the document has its own translations. The first upload of a document has them from the start, with no segments until the document is `INDEXED`: wait for that status of the document before you read the progress. A new revision has none until its indexing copies them from the previous revision, so until then the call answers 404. An id that belongs to an older revision of the document answers 303 and points to the same language in the latest revision. Following the redirect is a second call, and counts against the rate limit like any other.