# Restore a document version

`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.

Scope: `docs:write`.

## Request

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

## Path parameters

- `id` (ULID, required)
- `versionId` (string, required): (1–64 chars)

## Response

- `versionId` (string, required, nullable): The version recording the restored body.
- `previousVersionId` (string, required, nullable): The body before the restore.
- `version` (string, required): The body's new content version (for expectedVersion).

```json
{
  "versionId": null,
  "previousVersionId": null,
  "version": "3f9c2a71"
}
```

Errors use the envelope described at https://developers.lydie.co/errors.md.
