Untuk ejen AI: markdown halaman ini — /docs-content-en/entities/files/version-restore.md indeks dokumentasi — /llms.txt
Artikel dokumentasi kini tersedia dalam bahasa Inggeris.
Restore content from a version
POST /v1/files/:id/versions/:versionId/restore
Bitrix24 method: disk.file.restoreFromVersion. Scope: disk.
Creates a NEW version containing the selected bytes; it does not rewind history. Every call adds another version. Retention may evict the oldest version, including the source. Ownership is checked before writing. Plans without history return 403 DISK_HISTORY_UNAVAILABLE. Never automatically retry after a timeout: the outcome is unknown, read the file again.
curl -X POST -H "X-Api-Key: YOUR_API_KEY" https://vibecode.bitrix24.com/v1/files/7/versions/9/restore
Response: files projection and meta.newVersionId, the first history version after the call, or null when history is unavailable.
Errors: 400 invalid ID or parameters, 401 missing key, 403 missing disk scope or Bitrix24 permission, 404 missing record, 422 Bitrix24 business refusal. READONLY keys can read but cannot upload or restore. On writes, 502 DISK_OUTCOME_UNKNOWN requires reading the file before any retry.