patch-translations
Manually correct one document's translation
Replaces the content of an existing translation, identified by (document_id, language). Use it to fix machine output by hand.
The stored source hash is not changed. If the source document changes later, the next POST /translation overwrites this edit.
Authentication
Authorization: Bearer <workos_access_token> for a user with the editor or admin role.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
document_id | UUID | Yes | The source document |
language | string | Yes | ISO 639-1 code of the translation |
content | object | Yes | Full replacement content. Must be a JSON object |
Response 200 OK
{ "document_id": "a1b2c3d4-…", "language": "fr", "updated": true }
Example
curl -X PATCH "$MEDIAN_API_URL/translations" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"document_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"language": "fr",
"content": { "title": "Titre corrigé", "body": "Contenu corrigé." }
}'
Errors
| Status | Cause |
|---|---|
400 | content is not a JSON object |
401 | Missing or invalid token |
403 | Caller is not an editor or admin |
404 | No translation for that document and language. Run POST /translation first |
429 | Rate limited (60 requests/min per IP) |