History

Keep previous versions of bucket documents, list them and see how a document looked at any point.

When a bucket has "history": true, Spica records what changed every time a document is replaced or patched. You can list the changes of a document and reconstruct how it looked at a given point, which is useful for audits and for restoring content an editor overwrote.

History is a server feature that is on by default. Turn it off for the whole instance with --bucket-history=false.

Enable history on a bucket

JSON
{
  "title": "Posts",
  "description": "Blog posts",
  "history": true,
  "properties": {}
}

List the changes of a document

GET/bucket/:bucketId/history/:documentId

Returns one entry per change, newest first. changes is the number of properties that changed:

JSON
[
  {"_id": "6b0b19ada5611972c29c2609", "date": "2026-11-28T18:13:01.000Z", "changes": 1},
  {"_id": "6b0b19aca5611972c29c2608", "date": "2026-11-28T18:13:00.000Z", "changes": 1}
]

See a previous version

GET/bucket/:bucketId/history/:documentId/:historyId

Returns the document as it was at that point of its history. It doesn't modify the stored document. To restore it, send the returned document back with PUT /bucket/:bucketId/data/:documentId.

Clear the history of a bucket

DELETE/bucket/:bucketId/history

Deletes every history entry of the bucket and returns 204.

Permissions

EndpointAction
List and showbucket:data:index
Clearbucket:data:delete

History endpoints accept identities and API keys.

Limits

  • Spica keeps the last 10 changes of each document. Older entries are removed as new ones arrive.
  • Inserts and deletes aren't recorded. Use the activity stream to see who created or deleted documents.
  • When you remove a property from the schema or change its type, its recorded changes are dropped.
The entry editor of the Posts bucket, with fields for title, slug, rich text body, status, tags, author relation and cover image
Editors can browse the history of an entry from the panel.