Exporting the site landing.site.fullExport

Scope: landing

Who can execute the method: user with "export" access permission for sites

The method landing.site.fullExport exports the site and its pages into an array for subsequent import, for example, via landing.demos.register.

Method Parameters

Required parameters are marked with *

Name
type

Description

id*
integer

Site identifier.

The site identifier can be obtained using the method landing.site.getList or from the result of the method landing.site.add

params
object

Additional export parameters (detailed description)

Pages within the export are selected in the order of ID ASC and returned in a single response.

Parameter params

Required parameters are marked with *

Name
type

Description

edit_mode
string

Hook export mode. When set to Y, edit mode is enabled. The default is standard mode

scope
string

Internal scope of the landings. It is not related to the REST scope landing or landing_cloud in the method name.

For GROUP, KNOWLEDGE, and MAINPAGE, the value of scope must correspond to the type of the exported site

hooks_disable
string[]

Codes of additional fields to be excluded from ADDITIONAL_FIELDS at the site and page level.

If the parameter is not provided, an empty array is used. Regardless of the input, the method always additionally excludes B24BUTTON_CODE and FAVICON_PICTURE

code
string

Code of the exported site. If not provided, the current site code is used without leading or trailing /.

Only Latin letters and digits are allowed ([a-z0-9], without separators)

name
string

Name of the site in the export. If not provided, the current site name is used

description
string

Description of the site in the export. If not provided, the current site description is used

preview
string

URL of the main preview image. Defaults to an empty string

preview2x
string

URL of the enlarged preview image. Defaults to an empty string

preview3x
string

URL of the retina preview. Defaults to an empty string

preview_url
string

URL of the template preview. Defaults to an empty string

The parameters name, description, preview, preview2x, preview3x, and preview_url apply to the page data only if the site contains a single page. If there are multiple pages, these parameters set the top level of the site export, and the page data is taken from the current values of each page.

Code Examples

How to Use Examples in Documentation

curl -X POST \
          -H "Content-Type: application/json" \
          -d '{
            "id": 326,
            "params": {
              "edit_mode": "Y",
              "code": "myfirstsite2026",
              "name": "Auto Repair Shop",
              "description": "Website for auto service",
              "preview_url": "https://example.com/previews/myfirstsite2026"
            }
          }' \
          "https://**put.your-domain-here**/rest/**user_id**/**webhook_code**/landing.site.fullExport.json"
        
curl -X POST \
          -H "Content-Type: application/json" \
          -d '{
            "id": 326,
            "params": {
              "edit_mode": "Y",
              "code": "myfirstsite2026",
              "name": "Auto Repair Shop",
              "description": "Website for auto service",
              "preview_url": "https://example.com/previews/myfirstsite2026"
            },
            "auth": "**put_access_token_here**"
          }' \
          "https://**put.your-domain-here**/rest/landing.site.fullExport.json"
        
