Skip to Content
APIEndpointsUndo content edit

Undo content edit

Reverses an edit made with Apply content edits, also in every editor where the draft is open. Refused with 409 conflict once the edited blocks have changed since, when it was already undone, or while the draft has suggestions waiting for review. The undo is itself logged with a new edit_id, so it can be undone in turn.

Requires the write:content scope, and the workspace must be enabled for API writes.

POST /v1/brands/{brand_id}/content/{draft_id}/edits/{edit_id}/undo

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands
draft_iduuidrequiredThe draft the edit changed
edit_iduuidrequiredFrom Apply content edits

Query parameters

None.

Request

curl --request POST \ --url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/content/7c1e2b90-3f4d-4a8e-9b21-5d6f7a8b9c0d/edits/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9/undo' \ --header 'Authorization: Bearer <api-key>' \ --header 'Idempotency-Key: <unique-per-attempt>'

Response

{ "data": { "edit_id": "6f7a8b9c-0d1e-4f2a-b3c4-d5e6f7a8b9c0", "undone_edit_id": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9", "draft_id": "7c1e2b90-3f4d-4a8e-9b21-5d6f7a8b9c0d", "undo_available": true, "review_url": "https://app.askylabs.com/content/7c1e2b90-3f4d-4a8e-9b21-5d6f7a8b9c0d", "live_page_updated": false, "translations_unchanged": [] }, "request_id": "req_7d21b0af59c34e18b6ac" }

Response fields

FieldTypeDescription
data.edit_iduuid | nullrequired. The undo’s own edit, which can be undone in turn
data.undone_edit_iduuidrequired
data.draft_iduuidrequired
data.undo_availablebooleanrequired
data.review_urlstringrequired
data.live_page_updatedbooleanrequired. Always false
data.translations_unchangedarrayrequired
request_idstringrequired
Last updated on