Get the List of Sites landing.site.getList

Scope: landing

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

The method landing.site.getList retrieves a list of sites based on selection parameters.

Warning

By default, only sites with DELETED = "N" are included in the selection. To retrieve deleted sites, pass DELETED or =DELETED in the filter.

Method Parameters

Required parameters are marked with *

Name
type

Description

scope
string

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

For GROUP, KNOWLEDGE, and MAINPAGE, pass the corresponding scope (detailed description)

params
object

Parameters for selecting sites (detailed description)

Parameter params

Name
type

Description

select
string[]

List of fields to select from basic site fields. If the parameter is not provided or is not an array, ["*"] is used. The method always adds ID and TYPE to the selection.

filter
object

Filter by fields from basic site fields. If the parameter is not provided or is not an array, an empty filter {} is used.

If the TYPE parameter or =TYPE specifies the value STORE, the public method converts it to ["STORE", "SMN"].

Exact filtering by type works only for a single value that is allowed in the current internal scope. If an array or a value not available in the current scope is provided, the method will substitute it with a list of allowed types.

order
object

Sorting in the format {"FIELD": "ASC DESC"}. If the parameter is not provided, no special sorting is applied.

group
array

Grouping in ORM format. If not an array, the parameter is converted to an empty array. When filtering by access permissions, ID is added to the grouping.

limit
integer

Limit on the number of rows in the selection at the ORM level. By default, it is not set.

offset
integer

Offset for the selection at the ORM level. If the parameter is not provided, the default ORM behavior is applied.

TYPE and scope Correspondence

Site types and rules for selecting the scope parameter are described in the article Working with Site Types and Scopes.
The table below applies to params.filter.TYPE and params.filter.=TYPE.

params.filter.TYPE

scope in request

When to use

PAGE, STORE, SMN

do not pass

Selection of sites and stores in the standard scope

GROUP

GROUP

Selection of group sites

KNOWLEDGE

KNOWLEDGE

Selection of knowledge bases

MAINPAGE

MAINPAGE

Selection of the main page or vibe

Code Examples

How to Use Examples in Documentation

curl -X POST \
          -H "Content-Type: application/json" \
          -d '{
            "params": {
              "select": [
                "ID",
                "TITLE",
                "TYPE"
              ],
              "filter": {
                "=DELETED": "N"
              },
              "order": {
                "ID": "DESC"
              }
            }
          }' \
          "https://**put.your-domain-here**/rest/**user_id**/**webhook_code**/landing.site.getList.json"
        
curl -X POST \
          -H "Content-Type: application/json" \
          -d '{
            "params": {
              "select": [
                "ID",
                "TITLE",
                "TYPE"
              ],
              "filter": {
                "=DELETED": "N"
              },
              "order": {
                "ID": "DESC"
              }
            },
            "auth": "**put_access_token_here**"
          }' \
          "https://**put.your-domain-here**/rest/landing.site.getList.json"
        
try
        {
        	const response = await $b24.callMethod(
        		'landing.site.getList',
        		{
        			params: {
        				select: [
        					'ID',
        					'TITLE',
        					'TYPE'
        				],
        				filter: {
        					'=DELETED': 'N'
        				},
        				order: {
        					ID: 'DESC'
        				}
        			}
        		}
        	);
        
        	const result = response.getData();
        	console.info(result.result);
        }
        catch (error)
        {
        	console.error(error);
        }
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'landing.site.getList',
                    [
                        'params' => [
                            'select' => [
                                'ID',
                                'TITLE',
                                'TYPE',
                            ],
                            'filter' => [
                                '=DELETED' => 'N',
                            ],
                            'order' => [
                                'ID' => 'DESC',
                            ],
                        ]
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            echo 'Success: ' . print_r($result, true);
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error getting site list: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'landing.site.getList',
            {
                params: {
                    select: [
                        'ID',
                        'TITLE',
                        'TYPE'
                    ],
                    filter: {
                        '=DELETED': 'N'
                    },
                    order: {
                        ID: 'DESC'
                    }
                }
            },
            function(result)
            {
                if (result.error())
                {
                    console.error(result.error());
                }
                else
                {
                    console.info(result.data());
                }
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'landing.site.getList',
            [
                'params' => [
                    'select' => [
                        'ID',
                        'TITLE',
                        'TYPE',
                    ],
                    'filter' => [
                        '=DELETED' => 'N',
                    ],
                    'order' => [
                        'ID' => 'DESC',
                    ],
                ]
            ]
        );
        
        echo '<pre>';
        print_r($result);
        echo '</pre>';
        

Response Handling

HTTP Status: 200

{
            "result": [
                {
                    "ID": "157",
                    "TITLE": "Randu Villa",
                    "TYPE": "PAGE"
                },
                {
                    "ID": "147",
                    "TITLE": "Test Test yesss",
                    "TYPE": "STORE"
                },
                {
                    "ID": "3",
                    "TITLE": "Fork Museum",
                    "TYPE": "PAGE"
                }
            ],
            "time": {
                "start": 1773269838,
                "finish": 1773269838.647153,
                "duration": 0.6471529006958008,
                "processing": 0,
                "date_start": "2026-03-12T01:57:18+01:00",
                "date_finish": "2026-03-12T01:57:18+01:00",
                "operating_reset_at": 1773270438,
                "operating": 0
            }
        }
        

Returned Data

Name
type

Description

result
object[]

List of sites (detailed description). The method may return result: [] without an error if there are no suitable sites according to the filter or if the user does not have "view" access permission for these sites.

time
time

Information about the execution time of the request.

Site Object

Name
type

Description

ID
string

Site identifier. This field is always present in the response.

TYPE
string

Site type. This field is always present in the response.

DOMAIN_NAME
string

Site domain, returned when selecting the DOMAIN_NAME field.

PUBLIC_URL
string

Public URL of the site, returned when selecting the PUBLIC_URL field.

It may be an empty string if the URL could not be determined.

PREVIEW_PICTURE
string

URL of the preview of the main page of the site, returned when selecting the PREVIEW_PICTURE field. It may be an empty string if the preview is unavailable.

PHONE
string | null

Company phone from CRM, returned when selecting the PHONE field.

DATE_CREATE
string

Creation date in string format, returned when selecting the DATE_CREATE field.

DATE_MODIFY
string

Modification date in string format, returned when selecting the DATE_MODIFY field.

LANDING_ID_INDEX
string | null

May be present if PREVIEW_PICTURE was requested in select.

Error Handling

HTTP Status: 400

{
            "error": "ACCESS_DENIED",
            "error_description": "Access denied"
        }
        

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

ACCESS_DENIED

Insufficient permissions to call landing methods.

TYPE_ERROR

Data type error in method call parameters.

SYSTEM_ERROR

Internal error during method execution.

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