Skip to main content

Restore Version

POST /v1/documents/{document_id}/versions/{version_number}/restore
Restore a previous version as the new latest. This creates a new version with the content from the specified version.

Request

Headers

HeaderRequiredDescription
X-API-KeyYesYour API key

Path Parameters

ParameterTypeRequiredDescription
document_idstringYesThe document ID
version_numberintegerYesThe version number to restore

Example

curl -X POST https://api.surfacedocs.dev/v1/documents/doc_abc123/versions/1/restore \
  -H "X-API-Key: sd_live_..."

Response

Status: 201 Created
{
  "id": "doc_abc123",
  "url": "https://app.surfacedocs.dev/d/doc_abc123",
  "version": 4,
  "version_count": 4,
  "title": "Daily Report — Feb 13",
  "block_count": 2,
  "created_at": "2026-02-14T11:00:00Z"
}