Get a List of Templates for Creating Websites landing.demos.getSiteList

Choose a tool for developing with an AI agent:

  • use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
  • use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation

Scope: landing

Who can execute the method: a user with View access permission in the Sites section

The method landing.demos.getSiteList retrieves a list of file demo templates for websites.

Method Parameters

Required parameters are marked with *

Name
type

Description

type*
string

Template type.

Possible values:

  • page — templates for pages
  • store — templates for stores
  • knowledge — templates for knowledge bases
  • group — templates for groups
  • mainpage — templates for main pages

filter
object

Object format:

{
            field_1: value_1,
            field_2: value_2,
            ...,
            field_n: value_n
        }
        

where:

  • field_n — filter field
  • value_n — filter value

Filtering is applied to the top-level fields of the template object.

You can filter by fields from the Website Template Type. Nested fields (e.g., DATA.*) are not considered in the filter

Code Examples

How to Use Examples in Documentation

Example of retrieving a list of website templates, where:

  • type — code of the template set
  • filter — filter by website template fields
curl -X POST \
          -H "Content-Type: application/json" \
          -d '{
            "type": "page",
            "filter": {
              "TYPE": "page"
            }
          }' \
          "https://**put.your-domain-here**/rest/**user_id**/**webhook_code**/landing.demos.getSiteList.json"
        
curl -X POST \
          -H "Content-Type: application/json" \
          -d '{
            "type": "page",
            "filter": {
              "TYPE": "page"
            },
            "auth": "**put_access_token_here**"
          }' \
          "https://**put.your-domain-here**/rest/landing.demos.getSiteList.json"
        
