لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/files/version.md فهرس التوثيق — /llms.txt
مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.
Read a file version
GET /v1/files/:id/versions/:versionId
Returns a single file version by its ID: size, author, save time, and the path to download its content.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionFile ID. Get it: GET /v1/files?folderId=X |
ParameterversionId (path) |
Typenumber | Requiredyes | DescriptionID of a version of this file. List: GET /v1/files/:id/versions |
Examples
curl — personal key
curl "https://vibecode.bitrix24.com/v1/files/205/versions/410" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl "https://vibecode.bitrix24.com/v1/files/205/versions/410" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/files/205/versions/410', {
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
const { data } = await res.json()
console.log('Version', data.id, '—', data.size, 'bytes, saved', data.createdAt)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/files/205/versions/410', {
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const { data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata.id |
Typenumber | DescriptionVersion ID |
Fielddata.fileId |
Typenumber | DescriptionID of the file the version belongs to |
Fielddata.size |
Typenumber | DescriptionSize of the version content in bytes |
Fielddata.name |
Typestring | DescriptionFile name at the moment the version entered the history. Renaming the file does not change it |
Fielddata.contentGeneration |
Typenumber | DescriptionThe file's globalContentVersion value at the moment the version was saved |
Fielddata.createdAt |
Typedatetime|null | DescriptionDate and time the version was saved (ISO 8601) |
Fielddata.createdBy |
Typenumber | DescriptionID of the version author. List: GET /v1/users |
Fielddata.downloadUrl |
Typestring | DescriptionVersion download path without the domain — GET /v1/files/:id/versions/:versionId/download. Send the X-Api-Key header when you follow it |
Response example
{
"success": true,
"data": {
"id": 410,
"fileId": 205,
"size": 10,
"name": "report.txt",
"contentGeneration": 3,
"createdAt": "2026-10-15T17:10:00.000Z",
"createdBy": 1,
"downloadUrl": "/v1/files/205/versions/410/download"
}
}
Error response example
404 — this file has no such version:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "File version not found."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionThe version with this versionId does not exist, was removed from the history, or belongs to a different file |
| HTTP400 | CodeINVALID_ID |
Descriptionid or versionId is not a positive integer |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionThe X-Api-Key header is missing |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionBitrix24 access tokens are unavailable |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key lacks the disk scope |
Full list of common API errors — Errors.
Known specifics
- 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:
versionIdstays the same, whilesize,contentGeneration, andcreatedAtare updated. Details —POST /v1/files/:id/versions. - 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 savedversionId, check it against theGET /v1/files/:id/versionslist.