لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/source-storage/versions-download.md فهرس التوثيق — /llms.txt

مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.

Download the archive

GET /v1/apps/:id/sources/:versionId/download

Returns a temporary signed link for downloading the source archive of the selected application version.

The operation stays available even when source saving is disabled: the previously saved history remains readable.

Parameters

Parameter Type Required Description
Parameterid (path) TypeUUID Requiredyes DescriptionApplication identifier. Get it via GET /v1/apps.
ParameterversionId (path) Typestring Requiredyes DescriptionVersion identifier of the form v<N>. Get it via List versions. The savedVersionId returned by a deploy to a server on a personal key belongs to the server's history, not the application's: with it, this method returns a link to the archive of a different application version or 404 VERSION_NOT_FOUND. Download that version via the server endpoints.

Examples

curl — personal key

Terminal
# Get the link
curl -H "X-Api-Key: YOUR_API_KEY" \
  https://vibecode.bitrix24.com/v1/apps/<APP_ID>/sources/v3/download

# Download the archive using that link, no additional headers
curl -o source-v3.tar.gz "<url from the response above>"

curl — OAuth application

Terminal
# Get the link
curl -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  https://vibecode.bitrix24.com/v1/apps/<APP_ID>/sources/v3/download

# Download the archive using that link, no additional headers
curl -o source-v3.tar.gz "<url from the response above>"

JavaScript — personal key

javascript
const { data } = await fetch(
  `https://vibecode.bitrix24.com/v1/apps/${appId}/sources/v3/download`,
  { headers: { 'X-Api-Key': 'YOUR_API_KEY' } },
).then((r) => r.json())

const archive = await fetch(data.url)
const buffer = await archive.arrayBuffer()
// Next, unpack the archive: read tar.gz with a tar library, zip with JSZip or similar

JavaScript — OAuth application

javascript
const { data } = await fetch(
  `https://vibecode.bitrix24.com/v1/apps/${appId}/sources/v3/download`,
  {
    headers: {
      'X-Api-Key': 'YOUR_APP_KEY',
      'Authorization': 'Bearer USER_SESSION_TOKEN',
    },
  },
).then((r) => r.json())

const archive = await fetch(data.url)
const buffer = await archive.arrayBuffer()
// Next, unpack the archive: read tar.gz with a tar library, zip with JSZip or similar

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success.
Fielddata.url Typestring DescriptionSigned link to the archive. Requires no additional headers when downloading. The archive format is given by the version's contentType field, see Get version metadata.
Fielddata.expiresAt Typestring DescriptionWhen the signature expires (ISO 8601, UTC). The requested link lifetime is 30 minutes, but the signature may expire earlier: download the archive right away and check this field.

Response example

HTTP 200, the signed link in the example is shortened:

JSON
{
  "success": true,
  "data": {
    "url": "https://<storage-endpoint>/...",
    "expiresAt": "2026-10-07T09:12:22.000Z"
  }
}

Error response example

404 — the application has no version with that identifier:

JSON
{
  "success": false,
  "error": {
    "code": "VERSION_NOT_FOUND",
    "message": "Version v99 not found"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_VERSION_ID DescriptionThe versionId format does not match v<non-negative integer>.
HTTP403 CodeSOURCE_APP_ID_MISMATCH DescriptionThe call was made with an authorization key vibe_app_… issued for a different application. Such a key can access only its own application's snapshots, even when both applications were created by the same author.
HTTP403 CodeNOT_AUTHORIZED DescriptionThe personal key belongs neither to the application author nor to a Bitrix24 account administrator and was not issued for this application.
HTTP404 CodeAPP_NOT_FOUND DescriptionThe application does not exist, was deleted, or belongs to another portal.
HTTP404 CodeVERSION_NOT_FOUND DescriptionA version with this versionId does not exist or was deleted.
HTTP410 CodeSOURCE_VERSION_BYTES_PURGED DescriptionThe version record still exists, but its bytes have already been purged from storage. The only recovery is to save the archive again.
HTTP502 CodeSOURCE_DOWNLOAD_URL_FAILED DescriptionStorage is temporarily unavailable — retry the request.

Full list of common API errors — Errors.

See also