Documents API: Restore document version
Endpoint#
Section titled “Endpoint#”| Property | Value |
|---|---|
| Type | mutation |
| Method | POST |
| Path | /api/external/v1/documents/restore_document_version |
| Handler | OperatelyWeb.Api.Documents.RestoreVersion |
Authentication#
Section titled “Authentication#”- Requires a valid API token.
- Requires a write-enabled token.
- Read-only tokens return
403.
| Field | Type | Required | Nullable | Default |
|---|---|---|---|---|
document_id | id primitive (encoded as string) | Yes | No | - |
version_number | integer | Yes | No | - |
expected_current_version | integer | Yes | No | - |
Outputs#
Section titled “Outputs#”| Field | Type | Required | Nullable |
|---|---|---|---|
document | resource_hub_document object | Yes | No |
restored_version | document_version object | No | Yes |
cURL Example#
Section titled “cURL Example#”Copied
curl --request POST \
--url "https://app.operately.com/api/external/v1/documents/restore_document_version" \
--header "Authorization: Bearer ${OPERATELY_API_TOKEN}" \
--header "Content-Type: application/json" \
--data '{"document_id":"value", "expected_current_version":123, "version_number":123}'Response Example#
Section titled “Response Example#”{ "document": { "__typename": "value", "author": "<person>", "comments_count": 123, "content": "value", "current_version": 123, "goal": "<goal>", "id": "value", "inserted_at": "value", "name": "value", "notifications": [ "<notification>" ], "parent_folder": "<resource_hub_folder>", "parent_folder_id": "value", "path_to_document": [ "<resource_hub_folder>" ], "permissions": "<resource_hub_permissions>", "potential_subscribers": [ "<subscriber>" ], "project": "<project>", "public_url": "value", "published_at": "2026-01-01T09:30:00Z", "reactions": [ "<reaction>" ], "resource_hub": "<resource_hub>", "resource_hub_id": "value", "space": "<space>", "state": "draft", "subscription_list": "<subscription_list>", "updated_at": "2026-01-01", "url": "value", "versions_count": 123 }, "restored_version": { "__typename": "value", "content": "value", "content_changed": true, "editor": "<person>", "id": "value", "inserted_at": "value", "is_current": true, "origin": "value", "restored_from_version_number": 123, "title": "value", "title_changed": true, "version_number": 123 }}