Manually replace the stored content of a single existing translation.
Manually replace the stored content of an existing translation. Use this when machine-generated output needs to be corrected without retranslating the entire document.
Endpoint: PATCH /translations
Auth: Bearer JWT (WorkOS)
{
"document_id": "<uuid>",
"language": "fr",
"content": {
"title": "Bonjour",
"body": "..."
}
}
| Field | Type | Required | Notes |
|---|---|---|---|
document_id | uuid | yes | Source document associated with the translation. |
language | string | yes | Language code of the translation to update. |
content | object | yes | Replacement translated content. Must be a JSON object. |
The combination of document_id and language identifies the translation row.
{
"document_id": "<uuid>",
"language": "fr",
"updated": true
}
Manually updating a translation does not change its source_hash.
As a result:
POST /translation skips the translation and preserves the manual correctioncurl -X PATCH '{TRANSLATION_API_URL}/translations' \
-H 'Authorization: Bearer <workos-jwt>' \
-H 'Content-Type: application/json' \
-d '{
"document_id": "<uuid>",
"language": "fr",
"content": {
"title": "Bonjour",
"body": "Contenu corrigΓ©."
}
}'
400 Bad Request β content is not a JSON object401 Unauthorized β bearer token is missing or invalid404 Not Found β no translation exists for the supplied document_id and language500 Internal Server Error β the translation could not be updated due to a database or service error