Restore an earlier version as the current file.
POST/api/v1/documents/{document_id}/versions/{version_id}/restoredocuments:write
The version's file becomes the current file and the current file is archived as a version. Needs an edit grant on the unlocked document. The search and text passes re-run for the restored file.
| Scope | documents:write |
| Asynchronous | No |
| MCP tool | restore_document_version |
| Portal permissions | restore_document_versions |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
document_id | path | string | Required | |
version_id | path | string | Required | |
Docwize-Version | header | string (date) | Optional | |
Idempotency-Key | header | string | Optional | max 255 |
Responses
| Status | Description | Body |
|---|---|---|
200 | Success. | application/json Version or object |
400 | invalid_version | application/problem+json Problem |
401 | token_expired, unauthenticated | application/problem+json Problem |
403 | forbidden, insufficient_scope, token_owner_inactive | application/problem+json Problem |
404 | not_found | application/problem+json Problem |
405 | method_not_allowed | application/problem+json Problem |
406 | not_acceptable | application/problem+json Problem |
409 | conflict, idempotency_in_progress, locked | application/problem+json Problem |
421 | wrong_region | application/problem+json Problem |
422 | idempotency_key_reused, validation_failed | application/problem+json Problem |
500 | internal_error | application/problem+json Problem |
503 | tenant_unavailable, unavailable | application/problem+json Problem |
504 | timeout | application/problem+json Problem |
Errors
The problem codes this operation can answer with. Each code links to its page.
Schemas
UserRef
| Field | Type | Required | Description |
|---|---|---|---|
display_name | string | Required | |
kind | string: user, system, integration or string | Required | |
user_id | string or null | Required |
Version
| Field | Type | Required | Description |
|---|---|---|---|
content_type | string or null | Required | |
created_at | string (date-time) or null | Required | |
created_by | UserRef or null | Required | Who stored the file; null when not recorded (archived files). |
file_hash | string or null | Required | The hash the Portal stored for the file's content; null when none was recorded. |
file_name | string or null | Required | |
has_pdf | boolean | Required | Whether a PDF rendition of this file is ready (an Office file converts on demand, so false only means not yet). |
is_current | boolean | Required | |
is_indexed | boolean | Required | Whether the file's text has been indexed for search. |
page_count | integer or null | Required | The pages the file has, once the Portal has counted them; null before. |
reason | string or null | Required | The description recorded when the file was replaced; null for the current file. |
size_bytes | string or null | Required | |
version_id | string | Required |