try
        {
        	const response = await $b24.callMethod(
        		'landing.site.fullExport',
        		{
        			id: 326,
        			params: {
        				edit_mode: 'Y',
        				code: 'myfirstsite2026',
        				name: 'Auto Repair Shop',
        				description: 'Website for auto service',
        				preview_url: 'https://example.com/previews/myfirstsite2026'
        			}
        		}
        	);
        
        	const result = response.getData().result;
        	console.info(result);
        }
        catch (error)
        {
        	console.error(error);
        }
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'landing.site.fullExport',
                    [
                        'id' => 326,
                        'params' => [
                            'edit_mode' => 'Y',
                            'code' => 'myfirstsite2026',
                            'name' => 'Auto Repair Shop',
                            'description' => 'Website for auto service',
                            'preview_url' => 'https://example.com/previews/myfirstsite2026',
                        ],
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            echo 'Success: ' . print_r($result, true);
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error exporting site: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'landing.site.fullExport',
            {
                id: 326,
                params: {
                    edit_mode: 'Y',
                    code: 'myfirstsite2026',
                    name: 'Auto Repair Shop',
                    description: 'Website for auto service',
                    preview_url: 'https://example.com/previews/myfirstsite2026'
                }
            },
            function(result)
            {
                if (result.error())
                {
                    console.error(result.error());
                }
                else
                {
                    console.info(result.data());
                }
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'landing.site.fullExport',
            [
                'id' => 326,
                'params' => [
                    'edit_mode' => 'Y',
                    'code' => 'myfirstsite2026',
                    'name' => 'Auto Repair Shop',
                    'description' => 'Website for auto service',
                    'preview_url': 'https://example.com/previews/myfirstsite2026',
                ],
            ]
        );
        
        if (isset($result['error']))
        {
            echo 'Error: ' . $result['error_description'];
        }
        else
        {
            echo '<pre>';
            print_r($result['result']);
            echo '</pre>';
        }
        

Response Handling

HTTP Status: 200

{
            "result": {
                "charset": "UTF-8",
                "code": "myfirstsite2026",
                "site_code": "/dgiy8z1opr/",
                "name": "Auto Repair Shop",
                "description": "Website for auto service",
                "preview": "",
                "preview2x": "",
                "preview3x": "",
                "preview_url": "https://example.com/previews/myfirstsite2026",
                "show_in_list": "Y",
                "type": "page",
                "version": 3,
                "fields": {
                    "ADDITIONAL_FIELDS": {
                        "COOKIES_USE": "N",
                        "B24BUTTON_COLOR": "site",
                        "BACKGROUND_PICTURE": "https://cdn.com.bitrix24.com/.../15_1x.jpg",
                        "THEME_USE": "Y"
                    },
                    "TITLE": "Auto Repair Shop",
                    "LANDING_ID_INDEX": "myfirstsite2026",
                    "LANDING_ID_404": "0"
                },
                "layout": [],
                "folders": [],
                "syspages": [],
                "items": {
                    "myfirstsite2026": {
                        "old_id": "2213",
                        "code": "myfirstsite2026",
                        "name": "Auto Repair Shop",
                        "description": "Website for auto service",
                        "preview": "",
                        "preview2x": "",
                        "preview3x": "",
                        "preview_url": "https://example.com/previews/myfirstsite2026",
                        "show_in_list": "Y",
                        "type": "page",
                        "version": 3,
                        "fields": {
                            "TITLE": "Auto Repair Shop",
                            "RULE": null,
                            "ADDITIONAL_FIELDS": {
                                "B24BUTTON_USE": "N",
                                "METAOG_TITLE": "Vacation Home in Germany Villa Randu",
                                "THEME_USE": "N"
                            }
                        },
                        "layout": [],
                        "items": {
                            "#block28175": {
                                "old_id": 28175,
                                "code": "0.menu_02",
                                "access": "X",
                                "anchor": "b2884",
                                "nodes": {
                                    ".landing-block-node-menu-list-item-link": [
                                        {
                                            "href": "#cottages",
                                            "target": "_self",
                                            "text": "Villas"
                                        }
                                    ]
                                },
                                "style": {
                                    ".navbar": [
                                        "navbar navbar-expand-lg p-0 g-px-15 u-navbar-align-right"
                                    ]
                                },
                                "attrs": {
                                    ".navbar-collapse": [
                                        {
                                            "id": "navBar2884"
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "time": {
                "start": 1773161828.471138,
                "finish": 1773161828.871144,
                "duration": 0.4000060558319092,
                "processing": 0.10344195365905762,
                "date_start": "2026-03-10T19:57:08+02:00",
                "date_finish": "2026-03-10T19:57:08+02:00",
                "operating_reset_at": 1773162428,
                "operating": 0
            }
        }
        

Returned Data

Name
type

Description

result
object | array

Fields of the exported site. If the site is not found in the selection or there are no available pages for export, an empty array [] is returned (detailed description)

time
time

Information about the execution time of the request

Object result

Name
type

Description

charset
string

Encoding of the exported set, usually UTF-8

code
string

Code of the site in the export

site_code
string

Original site code

name
string

Name of the site

description
string

Description of the site

preview
string

URL of the main preview image

preview2x
string

URL of the enlarged preview image

preview3x
string

URL of the retina preview

preview_url
string

URL of the preview

show_in_list
string

Flag for display in the template list Y/N

type
string

Type of the site in lowercase

version
integer

Version of the export format. The method returns 3

fields
object

Site fields (detailed description)

layout
object | array

Site template data. If the template is not linked, an empty array [] is returned (detailed description)

folders
object | array

Groups of pages by folders in the format {"<folder_page_code>": ["<page_code_1>", "..."]}.

If there are no folders, [] is returned

syspages
object | array

System pages in the format {"<system_page_type>": "<page_code>"}.

If system pages are not defined, [] is returned

items
object

Export of the site's pages, where the object key is the page code (detailed description)

Object fields

Name
type

Description

ADDITIONAL_FIELDS
object | array

Additional fields of the site after filtering by hooks_disable

TITLE
string

Site title

LANDING_ID_INDEX
string | integer

Code or identifier of the main page

LANDING_ID_404
string | integer

Code or identifier of the 404 page

Object layout

Name
type

Description

code
string

XML_ID of the site template

ref
string[]

Codes of pages associated with the site template

Object items

Name
type

Description

<page_code>
object

Export of an individual page (detailed description)

Object page

Name
type

Description

old_id
integer | string

Original page identifier

code
string

Page code in the export

name
string

Page name

description
string

Page description

preview
string

URL of the main preview image of the page

preview2x
string

URL of the enlarged preview image of the page

preview3x
string

URL of the retina preview of the page

preview_url
string

URL of the page preview

show_in_list
string

Flag for displaying the page Y/N

type
string

Type of the page site in lowercase

version
integer

Version of the page export format

fields
object

Page fields (detailed description)

layout
object | array

Page template data.

If the template is not linked, an empty array [] is returned (detailed description)

items
object | array

Page blocks (detailed description)

Object fields of the page

Name
type

Description

TITLE
string

Page title

RULE
string | null

Page routing rule

ADDITIONAL_FIELDS
object | array

Additional fields of the page after filtering by hooks_disable

Object layout of the page

Name
type

Description

code
string

XML_ID of the page template

ref
string[]

Codes of pages associated with the page template

Object blocks of the page

Name
type

Description

#block<id>
object

Export of a page block (detailed description)

Object block

Fields of the block that do not contain data are removed from the result and may be absent in the object

Name
type

Description

old_id
integer | string

Original block identifier

code
string

Block code

access
string

Block access level

anchor
string

Local anchor of the block

repo_block
object

Block data from the repository (detailed description)

cards
object

Export of block cards

nodes
object

Export of block nodes

menu
object

Export of block menu

style
object

Export of block styles

attrs
object

Export of block attributes

dynamic
object

Export of block dynamic parameters

Object repo_block

Name
type

Description

app_code
string

Code of the source application of the block

xml_id
string

XML_ID of the block in the repository

Error Handling

HTTP Status: 400

{
            "error": "SYSTEM_ERROR",
            "error_description": "The parameter code can only consist of Latin letters and digits."
        }
        

Name
type

Description

error
string

String error code. It may consist of digits, Latin letters, and underscores

error_description
error_description

Textual description of the error. The description is not intended to be shown to the end user in its raw form

Possible Error Codes

Code

Description

MISSING_PARAMS

Required parameter id is missing

ACCESS_DENIED

Insufficient rights to access sites

TYPE_ERROR

Parameter of incorrect type was provided

SYSTEM_ERROR

Internal execution error, for example, params.code contains characters other than Latin letters and digits

Statuses and System Error Codes

HTTP Status: 20x, 40x, 50x

The errors described below may occur when calling any method.

Status

Code
Error Message

Description

500

INTERNAL_SERVER_ERROR
Internal server error

An internal server error has occurred, please contact the server administrator or Bitrix24 technical support

500

ERROR_UNEXPECTED_ANSWER
Server returned an unexpected response

An internal server error has occurred, please contact the server administrator or Bitrix24 technical support

503

QUERY_LIMIT_EXCEEDED
Too many requests

The request intensity limit has been exceeded

405

ERROR_BATCH_METHOD_NOT_ALLOWED
Method is not allowed for batch usage

The current method is not allowed to be called using batch

400

ERROR_BATCH_LENGTH_EXCEEDED
Max batch length exceeded

The maximum length of parameters passed to the batch method has been exceeded

401

NO_AUTH_FOUND
Wrong authorization data

Invalid access token or webhook code

400

INVALID_REQUEST
Https required

The methods must be called using the HTTPS protocol

503

OVERLOAD_LIMIT
REST API is blocked due to overload

The REST API is blocked due to overload. This is a manual individual block, to remove it you need to contact Bitrix24 technical support

403

ACCESS_DENIED
REST API is available only on commercial plans

The REST API is available only on commercial plans

403

INVALID_CREDENTIALS
Invalid request credentials

The user whose access token or webhook was used to call the method lacks permissions

404

ERROR_MANIFEST_IS_NOT_AVAILABLE
Manifest is not available

The manifest is not available

403

insufficient_scope
The request requires higher privileges than provided by the webhook token

The request requires higher privileges than those provided by the webhook token

401

expired_token
The access token provided has expired

The provided access token has expired

403

user_access_error
The user does not have access to the application

The user does not have access to the application. This means that the application is installed, but the account administrator has allowed access to this application only for specific users

500

PORTAL_DELETED
Portal was deleted

The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the option "Temporary closure of the public part of the site". Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site

Continue Learning