post-translations-prune

Find and delete translations whose source content has changed

Finds stale translations: those whose stored source hash no longer matches the current published content of their document. By default it is a dry run that only reports counts. Send "dryRun": false to delete them.

Translations of documents that are not currently published are skipped and left untouched.

Authentication

Authorization: Bearer <workos_access_token> for a user with the editor or admin role.

Request body

FieldTypeRequiredDescription
websiteIdUUIDNoLimit to one website. Omit to cover every website in your organization
dryRunbooleanNoDefaults to true. false deletes the stale rows

Response 200 OK

{
  "dry_run": true,
  "documents_checked": 40,
  "unpublished_documents_skipped": 3,
  "stale_translations": 12,
  "content_bytes": 48213
}
FieldDescription
documents_checkedPublished documents whose hash was recomputed
unpublished_documents_skippedDocuments with translations that aren't published, so weren't checked
stale_translationsRows deleted, or that would be deleted on a dry run
content_bytesTotal JSON size of those rows

Example

curl -X POST "$MEDIAN_API_URL/translations/prune" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"websiteId": "'$WEBSITE_ID'", "dryRun": false}'

Errors

StatusCause
401Missing or invalid token
403Caller is not an editor or admin
429Rate limited (60 requests/min per IP)