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

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

Full site export

GET /v1/sites/:id/export

Exports an entire site as a single object: site settings, folders, system pages, pages and their blocks. Use it to back up a site or to move its structure elsewhere.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionSite identifier — a positive integer. List: GET /v1/sites
Parameterscope (query) Typestring Requiredno DescriptionInternal landing scope: KNOWLEDGE / GROUP / MAINPAGE. Specify it if the site belongs to the corresponding scope. Otherwise 404 ENTITY_NOT_FOUND is returned. An ordinary site requested with scope also returns 404
ParameterhooksDisable (query) Typestring Requiredno DescriptionComma-separated settings to leave out of the export. Use the full key names from fields.ADDITIONAL_FIELDS, for example GACOUNTER_USE,COPYRIGHT_SHOW. The key is removed from the site and from every page. An empty value or an empty code in the list is rejected with 400 INVALID_PARAMS

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/sites/3/export" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/sites/3/export" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/3/export', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
console.log('Pages in export:', Object.keys(data.items).length)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/3/export', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data } = await res.json()

Response fields

Export keys come as is, not converted to camelCase: site_code, show_in_list, ADDITIONAL_FIELDS. When there is nothing to export, data is { "items": {} }.

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue on success
Fielddata.code Typestring DescriptionCode of the site's home page, same as fields.LANDING_ID_INDEX
Fielddata.site_code Typestring DescriptionSite symbolic code wrapped in slashes: /docs-export-demo/
Fielddata.name Typestring DescriptionSite name
Fielddata.description Typestring | null DescriptionSite description. null or an empty string when not set
Fielddata.type Typestring DescriptionSite type in lowercase: page, store
Fielddata.charset Typestring DescriptionSite encoding
Fielddata.preview, data.preview2x, data.preview3x, data.preview_url Typestring DescriptionSite preview URLs. An empty string when there is no preview
Fielddata.show_in_list Typestring DescriptionWhether the site is shown in the list: Y / N
Fielddata.version Typenumber DescriptionVersion of the site's internal structure
Fielddata.fields.TITLE Typestring DescriptionSite title
Fielddata.fields.LANDING_ID_INDEX Typestring DescriptionHome page code — a key in data.items
Fielddata.fields.LANDING_ID_404 Typestring | null DescriptionCode of the 404 error page. "0" or null when no page is assigned
Fielddata.fields.ADDITIONAL_FIELDS Typeobject | array DescriptionSite settings: counters, fonts, theme, buttons. The key names are the ones hooksDisable accepts. An empty array [] when there are no settings
Fielddata.layout Typeobject | array DescriptionSite layout: code — layout code, for example empty or header_footer, ref — layout areas, where the key is the area number and the value is the code of the page holding its content. For a layout without areas, ref is an empty array. When no layout is set, data.layout is an empty array []
Fielddata.folders Typeobject DescriptionSite folders. The key is the code of one of the folder's pages, not the code of the folder itself. The value is an array of the codes of all pages in the folder
Fielddata.syspages Typeobject | array DescriptionSite system pages: the key is the page type, for example catalog or order, the value is the page code. An empty array [] when the site has no system pages
Fielddata.items Typeobject DescriptionSite pages. The key is the page code
Fielddata.items.<code>.old_id Typestring DescriptionPage identifier — the same as id in GET /v1/pages/:id. Comes as a string
Fielddata.items.<code>.code, .name, .type, .show_in_list, .version Type— DescriptionThe same fields as on the site, for the page
Fielddata.items.<code>.fields Typeobject DescriptionPage title TITLE, URL rule RULE and page settings ADDITIONAL_FIELDS
Fielddata.items.<code>.layout Typeobject | array DescriptionPage layout in the same shape as data.layout, or an empty array []
Fielddata.items.<code>.items Typeobject | array DescriptionBlocks of the published version of the page. The key is #block<id>. A page without blocks and an unpublished page have an empty array []
Fielddata.items.<code>.items.<block>.old_id Typenumber DescriptionBlock identifier in the published version of the page
Fielddata.items.<code>.items.<block>.code Typestring DescriptionBlock code from the block library
Fielddata.items.<code>.items.<block>.nodes Typeobject DescriptionBlock content. The key is an element selector, the value is an array of values. For a component block, the key is the component name and the value is an object of its parameters
Fielddata.items.<code>.items.<block>.style Typeobject DescriptionStyling classes: element selector → array of classes

