Skip to content
LydieDevelopers
Menu

Restore a document version

View as Markdown
POST/v1/documents/{id}/versions/{versionId}/restore

Makes the body read as a saved version again, as a new edit merged into the live document. The body before the restore is kept as a version (previousVersionId): restore it to undo.

Request
curl -X POST "https://api.lydie.co/v1/documents/01JCQ3V5MZ8G4ZK2X7T9R6N1PB/versions/01JCQ3V5MZ8G4ZK2X7T9R6N1PB/restore" \
  -H "Authorization: Bearer $LYDIE_TOKEN"

Path parameters

Response

  • versionIdstringor null

    The version recording the restored body.

  • previousVersionIdstringor null

    The body before the restore.

  • versionstring

    The body's new content version (for expectedVersion).

200
{
  "versionId": null,
  "previousVersionId": null,
  "version": "3f9c2a71"
}

Errors use one envelope for every endpoint. See Errors and versions.