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
| Field | Type | Required | Description |
|---|---|---|---|
websiteId | UUID | No | Limit to one website. Omit to cover every website in your organization |
dryRun | boolean | No | Defaults 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
}
| Field | Description |
|---|---|
documents_checked | Published documents whose hash was recomputed |
unpublished_documents_skipped | Documents with translations that aren't published, so weren't checked |
stale_translations | Rows deleted, or that would be deleted on a dry run |
content_bytes | Total 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
| Status | Cause |
|---|---|
401 | Missing or invalid token |
403 | Caller is not an editor or admin |
429 | Rate limited (60 requests/min per IP) |