Skip to main content

Revert Asset to a Version

POST 

/v1/:slug/assets/:token/revert

Restores the asset head content to a prior stored version_number (delegates to the same service as the GraphQL revertAsset mutation). Revert moves the head FORWARD: it snapshots the pre-revert head as a new source: REVERT version (MAX+1), then rotates to the target's bytes, so the returned head_version_number is old_head + 1, never the target. Reverting to the live head (version_number == head_version_number) is a benign 200 no-op. The optional comment is recorded on the snapshot of the replaced head. Requires the write scope and :modify on the asset.

Error responses use the standard envelope { errors: [{ message, extensions: { code, ... } }] }. Machine-readable extensions.code values: versioning_not_enabled (403), version_write_forbidden (403), revert_window_exceeded (403, also carries revert_window_days), version_not_found (404), invalid_version_number (422), version_blob_missing (422).

Request

Responses

successful