Получить список пользовательских типов crm.type.list

Выберите инструмент для разработки с AI-агентом:

  • используйте Битрикс24 Вайбкод, чтобы создать приложение для Битрикс24 по описанию задачи без знания языков программирования. Агент напишет код и разместит приложение на сервере без ручной настройки хостинга
  • используйте MCP-сервер, чтобы разрабатывать интеграцию через REST API в своем проекте. Агент будет обращаться к официальной REST-документации

Scope: crm

Кто может выполнять метод: любой пользователь с административным доступом к разделу CRM

Метод получает список настроек смарт-процессов.

Параметры метода

Название
тип

Описание

order
object

Объект формата: { field_1: value_1, field_2: value_2, ..., field_n: value_n }, где

  • field_n: название поля по которому будет произведена сортировка выборки смарт-процессов
  • value_n: значение типа string, равное:
    • ASC — сортировка по возрастанию
    • DESC — сортировка по убыванию

Возможные значения для field соответствуют полям объекта type

filter
object

Объект формата: { field_1: value_1, field_2: value_2, ..., field_n: value_n }, где

  • field_n: название поля по которому будет отфильтрована выборка смарт-процессов
  • value_n: значение фильтра

Возможные значения для field соответствуют полям объекта type

Фильтр может иметь неограниченную вложенность и количество условий.
По умолчанию все условия соединяются друг с другом как AND (логическое И). Если нужно использовать OR (Логическое ИЛИ), то можно передать специальный ключ logic со значением OR.

К ключам field_n можно добавить префикс, уточняющий работу фильтра.
Возможные значения префикса:

  • >= — больше либо равно
  • > — больше
  • <= — меньше либо равно
  • < — меньше
  • @ — IN, в качестве значения передается массив
  • !@ — NOT IN, в качестве значения передается массив
  • % — LIKE, поиск по подстроке. Символ % в значении фильтра передавать не нужно. Поиск ищет подстроку в любой позиции строки
  • =% — LIKE, поиск по подстроке. Символ % нужно передавать в значении. Примеры:
    • "мол%" — ищет значения, начинающиеся с «мол»
    • "%мол" — ищет значения, заканчивающиеся на «мол»
    • "%мол%" — ищет значения, где «мол» может быть в любой позиции
  • %= — LIKE (аналогично =%)
  • !% — NOT LIKE, поиск по подстроке. Символ % в значении фильтра передавать не нужно. Поиск идет с обеих сторон
  • !=% — NOT LIKE, поиск по подстроке. Символ % нужно передавать в значении. Примеры:
    • "мол%" — ищет значения, не начинающиеся с «мол»
    • "%мол" — ищет значения, не заканчивающиеся на «мол»
    • "%мол%" — ищет значения, где подстроки «мол» нет в любой позиции
  • !%= — NOT LIKE (аналогично !=%)
  • = — равно, точное совпадение (используется по умолчанию)
  • != — не равно
  • ! — не равно

start
integer

Параметр используется для управления постраничной навигацией.

Размер страницы результатов всегда статичный — 50 записей.

Чтобы выбрать вторую страницу результатов, передайте значение 50. Чтобы выбрать третью страницу результатов — значение 100 и так далее.

Формула расчета значения параметра start:

start = (N-1) * 50, где N — номер нужной страницы

Обязательные параметры отмечены *

Примеры

