Snapshots

Snapshots represent an entity at a given time in the past. A snapshot is automatically created each time an entry or a content type is published.

Snapshots are not available in the sandbox environments (not master environment). While this is true for sandbox environments, aliasing can effect how snapshots are created. For example, having a ‘master’ alias pointing to a sandbox environment will create snapshots for that environment which might conflict when entries with the same ID exist.

Each snapshot has two top level objects: sys and snapshot.

The sys object contains technical information about the snapshot and has the following nested properties:

FieldTypeDescription
typeStringType of the resource. For snapshots it will always be Snapshot
createdAtDateTimestamp with the moment when the snapshot was created
createdByLinkA reference to the user who created the snapshot
idStringThe unique identifier for this snapshot
snapshotTypeStringThe type of snapshot. For now the only valid value is publish
snapshotEntityTypeStringType of the entity in the snapshot. Entry or ContentType

The snapshot object contains the content of the entity at the moment the snapshot was taken (excluding the Entry.metadata field).

Note that snapshot object has two fields only, similar to the three-field structure of Entry:

  • snapshot.fields - holds the fields of the Entry at the time of the snapshot
  • snapshot.sys - holds the technical details of the Entry at the time of the snapshot

There is no snapshot.metadata field because when taking a snapshot of the Entry, the metadata field (usually containing user-defined tags) is not stored in the snapshot.

Collection filters

When querying large snapshots or large collections, the size in bytes of the resulting dataset may be quite large. To avoid downloading large datasets with unnecessary data from the API, use the select operator.

With the select operator, you can instruct the API to only return specific fields from your dataset.

For example, to limit the returned dataset to fields representing snapshot id and snapshot creation time, use the select operator in the form of: select with the value of sys.id,sys.createdAt.

Note that using the select operator to query the Snapshots API is more flexible and permissive than the more restrictive behavior of querying the Content Delivery API with select. When using the select operator with the Snapshots API you can:

  • request properties with depths larger than 2. For example, select with value sys.id,snapshot.fields.title,snapshot.fields.description.
  • request a field with given locale and specify it at the end of the property path. For example, select with value sys.id,snapshot.fields.description.es,snapshot.fields.description.en.
  • query snapshots of a specific Entry without having to specify the content-type argument.

Entry Snapshots collection

Get all snapshots of an entry

Entry Snapshot

Get a snapshot of an entry

Content Type Snapshots collection

Get all snapshots of a content type

Content Type Snapshot

Get a snapshot of a content type