APIBeta
Documents

Add or update a translation of a document

PUT
/v1/documents/{id}/translations/{code}

Adds a target language to the document, or changes the translators of a language it already has. The translators of the body replace the current ones: a translator left out is removed from the language, and an empty list assigns the language to you. Sending the same body again changes nothing.

An address of a member of the team (a manager, you included, or a translator) is assigned as it is. Any other address is invited to the team as a translator, within the translator seats of the plan, and receives the invitation by email. A translator invited by a call that fails later stays invited. Each translator who is not you gets a translation job by email, like an assignment from the app.

The document can be UPLOADED or INDEXED. A new language of an indexed document can be translated at once. The translators of a translation can change whatever its status.

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

BCP 47 tag of the target language, as GET /v1/languages lists it, e.g. it or pt-BR. Not case sensitive

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

Request Body

application/json
  1. body

The translators of the language. An unknown property is refused

translators*array<>

Email addresses of every translator of the language: the list replaces the current one, and a translator left out is removed from the language. An address of a member of the team (a manager, you included, or a translator) is assigned as it is; any other address is invited to the team as a translator. An empty list assigns the language to you

Itemsitems <= 10

Response Body

The document already had the language: the translation, with its new translators

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 PUT 'https://api.redokun.com/v1/documents/1/translations/string' \  -H 'Content-Type: application/json' \  -d '{  "translators": [    "mario.rossi@acme.com"  ]}'
Example Response
{  "id": 0,  "language": {    "name": "string",    "code": "string"  },  "status": "CREATED",  "progress": {    "totalSegments": 0,    "translatedSegments": 0,    "confirmedSegments": 0,    "draftSegments": 0,    "completedPercentage": 0.1  },  "translators": [    {      "id": 0,      "fullName": "string",      "email": "string",      "inviteStatus": "INVITED"    }  ],  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "links": [    {      "rel": "string",      "href": "string"    }  ]}