Blocks can carry other keys as well — anchor, cards, attrs, dynamic, repo_block, menu. They are present when the block has the corresponding data.

Response example

Export of a test site: the home page with a block and one of the two pages in a folder. The block is trimmed to one element in nodes and one in style.

JSON
{
  "success": true,
  "data": {
    "charset": "UTF-8",
    "code": "docs-export-demo/home",
    "site_code": "/docs-export-demo/",
    "name": "Docs export demo",
    "description": null,
    "preview": "",
    "preview2x": "",
    "preview3x": "",
    "preview_url": "",
    "show_in_list": "Y",
    "type": "page",
    "version": 3,
    "fields": {
      "ADDITIONAL_FIELDS": [],
      "TITLE": "Docs export demo",
      "LANDING_ID_INDEX": "docs-export-demo/home",
      "LANDING_ID_404": null
    },
    "layout": [],
    "folders": {
      "docs-export-demo/shoes": [
        "docs-export-demo/shoes",
        "docs-export-demo/boots"
      ]
    },
    "syspages": [],
    "items": {
      "docs-export-demo/home": {
        "old_id": "2401",
        "code": "docs-export-demo/home",
        "name": "Home",
        "description": null,
        "preview": "",
        "preview2x": "",
        "preview3x": "",
        "preview_url": "",
        "show_in_list": "N",
        "type": "page",
        "version": 3,
        "fields": {
          "TITLE": "Home",
          "RULE": null,
          "ADDITIONAL_FIELDS": []
        },
        "layout": [],
        "items": {
          "#block29423": {
            "old_id": 29423,
            "code": "27.one_col_fix_title_and_text_2",
            "access": "X",
            "anchor": "b29421",
            "nodes": {
              ".landing-block-node-title": [
                "The Creative Team"
              ]
            },
            "style": {
              ".landing-block-node-title": [
                "landing-block-node-title js-animation fadeIn g-mb-20 g-color"
              ]
            }
          }
        }
      },
      "docs-export-demo/shoes": {
        "old_id": "2403",
        "code": "docs-export-demo/shoes",
        "name": "Shoes",
        "description": null,
        "preview": "",
        "preview2x": "",
        "preview3x": "",
        "preview_url": "",
        "show_in_list": "N",
        "type": "page",
        "version": 3,
        "fields": {
          "TITLE": "Shoes",
          "RULE": null,
          "ADDITIONAL_FIELDS": []
        },
        "layout": [],
        "items": []
      }
    }
  }
}

Error response example

404 — site not found:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Site not found or not visible"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS Descriptionid is not a positive integer
HTTP400 CodeINVALID_PARAMS DescriptionhooksDisable is empty or contains an empty code between commas
HTTP400 CodeINVALID_SCOPE Descriptionscope is not KNOWLEDGE, GROUP or MAINPAGE
HTTP404 CodeENTITY_NOT_FOUND DescriptionNo site with this id, the site is not accessible to the key's user, or it belongs to a different scope
HTTP409 CodeLANDING_MODULE_NOT_ENABLED DescriptionThe Sites module is unavailable on this Bitrix24 account. Ask a Bitrix24 account administrator to enable it — until then a retry returns the same refusal
HTTP413 CodeSITE_EXPORT_TOO_LARGE DescriptionThe export exceeds 8 MiB. The response is not truncated — this method cannot export the site as a whole
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 rejected the export or returned it in an unexpected form. The reason is in message
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionBitrix24 denied access: the key's user is not an administrator, or the feature is unavailable on the Bitrix24 account
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the landing scope
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is missing

The full list of common API errors — Errors.

Known specifics

  • Strings with credentials are hidden. If a string in the export contains a Bitrix24 REST webhook URL or an auth, token, access_token, refresh_token or client_secret parameter, the whole string is replaced with [REDACTED]. This also applies to object keys. When moving the site, set such values again.
  • The export is unavailable in batch requests. POST /v1/batch accepts only the list, search, get, create, update, delete and fields actions — export each site with a separate call.
  • Blocks of unpublished pages are not exported. The page is included in the export, but its items is empty until the page is published with POST /v1/pages/:id/publication. For a published page, blocks come from the published version, so their old_id values differ from the identifiers in the draft.
  • The response is large. An export of a 13-page site is about 190 KB: ADDITIONAL_FIELDS and nodes hold the HTML markup of blocks and fonts. To shrink the response, leave out unneeded settings with hooksDisable.

See also