// This snippet is an ES module: top-level await requires type="module" or a bundler.
        // $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
        import { Text } from '@bitrix24/b24jssdk'
        import type { B24Frame } from '@bitrix24/b24jssdk'
        
        declare const $b24: B24Frame
        
        // Shape of the payload returned in result (match the "response handling" section of the page)
        type SiteListResult = Record<string, SiteTemplate>
        
        type SiteTemplate = {
          ID: string,
          XML_ID: string,
          TYPE: string[] | string,
          TITLE: string,
          ACTIVE: boolean,
          PUBLICATION: boolean,
          LOCK_DELETE: boolean,
          AVAILABLE: boolean,
          SINGLETON: boolean,
          SECTION: string[],
          DESCRIPTION: string,
          PREVIEW: string,
          PREVIEW2X: string,
          PREVIEW3X: string,
          APP_CODE: string,
          REST: number,
          DATA: Record<string, unknown>,
        }
        
        try {
          const response = await $b24.actions.v2.call.make<SiteListResult>({
            method: 'landing.demos.getSiteList',
            params: {
              type: 'page',
              filter: {
                TYPE: 'page',
              },
            },
            requestId: Text.getUuidRfc4122()
          })
        
          // The payload is available only on a successful response
          if (!response.isSuccess) {
            console.error(response.getErrorMessages().join('; '))
          } else {
            const result = response.getData()!.result
            console.info('Site demo templates:', Object.keys(result))
          }
        } catch (error) {
          // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
          console.error(error)
        }
        
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
        <script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
        <script>
          async function fetchSiteList() {
            try {
              // Initialize the SDK inside a Bitrix24 frame
              const $b24 = await B24Js.initializeB24Frame()
        
              const response = await $b24.actions.v2.call.make({
                method: 'landing.demos.getSiteList',
                params: {
                  type: 'page',
                  filter: {
                    TYPE: 'page',
                  },
                },
                requestId: B24Js.Text.getUuidRfc4122()
              })
        
              // The payload is available only on a successful response
              if (!response.isSuccess) {
                console.error(response.getErrorMessages().join('; '))
                return
              }
        
              const result = response.getData().result
              console.info('Site demo templates:', Object.keys(result))
            } catch (error) {
              // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
              console.error(error)
            }
          }
        
          document.addEventListener('DOMContentLoaded', fetchSiteList)
        </script>
        
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
        
        try:
            bitrix_response = client.landing.demos.get_site_list(
                type="page",
                filter={
                    "TYPE": "page",
                },
            ).response
            result = bitrix_response.result
            print(result)
        except BitrixAPIError as error:
            print(
                "Bitrix API error",
                f"error: {error.error}",
                f"error_description: {error.error_description}",
                sep="\n",
            )
        except BitrixSDKException as error:
            print(f"Bitrix SDK error: {error.message}")
        except Exception as error:
            print(f"Unexpected error: {error}")
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'landing.demos.getSiteList',
                    [
                        'type' => 'page',
                        'filter' => [
                            'TYPE' => 'page',
                        ],
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            echo 'Success: ' . print_r($result, true);
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error getting site demo list: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'landing.demos.getSiteList',
            {
                type: 'page',
                filter: {
                    TYPE: 'page'
                }
            },
            function(result)
            {
                if (result.error())
                {
                    console.error(result.error());
                }
                else
                {
                    console.info(result.data());
                }
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'landing.demos.getSiteList',
            [
                'type' => 'page',
                'filter' => [
                    'TYPE' => 'page',
                ],
            ]
        );
        
        echo '<pre>';
        print_r($result);
        echo '</pre>';
        
// client and ctx are already created — see the Go SDK section
        res, err := client.Core().Call(ctx, "landing.demos.getSiteList", b24.Params{
        	"type": "page",
        	"filter": b24.Params{
        		"TYPE": "page",
        	},
        })
        if err != nil {
        	return fmt.Errorf("landing.demos.getSiteList: %w", err)
        }
        
        // The method wraps the response in an object with the "empty" key.
        raw, ok := b24.Unwrap(res.Result, "empty")
        if !ok {
        	return fmt.Errorf("no empty key in the response")
        }
        
        var item struct {
        	ID          string `json:"ID"`
        	XMLID       string `json:"XML_ID"`
        	Title       string `json:"TITLE"`
        	Active      bool   `json:"ACTIVE"`
        	Publication bool   `json:"PUBLICATION"`
        	LockDelete  bool   `json:"LOCK_DELETE"`
        }
        if err := json.Unmarshal(raw, &item); err != nil {
        	return fmt.Errorf("parse response: %w", err)
        }
        fmt.Println(item.ID, item.XMLID)
        

Response Handling

HTTP Status: 200

{
            "result": {
                "empty": {
                    "ID": "empty",
                    "XML_ID": "empty",
                    "TYPE": ["KNOWLEDGE", "GROUP", "PAGE", "MAINPAGE"],
                    "TITLE": "Empty Template",
                    "ACTIVE": true,
                    "PUBLICATION": false,
                    "LOCK_DELETE": false,
                    "AVAILABLE": true,
                    "SINGLETON": false,
                    "SECTION": [],
                    "DESCRIPTION": "Create your own website from scratch and attract customers!",
                    "PREVIEW": "//bitrix24.com/bitrix/components/bitrix/landing.demo/data/site/empty/preview.jpg",
                    "PREVIEW2X": "//bitrix24.com/bitrix/components/bitrix/landing.demo/data/site/empty/preview@2x.jpg",
                    "PREVIEW3X": "//bitrix24.com/bitrix/components/bitrix/landing.demo/data/site/empty/preview@3x.jpg",
                    "APP_CODE": "",
                    "REST": 0,
                    "DATA": {
                        "name": "Empty Template",
                        "items": [],
                        "encoded": true,
                        "charset": "UTF-8"
                    }
                }
            },
            "time": {
                "start": 1774623040,
                "finish": 1774623040.337361,
                "duration": 0.33736109733581543,
                "processing": 0,
                "date_start": "2026-03-27T17:50:40+01:00",
                "date_finish": "2026-03-27T17:50:40+01:00",
                "operating_reset_at": 1774623640,
                "operating": 0
            }
        }
        

Returned Data

Name
type

Description

result
object | array

Map of website demo templates in the format:

{
            "template_code": site_template
        }
        

where:

  • template_code — template code
  • site_template — template object more details

If no suitable templates are found, the method returns an empty array result: [].

The composition of template fields may vary and depends on the specific template

time
time

Information about the request execution time

Website Template Type

Name
type

Description

ID
string

Template identifier

XML_ID
string

External template code

TYPE
string[] | string

Types for which the template is available.

For file templates, an array is usually returned; for registered application templates, a string

TITLE
string

Template title

ACTIVE
boolean

Active status

PUBLICATION
boolean

Publication availability status

LOCK_DELETE
boolean

Deletion prohibition status

AVAILABLE
boolean

Template availability status

SINGLETON
boolean

Singleton status

SECTION
string[]

Template sections

DESCRIPTION
string

Template description

PREVIEW
string

Preview 1x

PREVIEW2X
string

Preview 2x

PREVIEW3X
string

Preview 3x

APP_CODE
string

Application code

REST
integer

REST template status

DATA
object | array

Template data from file source more details.

For registered application templates, an empty array may be returned

Template DATA Type

Name
type

Description

code
string

Template code in export data

name
string

Template name in export data

type
string[]

Template types.

Possible values:

  • page — templates for pages
  • store — templates for stores
  • knowledge — templates for knowledge bases
  • group — templates for groups
  • mainpage — templates for main pages

description
string | null

Template description

active
boolean

Template active status in export data

singleton
boolean

Template singleton status in export data

lock_delete
boolean

Deletion prohibition status in export data

preview
string

Preview 1x in export data

preview2x
string

Preview 2x in export data

preview3x
string

Preview 3x in export data

preview_url
string

Preview link in export data

show_in_list
string

Show in list status (Y/N)

sort
integer

Template sort index

fields
object

Template fields more details.

Codes for fields.ADDITIONAL_FIELDS can be found in the section Additional Website Fields

items
array | object

Template composition more details

layout
array | object

Template layout data more details

folders
array | object

Template folders more details

syspages
array | object

Template system pages more details

master_pages
array

List of template master pages more details

version
integer

Data format version

old_id
integer | string

Original identifier

encoded
boolean

Added by the method with the value true if there is a field items in DATA

charset
string

Added by the method with the value UTF-8 if there is a field items in DATA

Error Handling

HTTP Status: 400

{
            "error": "ERROR_ARGUMENT",
            "error_description": "The value of an argument 'filter' has an invalid type",
            "argument": "filter"
        }
        

Name
type

Description

error
string

String error code. It consists of digits, Latin letters, and underscores. It may arrive empty — in that case only error_description shows the reason

error_description
string

Error message for the developer. Do not show it to the end user without processing

Possible Error Codes

Code

Description

Value

ERROR_ARGUMENT

The value of an argument 'filter' has an invalid type

The filter parameter is passed in an incorrect type

MISSING_PARAMS

Insufficient call parameters

The required parameter type is missing

ACCESS_DENIED

Insufficient permissions

The user did not pass the general access checks for the Landing module

TYPE_ERROR

Data type error

Method call with incorrect parameter types

SYSTEM_ERROR

Internal error

Error executing the method on the server side

Statuses and System Error Codes

HTTP Status: 4xx, 5xx

The errors described below are returned by the REST API itself, not by the logic of a specific method. They can arrive in response to any method.

Status

Code
Error Message

Description

500

INTERNAL_SERVER_ERROR
Internal server error

An internal server error has occurred. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support

500

ERROR_UNEXPECTED_ANSWER
Server returned an unexpected response

The server returned an unexpected response. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support

503

QUERY_LIMIT_EXCEEDED
Too many requests

The request intensity limit has been exceeded

429

OPERATION_TIME_LIMIT
Method is blocked due to operation time limit

The method is blocked because the request resource intensity limit has been exceeded. The block is lifted automatically once the accumulated execution time of the method no longer exceeds the limit

401

NO_AUTH_FOUND
Wrong authorization data

The request contains no authorization data: neither an access token nor a webhook code was passed

401

INVALID_REQUEST
Https required

Methods are called over the HTTPS protocol only

401

OVERLOAD_LIMIT
REST API is blocked due to overload

The REST API is blocked due to overload. This is a manual individual block. To have it lifted, contact Bitrix24 technical support

401

ACCESS_DENIED
REST is available only on commercial plans

REST API access is not active for this account. In Bitrix24 Cloud, check the current plan or trial status: Vibe+ plans include REST API access, while Essentials plans do not. A webhook receives a different error message — REST is available only by subscription

401

INVALID_CREDENTIALS
Invalid request credentials

No active webhook with the specified user identifier and secret code was found

404

ERROR_METHOD_NOT_FOUND
Method not found!

No method with this name was found. The name is misspelled, the method does not exist in the REST API, or it is unavailable without the required scope

401

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

The request requires broader permissions than the token has: for a webhook these are the permissions granted to it, for an application it is the scope. For an application, the error message ends with provided by the access token

401

expired_token
The access token provided has expired

The access token has expired

401

user_access_error
The user does not have access to the application

The application is installed, but the Bitrix24 administrator has granted access to it only to specific users

403

PORTAL_DELETED
Portal was deleted

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

Continue Learning