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

FieldTypeRequiredDescription
document_idUUIDYesThe source document
languagestringYesISO 639-1 code of the translation
contentobjectYesFull 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

StatusCause
400content is not a JSON object
401Missing or invalid token
403Caller is not an editor or admin
404No translation for that document and language. Run POST /translation first
429Rate limited (60 requests/min per IP)