Как использовать примеры в документации

  1. Получить список всех смарт-процессов, у которых title содержит или 5, или 0. Полученный список отсортировать по убыванию id

    curl -X POST \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"filter":[{"logic":"OR",{"%title":"5"},{"%title":"0"}]},"order":{"id":"DESC"}}' \
    https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.type.list
    
    curl -X POST \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"filter":[{"logic":"OR",{"%title":"5"},{"%title":"0"}]},"order":{"id":"DESC"},"auth":"**put_access_token_here**"}' \
    https://**put_your_bitrix24_address**/rest/crm.type.list
    
    // 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, ISODate } from '@bitrix24/b24jssdk'
    
    declare const $b24: B24Frame
    
    type CrmTypeItem = {
      id: number
      title: string
      code: string
      createdBy: number
      entityTypeId: number
      customSectionId: number | null
      isCategoriesEnabled: string
      isStagesEnabled: string
      isBeginCloseDatesEnabled: string
      isClientEnabled: string
      isUseInUserfieldEnabled: string
      isLinkWithProductsEnabled: string
      isMycompanyEnabled: string
      isDocumentsEnabled: string
      isSourceEnabled: string
      isObserversEnabled: string
      isRecyclebinEnabled: string
      isAutomationEnabled: string
      isBizProcEnabled: string
      isSetOpenPermissions: string
      isPaymentsEnabled: string
      isCountersEnabled: string
      createdTime: ISODate
      updatedTime: ISODate
      updatedBy: number
    }
    
    // Shape of the payload returned in result (match the "response handling" section of the page)
    type CrmTypeListResult = {
      types: CrmTypeItem[]
    }
    
    try {
      // crm.type.list returns a single page (max 50 records). For the whole result set
      // use a list helper: $b24.actions.v2.callList.make() returns every record as one
      // array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
      // NOTE: the list helpers do not accept `order` (it is excluded from their params, so
      // passing it is a TS error) — keep this call.make + `start` variant when sort matters.
      const response = await $b24.actions.v2.call.make<CrmTypeListResult>({
        method: 'crm.type.list',
        params: {
          filter: {
            '0': {
              logic: 'OR',
              '0': {
                '%title': '5',
              },
              '1': {
                '%title': '0',
              },
            },
          },
          order: {
            id: 'DESC',
          },
          start: 0,
        },
        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('Smart process types:', result.types, 'Page size:', result.types.length)
      }
    } 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 listCrmTypes() {
        try {
          // Initialize the SDK inside a Bitrix24 frame
          const $b24 = await B24Js.initializeB24Frame()
    
          // crm.type.list returns a single page (max 50 records). For the whole result set
          // use a list helper: $b24.actions.v2.callList.make() returns every record as one
          // array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
          // NOTE: the list helpers do not accept `order` (it is excluded from their params, so
          // passing it is a TS error) — keep this call.make + `start` variant when sort matters.
          const response = await $b24.actions.v2.call.make({
            method: 'crm.type.list',
            params: {
              filter: {
                '0': {
                  logic: 'OR',
                  '0': {
                    '%title': '5',
                  },
                  '1': {
                    '%title': '0',
                  },
                },
              },
              order: {
                id: 'DESC',
              },
              start: 0,
            },
            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('Smart process types:', result.types, 'Page size:', result.types.length)
        } catch (error) {
          // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
          console.error(error)
        }
      }
    
      document.addEventListener('DOMContentLoaded', listCrmTypes)
    </script>
    
    from b24pysdk.errors import BitrixAPIError, BitrixSDKException
    
    try:
        bitrix_response = client.crm.type.list(
            filter={
                "isAutomationEnabled": "Y",
                "isBizProcEnabled": "Y",
                "isCategoriesEnabled": "Y",
                "isClientEnabled": "Y",
            },
        ).response
        result = bitrix_response.result
        print(result)
    except BitrixAPIError as error:
        print(
            "Ошибка Bitrix API",
            f"error: {error.error}",
            f"error_description: {error.error_description}",
            sep="\n",
        )
    except BitrixSDKException as error:
        print(f"Ошибка Bitrix SDK: {error.message}")
    except Exception as error:
        print(f"Непредвиденная ошибка: {error}")
    

    Пример as_list

    from b24pysdk.errors import BitrixAPIError, BitrixSDKException
    
    try:
        bitrix_response = client.crm.type.list(
            filter={
                "isAutomationEnabled": "Y",
                "isBizProcEnabled": "Y",
                "isCategoriesEnabled": "Y",
                "isClientEnabled": "Y",
            },
            order={
                "id": "ASC",
            },
        ).as_list().response
        result = bitrix_response.result
        for item in result:
            print(item)
    except BitrixAPIError as error:
        print(
            "Ошибка Bitrix API",
            f"error: {error.error}",
            f"error_description: {error.error_description}",
            sep="\n",
        )
    except BitrixSDKException as error:
        print(f"Ошибка Bitrix SDK: {error.message}")
    except Exception as error:
        print(f"Непредвиденная ошибка: {error}")
    

    Пример as_list_fast

    from b24pysdk.errors import BitrixAPIError, BitrixSDKException
    
    try:
        bitrix_response = client.crm.type.list(
            filter={
                "isAutomationEnabled": "Y",
                "isBizProcEnabled": "Y",
                "isCategoriesEnabled": "Y",
                "isClientEnabled": "Y",
            },
            order={
                "id": "ASC",
            },
        ).as_list_fast(descending=True).response
        result = bitrix_response.result
        for item in result:
            print(item)
    except BitrixAPIError as error:
        print(
            "Ошибка Bitrix API",
            f"error: {error.error}",
            f"error_description: {error.error_description}",
            sep="\n",
        )
    except BitrixSDKException as error:
        print(f"Ошибка Bitrix SDK: {error.message}")
    except Exception as error:
        print(f"Непредвиденная ошибка: {error}")
    
    require_once('crest.php');
    
    $result = CRest::call(
        'crm.type.list',
        [
            'filter' => [
                [
                    'logic' => 'OR',
                    [
                        '%title' => '5',
                    ],
                    [
                        '%title' => '0',
                    ],
                ],
            ],
            'order' => [
                'id' => 'DESC',
            ],
        ]
    );
    
    echo '<PRE>';
    print_r($result);
    echo '</PRE>';
    
  2. Получить список смарт-процессов, у которых:

    • Включены роботы и триггеры (isAutomationEnabled)
    • Включен дизайнер бизнес процессов (isBizProcEnabled)
    • Включены свои воронки и туннели продаж (isCategoriesEnabled)
    • Включены свои стадии и канбан (isClientEnabled)
    curl -X POST \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"filter":{"isAutomationEnabled":"Y","isBizProcEnabled":"Y","isCategoriesEnabled":"Y","isClientEnabled":"Y"}}' \
    https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.type.list
    
    curl -X POST \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"filter":{"isAutomationEnabled":"Y","isBizProcEnabled":"Y","isCategoriesEnabled":"Y","isClientEnabled":"Y"},"auth":"**put_access_token_here**"}' \
    https://**put_your_bitrix24_address**/rest/crm.type.list
    
    // 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, ISODate } from '@bitrix24/b24jssdk'
    
    declare const $b24: B24Frame
    
    type CrmTypeItem = {
      id: number
      title: string
      code: string
      createdBy: number
      entityTypeId: number
      customSectionId: number | null
      isCategoriesEnabled: string
      isStagesEnabled: string
      isBeginCloseDatesEnabled: string
      isClientEnabled: string
      isUseInUserfieldEnabled: string
      isLinkWithProductsEnabled: string
      isMycompanyEnabled: string
      isDocumentsEnabled: string
      isSourceEnabled: string
      isObserversEnabled: string
      isRecyclebinEnabled: string
      isAutomationEnabled: string
      isBizProcEnabled: string
      isSetOpenPermissions: string
      isPaymentsEnabled: string
      isCountersEnabled: string
      createdTime: ISODate
      updatedTime: ISODate
      updatedBy: number
    }
    
    // Shape of the payload returned in result (match the "response handling" section of the page)
    type CrmTypeListResult = {
      types: CrmTypeItem[]
    }
    
    try {
      // crm.type.list returns a single page (max 50 records). For the whole result set
      // use a list helper: $b24.actions.v2.callList.make() returns every record as one
      // array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
      // NOTE: the list helpers do not accept `order` (it is excluded from their params, so
      // passing it is a TS error) — keep this call.make + `start` variant when sort matters.
      const response = await $b24.actions.v2.call.make<CrmTypeListResult>({
        method: 'crm.type.list',
        params: {
          filter: {
            isAutomationEnabled: 'Y',
            isBizProcEnabled: 'Y',
            isCategoriesEnabled: 'Y',
            isClientEnabled: 'Y',
          },
          start: 0,
        },
        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('Smart process types:', result.types, 'Page size:', result.types.length)
      }
    } 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 listCrmTypes() {
        try {
          // Initialize the SDK inside a Bitrix24 frame
          const $b24 = await B24Js.initializeB24Frame()
    
          // crm.type.list returns a single page (max 50 records). For the whole result set
          // use a list helper: $b24.actions.v2.callList.make() returns every record as one
          // array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
          // NOTE: the list helpers do not accept `order` (it is excluded from their params, so
          // passing it is a TS error) — keep this call.make + `start` variant when sort matters.
          const response = await $b24.actions.v2.call.make({
            method: 'crm.type.list',
            params: {
              filter: {
                isAutomationEnabled: 'Y',
                isBizProcEnabled: 'Y',
                isCategoriesEnabled: 'Y',
                isClientEnabled: 'Y',
              },
              start: 0,
            },
            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('Smart process types:', result.types, 'Page size:', result.types.length)
        } catch (error) {
          // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
          console.error(error)
        }
      }
    
      document.addEventListener('DOMContentLoaded', listCrmTypes)
    </script>
    
    from b24pysdk.errors import BitrixAPIError, BitrixSDKException
    
    try:
        bitrix_response = client.crm.type.list(
            filter={
                "isAutomationEnabled": "Y",
                "isBizProcEnabled": "Y",
                "isCategoriesEnabled": "Y",
                "isClientEnabled": "Y",
            },
        ).response
        result = bitrix_response.result
        print(result)
    except BitrixAPIError as error:
        print(
            "Ошибка Bitrix API",
            f"error: {error.error}",
            f"error_description: {error.error_description}",
            sep="\n",
        )
    except BitrixSDKException as error:
        print(f"Ошибка Bitrix SDK: {error.message}")
    except Exception as error:
        print(f"Непредвиденная ошибка: {error}")
    

    Пример as_list

    from b24pysdk.errors import BitrixAPIError, BitrixSDKException
    
    try:
        bitrix_response = client.crm.type.list(
            filter={
                "isAutomationEnabled": "Y",
                "isBizProcEnabled": "Y",
                "isCategoriesEnabled": "Y",
                "isClientEnabled": "Y",
            },
        ).as_list().response
        result = bitrix_response.result
        for item in result:
            print(item)
    except BitrixAPIError as error:
        print(
            "Ошибка Bitrix API",
            f"error: {error.error}",
            f"error_description: {error.error_description}",
            sep="\n",
        )
    except BitrixSDKException as error:
        print(f"Ошибка Bitrix SDK: {error.message}")
    except Exception as error:
        print(f"Непредвиденная ошибка: {error}")
    

    Пример as_list_fast

    from b24pysdk.errors import BitrixAPIError, BitrixSDKException
    
    try:
        bitrix_response = client.crm.type.list(
            filter={
                "isAutomationEnabled": "Y",
                "isBizProcEnabled": "Y",
                "isCategoriesEnabled": "Y",
                "isClientEnabled": "Y",
            },
        ).as_list_fast(descending=True).response
        result = bitrix_response.result
        for item in result:
            print(item)
    except BitrixAPIError as error:
        print(
            "Ошибка Bitrix API",
            f"error: {error.error}",
            f"error_description: {error.error_description}",
            sep="\n",
        )
    except BitrixSDKException as error:
        print(f"Ошибка Bitrix SDK: {error.message}")
    except Exception as error:
        print(f"Непредвиденная ошибка: {error}")
    
    require_once('crest.php');
    
    $result = CRest::call(
        'crm.type.list',
        [
            'filter' => [
                'isAutomationEnabled' => 'Y',
                'isBizProcEnabled' => 'Y',
                'isCategoriesEnabled' => 'Y',
                'isClientEnabled' => 'Y',
            ]
        ]
    );
    
    echo '<PRE>';
    print_r($result);
    echo '</PRE>';
    
    // client и ctx уже созданы — см. раздел «SDK для Go»
    res, err := client.Core().Call(ctx, "crm.type.list", b24.Params{
    	"filter": b24.Params{
    		"isAutomationEnabled": "Y",
    		"isBizProcEnabled":    "Y",
    		"isCategoriesEnabled": "Y",
    		"isClientEnabled":     "Y",
    	},
    }, b24.WithIdempotent())
    if err != nil {
    	return fmt.Errorf("crm.type.list: %w", err)
    }
    
    // Метод заворачивает ответ в объект с ключом "types".
    raw, ok := b24.Unwrap(res.Result, "types")
    if !ok {
    	return fmt.Errorf("в ответе нет ключа types")
    }
    
    var items []struct {
    	ID                  b24.ID `json:"id"`
    	Title               string `json:"title"`
    	Code                string `json:"code"`
    	CreatedBy           int    `json:"createdBy"`
    	EntityTypeID        b24.ID `json:"entityTypeId"`
    	IsCategoriesEnabled string `json:"isCategoriesEnabled"`
    }
    if err := json.Unmarshal(raw, &items); err != nil {
    	return fmt.Errorf("разбор ответа: %w", err)
    }
    for _, it := range items {
    	fmt.Println(it.ID)
    }
    

Обработка ответа

HTTP-статус: 200

{
    "result": {
        "types": [
            {
                "id": 37,
                "title": "Смарт-процесс #20",
                "code": "",
                "createdBy": 1,
                "entityTypeId": 1256,
                "customSectionId": null,
                "isCategoriesEnabled": "Y",
                "isStagesEnabled": "N",
                "isBeginCloseDatesEnabled": "Y",
                "isClientEnabled": "Y",
                "isUseInUserfieldEnabled": "Y",
                "isLinkWithProductsEnabled": "N",
                "isMycompanyEnabled": "Y",
                "isDocumentsEnabled": "Y",
                "isSourceEnabled": "Y",
                "isObserversEnabled": "Y",
                "isRecyclebinEnabled": "Y",
                "isAutomationEnabled": "Y",
                "isBizProcEnabled": "N",
                "isSetOpenPermissions": "N",
                "isPaymentsEnabled": "N",
                "isCountersEnabled": "N",
                "createdTime": "2024-07-08T17:24:55+02:00",
                "updatedTime": "2024-07-08T17:24:55+02:00",
                "updatedBy": 1
            },
            {
                "id": 32,
                "title": "Смарт-процесс #15",
                "code": "",
                "createdBy": 1,
                "entityTypeId": 1246,
                "customSectionId": null,
                "isCategoriesEnabled": "N",
                "isStagesEnabled": "Y",
                "isBeginCloseDatesEnabled": "N",
                "isClientEnabled": "Y",
                "isUseInUserfieldEnabled": "Y",
                "isLinkWithProductsEnabled": "Y",
                "isMycompanyEnabled": "N",
                "isDocumentsEnabled": "N",
                "isSourceEnabled": "N",
                "isObserversEnabled": "N",
                "isRecyclebinEnabled": "N",
                "isAutomationEnabled": "N",
                "isBizProcEnabled": "Y",
                "isSetOpenPermissions": "Y",
                "isPaymentsEnabled": "N",
                "isCountersEnabled": "N",
                "createdTime": "2024-07-08T17:24:52+02:00",
                "updatedTime": "2024-07-08T17:24:52+02:00",
                "updatedBy": 1
            },
            {
                "id": 27,
                "title": "Смарт-процесс #10",
                "code": "",
                "createdBy": 1,
                "entityTypeId": 1236,
                "customSectionId": null,
                "isCategoriesEnabled": "N",
                "isStagesEnabled": "Y",
                "isBeginCloseDatesEnabled": "Y",
                "isClientEnabled": "Y",
                "isUseInUserfieldEnabled": "N",
                "isLinkWithProductsEnabled": "N",
                "isMycompanyEnabled": "Y",
                "isDocumentsEnabled": "N",
                "isSourceEnabled": "Y",
                "isObserversEnabled": "N",
                "isRecyclebinEnabled": "N",
                "isAutomationEnabled": "Y",
                "isBizProcEnabled": "Y",
                "isSetOpenPermissions": "Y",
                "isPaymentsEnabled": "N",
                "isCountersEnabled": "N",
                "createdTime": "2024-07-08T17:24:50+02:00",
                "updatedTime": "2024-07-08T17:24:50+02:00",
                "updatedBy": 1
            },
            {
                "id": 22,
                "title": "Смарт-процесс #5",
                "code": "",
                "createdBy": 1,
                "entityTypeId": 1226,
                "customSectionId": null,
                "isCategoriesEnabled": "Y",
                "isStagesEnabled": "N",
                "isBeginCloseDatesEnabled": "N",
                "isClientEnabled": "N",
                "isUseInUserfieldEnabled": "Y",
                "isLinkWithProductsEnabled": "Y",
                "isMycompanyEnabled": "N",
                "isDocumentsEnabled": "N",
                "isSourceEnabled": "Y",
                "isObserversEnabled": "Y",
                "isRecyclebinEnabled": "Y",
                "isAutomationEnabled": "N",
                "isBizProcEnabled": "Y",
                "isSetOpenPermissions": "Y",
                "isPaymentsEnabled": "N",
                "isCountersEnabled": "N",
                "createdTime": "2024-07-08T17:24:48+02:00",
                "updatedTime": "2024-07-08T17:24:48+02:00",
                "updatedBy": 1
            }
        ]
    },
    "time": {
        "start": 1720516793.835427,
        "finish": 1720516794.697913,
        "duration": 0.8624858856201172,
        "processing": 0.07323503494262695,
        "date_start": "2024-07-09T11:19:53+02:00",
        "date_finish": "2024-07-09T11:19:54+02:00",
        "operating": 0
    },
    "total": 4
}

Возвращаемые данные

Название
тип

Описание

result
object

Корневой элемент ответа. Содержит единственный ключ types

types
type[]

Список смарт-процессов, каждый из которых соответствует структуре объекта type

time
time

Информация о времени выполнения запроса

total
integer

Общее количество найденных записей

Обработка ошибок

HTTP-статус: 400

{
    "error": "ACCESS_DENIED",
    "error_description": "Доступ запрещен"
}

Название
тип

Описание

error
string

Строковый код ошибки. Состоит из цифр, латинских букв и знака подчеркивания. Может прийти пустым — тогда причину показывает только error_description

error_description
string

Текст ошибки для разработчика. Не показывайте его конечному пользователю без обработки

Возможные коды ошибок

Статус

Код

Описание

Значение

403

allowed_only_intranet_user

Действие разрешено только интранет-пользователям

Возникает, если пользователь не является интранет-пользователем

400

ACCESS_DENIED

Доступ запрещен

Возникает, если у пользователя нет административных прав CRM

400

INVALID_ARG_VALUE

Invalid filter: field 'field_n' is not allowed in filter

Возникает, при передаче отсутствующего в смарт-процессе поля field_n в параметр filter

400

INVALID_ARG_VALUE

Invalid filter: field 'field_n' has invalid value

Возникает, при передаче некорректного value_n для поля field_n в параметр filter

400

INVALID_ARG_VALUE

Invalid order: field 'field_n' is not allowed in order

Возникает, при передаче отсутствующего в смарт-процессе поля field_n в параметр order

400

INVALID_ARG_VALUE

Invalid order: allowed sort directions are ASC, DESC. But got 'invalid_value' for field 'field_n'

Возникает, при передаче некорректного value_n для поля field_n в параметр order

Статусы и коды системных ошибок

HTTP-статус: 4xx, 5xx

Описанные ниже ошибки возвращает сам REST API, а не логика конкретного метода. Они могут прийти в ответ на любой метод.

Статус

Код
Текст ошибки

Описание

500

INTERNAL_SERVER_ERROR
Internal server error

Возникла внутренняя ошибка сервера. Повторите вызов, а если ошибка сохраняется, обратитесь к администратору сервера или в техническую поддержку Битрикс24

500

ERROR_UNEXPECTED_ANSWER
Server returned an unexpected response

Сервер вернул неожиданный ответ. Повторите вызов, а если ошибка сохраняется, обратитесь к администратору сервера или в техническую поддержку Битрикс24

503

QUERY_LIMIT_EXCEEDED
Too many requests

Превышен лимит на интенсивность запросов

429

OPERATION_TIME_LIMIT
Method is blocked due to operation time limit

Метод заблокирован из-за превышения лимита на ресурсоемкость запросов. Блокировка снимается автоматически, когда накопленное время выполнения метода перестает превышать лимит

401

NO_AUTH_FOUND
Wrong authorization data

В запросе нет авторизационных данных: не передан ни access-токен, ни код вебхука

401

INVALID_REQUEST
Https required

Методы вызываются только по протоколу HTTPS

401

OVERLOAD_LIMIT
REST API is blocked due to overload

REST API заблокирован из-за перегрузки. Это ручная индивидуальная блокировка. Чтобы ее снять, обратитесь в техническую поддержку Битрикс24

401

ACCESS_DENIED
REST is available only on commercial plans

REST API доступен только на коммерческих тарифах. У вебхука текст ошибки другой — REST is available only by subscription

401

INVALID_CREDENTIALS
Invalid request credentials

Не найден активный вебхук с указанным идентификатором пользователя и секретным кодом

404

ERROR_METHOD_NOT_FOUND
Method not found!

Метод с таким именем не найден. Имя написано с ошибкой, метода нет в REST API или он недоступен без нужного скоупа

401

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

Запрос требует более широких прав, чем есть у токена: у вебхука это выданные ему права, у приложения — скоуп. У приложения текст ошибки заканчивается на provided by the access token

401

expired_token
The access token provided has expired

Срок действия access-токена истек

401

user_access_error
The user does not have access to the application

Приложение установлено, но администратор Битрикс24 открыл доступ к нему только конкретным пользователям

403

PORTAL_DELETED
Portal was deleted

Публичная часть сайта закрыта. Чтобы открыть ее на коробочной установке, отключите опцию «Временное закрытие публичной части сайта». Путь к настройке: Рабочий стол > Настройки > Настройки продукта > Настройки модулей > Главный модуль > Временное закрытие публичной части сайта

Продолжите изучение