Versions

Read item version history and restore previous versions.

Every write to an item can produce a version-history snapshot. These routes expose that history.

Version history depends on the site's license limits. This is in addition to the whole-API JSON access gate.

GET /cms/collections/{collection}/items/{slug}/versions

List versions for an item, newest first.

Field
Value

Auth

Required

Role

Any API key user

Response:

{
  "versions": [
    { "timestamp": 1713611100, "size": 1204 },
    { "timestamp": 1713607273, "size": 1100 }
  ],
  "current": {
    "modified": 1713612200,
    "size": 1280
  }
}

timestamp values are integer Unix timestamps.

GET /cms/collections/{collection}/items/{slug}/versions/{version}

Read a single historical version's full content.

Field
Value

Auth

Required

Role

Any API key user

Pending adapter alignment for external JSON API clients.

POST /cms/collections/{collection}/items/{slug}/versions/{version}/restore

Promote a historical version back to current. This writes a new version on top of history. It does not rewrite history.

Field
Value

Auth

Required

Role

Any API key user

Pending adapter alignment for external JSON API clients.

Last updated

Was this helpful?