Revisions — MDDB API

Document revision history and restore operations

List document revision history #

POST /v1/revisions

Returns the revision history for a specific document, ordered by timestamp descending. Each revision includes the content and metadata at that point in time.

Authorization: BearerAuth or APIKeyAuth or none

Request body #

Required.

Content type application/json: object

Property Type Description
collection (required) string Collection name
key (required) string Document key
lang (required) string Language code
{
  "collection": "blog",
  "key": "hello-world",
  "lang": "en_US"
}

Responses #

Status Description Body
200 Revision history retrieved successfully object (application/json)
400 Missing required fields
404 Document not found

Restore a document to a previous revision #

POST /v1/revisions/restore

Restores a document to the state it was in at a specific revision timestamp. The restored content becomes the current version of the document.

Authorization: BearerAuth or APIKeyAuth or none

Request body #

Required.

Content type application/json: object

Property Type Description
collection (required) string Collection name
key (required) string Document key
lang (required) string Language code
timestamp (required) integer (int64) Unix timestamp of the revision to restore
{
  "collection": "blog",
  "key": "hello-world",
  "lang": "en_US",
  "timestamp": 1704844800
}

Responses #

Status Description Body
200 Document restored successfully Document (application/json)
400 Missing required fields or invalid timestamp
404 Document or revision not found