[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Ffiles\u002Fversion":3,"docs-tabs-entities\u002Ffiles\u002Fversion":6},{"content":4,"lastmod":5},"## Read a file version\n\n`GET \u002Fv1\u002Ffiles\u002F:id\u002Fversions\u002F:versionId`\n\nReturns a single file version by its ID: size, author, save time, and the path to download its content.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `id` (path) | number | yes | File ID. Get it: `GET \u002Fv1\u002Ffiles?folderId=X` |\n| `versionId` (path) | number | yes | ID of a version of this file. List: [`GET \u002Fv1\u002Ffiles\u002F:id\u002Fversions`](.\u002Fversions.md) |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ffiles\u002F205\u002Fversions\u002F410\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ffiles\u002F205\u002Fversions\u002F410\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ffiles\u002F205\u002Fversions\u002F410', {\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { data } = await res.json()\nconsole.log('Version', data.id, '—', data.size, 'bytes, saved', data.createdAt)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ffiles\u002F205\u002Fversions\u002F410', {\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | Always `true` on success |\n| `data.id` | number | Version ID |\n| `data.fileId` | number | ID of the file the version belongs to |\n| `data.size` | number | Size of the version content in bytes |\n| `data.name` | string | File name at the moment the version entered the history. Renaming the file does not change it |\n| `data.contentGeneration` | number | The file's `globalContentVersion` value at the moment the version was saved |\n| `data.createdAt` | datetime\\|null | Date and time the version was saved (ISO 8601) |\n| `data.createdBy` | number | ID of the version author. List: `GET \u002Fv1\u002Fusers` |\n| `data.downloadUrl` | string | Version download path without the domain — [`GET \u002Fv1\u002Ffiles\u002F:id\u002Fversions\u002F:versionId\u002Fdownload`](.\u002Fversion-download.md). Send the `X-Api-Key` header when you follow it |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 410,\n    \"fileId\": 205,\n    \"size\": 10,\n    \"name\": \"report.txt\",\n    \"contentGeneration\": 3,\n    \"createdAt\": \"2026-10-15T17:10:00.000Z\",\n    \"createdBy\": 1,\n    \"downloadUrl\": \"\u002Fv1\u002Ffiles\u002F205\u002Fversions\u002F410\u002Fdownload\"\n  }\n}\n```\n\n## Error response example\n\n404 — this file has no such version:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"File version not found.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 404 | `ENTITY_NOT_FOUND` | The version with this `versionId` does not exist, was removed from the history, or belongs to a different file |\n| 400 | `INVALID_ID` | `id` or `versionId` is not a positive integer |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `TOKEN_MISSING` | Bitrix24 access tokens are unavailable |\n| 403 | `SCOPE_DENIED` | The key lacks the `disk` scope |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **The content of the latest version can change while its ID stays the same.** If the same user changed the file less than five minutes ago, a new upload overwrites the latest version: `versionId` stays the same, while `size`, `contentGeneration`, and `createdAt` are updated. Details — [`POST \u002Fv1\u002Ffiles\u002F:id\u002Fversions`](.\u002Fversion-upload.md).\n- **A version can disappear from the history.** The number of versions is limited by the plan and settings of the Bitrix24 account; the oldest version over the limit is removed together with its `versionId`. Before using a previously saved `versionId`, check it against the [`GET \u002Fv1\u002Ffiles\u002F:id\u002Fversions`](.\u002Fversions.md) list.\n\n## See also\n\n- [File version history](\u002Fdocs\u002Fentities\u002Ffiles\u002Fversions)\n- [Download a file version](\u002Fdocs\u002Fentities\u002Ffiles\u002Fversion-download)\n- [Restore content from a version](\u002Fdocs\u002Fentities\u002Ffiles\u002Fversion-restore)\n- [Get file](\u002Fdocs\u002Fentities\u002Ffiles\u002Fget)\n","2026-10-15",{},1795415249928]