Importing a Batch of CRM Records: crm.item.batchImport

If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.

Scope: crm

Who can execute the method: any user with the "import" access permission for the CRM entity

This is a universal method for importing objects into CRM. The differences from adding an object are described in more detail here.

The logic for adding entities is similar to the crm.item.import method.

Attention!

A maximum of 20 entities can be imported in a single request.

Method Parameters

Required parameters are marked with *

Name
type

Description

entityTypeId*
integer

Identifier of the system or custom type for which the entity needs to be created.

Numerical values for system types (Lead — 1, Deal — 2, Contact — 3, Company — 4, Invoice — 31, etc.) are provided in the CRM object types reference. The identifier for the SPA can be obtained using the crm.type.list method.

data*
array

An array of field values for the entities. It can be viewed as an array where each element contains a set of fields, as described in the crm.item.import method.

useOriginalUfNames
boolean

A parameter to control the format of custom field names in the request and response.
Possible values:

  • Y — original names of custom fields, e.g., UF_CRM_2_1639669411830
  • N — custom field names in camelCase, e.g., ufCrm2_1639669411830

Default is N.

Code Examples

How to Use Examples in Documentation

  1. How to Import Deals

    curl -X POST \
            -H "Content-Type: application/json" \
            -H "Accept: application/json" \
            -d '{"entityTypeId":2,"data":[{"title":"New Deal (example for REST methods)","typeId":"SERVICE","categoryId":9,"stageId":"C9:UC_KN8KFI","isReccurring":"Y","probability":50,"currencyId":"USD","isManualOpportunity":"Y","opportunity":999.99,"taxValue":99.9,"companyId":5,"contactId":4,"contactIds":[4,5],"quoteId":7,"begindate":"formatDate(monthAgo)","closedate":"formatDate(twelveDaysInAdvance)","opened":"N","comments":"commentsExample","assignedById":6,"sourceId":"WEB","sourceDescription":"Additional description about the source","leadId":102,"additionalInfo":"Additional information","observers":[2,3],"utmSource":"google","utmMedium":"CPC","ufCrm_1721244707107":1111.1,"parentId1220":2},{"title":"New Deal (example for REST methods)","typeId":"SERVICE","categoryId":4,"stageId":"C9:UC_KN8KFI","isReccurring":"Y","probability":50,"currencyId":"USD","isManualOpportunity":"Y","opportunity":999.99,"taxValue":99.9,"companyId":5,"contactId":4,"contactIds":[4,5],"quoteId":7,"begindate":"formatDate(monthAgo)","closedate":"formatDate(twelveDaysInAdvance)","opened":"N","comments":"commentsExample","assignedById":6,"sourceId":"WEB","sourceDescription":"Additional description about the source","leadId":102,"additionalInfo":"Additional information","observers":[2,3],"utmSource":"google","utmMedium":"CPC","ufCrm_1721244707107":1111.1,"parentId1220":2}]}' \
            https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.item.batchImport
            
    curl -X POST \
            -H "Content-Type: application/json" \
            -H "Accept: application/json" \
            -d '{"entityTypeId":2,"data":[{"title":"New Deal (example for REST methods)","typeId":"SERVICE","categoryId":9,"stageId":"C9:UC_KN8KFI","isReccurring":"Y","probability":50,"currencyId":"USD","isManualOpportunity":"Y","opportunity":999.99,"taxValue":99.9,"companyId":5,"contactId":4,"contactIds":[4,5],"quoteId":7,"begindate":"formatDate(monthAgo)","closedate":"formatDate(twelveDaysInAdvance)","opened":"N","comments":"commentsExample","assignedById":6,"sourceId":"WEB","sourceDescription":"Additional description about the source","leadId":102,"additionalInfo":"Additional information","observers":[2,3],"utmSource":"google","utmMedium":"CPC","ufCrm_1721244707107":1111.1,"parentId1220":2},{"title":"New Deal (example for REST methods)","typeId":"SERVICE","categoryId":4,"stageId":"C9:UC_KN8KFI","isReccurring":"Y","probability":50,"currencyId":"USD","isManualOpportunity":"Y","opportunity":999.99,"taxValue":99.9,"companyId":5,"contactId":4,"contactIds":[4,5],"quoteId":7,"begindate":"formatDate(monthAgo)","closedate":"formatDate(twelveDaysInAdvance)","opened":"N","comments":"commentsExample","assignedById":6,"sourceId":"WEB","sourceDescription":"Additional description about the source","leadId":102,"additionalInfo":"Additional information","observers":[2,3],"utmSource":"google","utmMedium":"CPC","ufCrm_1721244707107":1111.1,"parentId1220":2}],"auth":"**put_access_token_here**"}' \
            https://**put_your_bitrix24_address**/rest/crm.item.batchImport
            
    const formatDate = (date) => {
                return date.toISOString().slice(0, 10);
            };
            
            const day = 60 * 60 * 24 * 1000;
            
            const now = new Date();
            const twelveDaysInAdvance = new Date(now.getTime() + 12 * day);
            const monthAgo = new Date(now.getTime() - 30 * day);
            
            const commentsExample = `
            Example comment within the deal
            
            [B]Bold text[/B]
            [I]Italic[/I]
            [U]Underlined[/U]
            [S]Strikethrough[/S]
            [B][I][U][S]Mix[/S][/U][/I][/B]
            
            [LIST]
            [*]List item #1
            [*]List item #2
            [*]List item #3
            [/LIST]
            
            [LIST=1]
            [*]Numbered list item #1
            [*]Numbered list item #2
            [*]Numbered list item #3
            [/LIST]
            `;
            
            const deal = {
                title: "New Deal (example for REST methods)",
                typeId: "SERVICE",
                categoryId: 9,
                stageId: "C9:UC_KN8KFI",
                isReccurring: "Y",
                probability: 50,
                currencyId: "USD",
                isManualOpportunity: "Y",
                opportunity: 999.99,
                taxValue: 99.9,
                companyId: 5,
                contactId: 4,
                contactIds: [4, 5],
                quoteId: 7,
                begindate: formatDate(monthAgo),
                closedate: formatDate(twelveDaysInAdvance),
                opened: "N",
                comments: commentsExample,
                assignedById: 6,
                sourceId: "WEB",
                sourceDescription: "Additional description about the source",
                leadId: 102,
                additionalInfo: "Additional information",
                observers: [2, 3],
                utmSource: "google",
                utmMedium: "CPC",
                ufCrm_1721244707107: 1111.1,
                parentId1220: 2,
            };
            
            const secondDeal = {
                title: "New Deal (example for REST methods)",
                typeId: "SERVICE",
                categoryId: 4,
                stageId: "C9:UC_KN8KFI",
                isReccurring: "Y",
                probability: 50,
                currencyId: "USD",
                isManualOpportunity: "Y",
                opportunity: 999.99,
                taxValue: 99.9,
                companyId: 5,
                contactId: 4,
                contactIds: [4, 5],
                quoteId: 7,
                begindate: formatDate(monthAgo),
                closedate: formatDate(twelveDaysInAdvance),
                opened: "N",
                comments: commentsExample,
                assignedById: 6,
                sourceId: "WEB",
                sourceDescription: "Additional description about the source",
                leadId: 102,
                additionalInfo: "Additional information",
                observers: [2, 3],
                utmSource: "google",
                utmMedium: "CPC",
                ufCrm_1721244707107: 1111.1,
                parentId1220: 2,
            };
            
            BX24.callMethod(
                'crm.item.batchImport', 
                {
                    entityTypeId: 2,
                    data: [
                        deal,
                        secondDeal
                    ]
                },
                (result) => 
                {
                    result.error() 
                        ? console.error(result.error()) 
                        : console.info(result.data())
                    ;
                }
            );
            
    require_once('crest.php');
            
            $deal = [
                'title' => "New Deal (example for REST methods)",
                'typeId' => "SERVICE",
                'categoryId' => 9,
                'stageId' => "C9:UC_KN8KFI",
                'isReccurring' => "Y",
                'probability' => 50,
                'currencyId' => "USD",
                'isManualOpportunity' => "Y",
                'opportunity' => 999.99,
                'taxValue' => 99.9,
                'companyId' => 5,
                'contactId' => 4,
                'contactIds' => [4, 5],
                'quoteId' => 7,
                'begindate' => formatDate(monthAgo),
                'closedate' => formatDate(twelveDaysInAdvance),
                'opened' => "N",
                'comments' => $commentsExample,
                'assignedById' => 6,
                'sourceId' => "WEB",
                'sourceDescription' => "Additional description about the source",
                'leadId' => 102,
                'additionalInfo' => "Additional information",
                'observers' => [2, 3],
                'utmSource' => "google",
                'utmMedium' => "CPC",
                'ufCrm_1721244707107' => 1111.1,
                'parentId1220' => 2
            ];
            
            $secondDeal = [
                'title' => "New Deal (example for REST methods)",
                'typeId' => "SERVICE",
                'categoryId' => 4,
                'stageId' => "C9:UC_KN8KFI",
                'isReccurring' => "Y",
                'probability' => 50,
                'currencyId' => "USD",
                'isManualOpportunity' => "Y",
                'opportunity' => 999.99,
                'taxValue' => 99.9,
                'companyId' => 5,
                'contactId' => 4,
                'contactIds' => [4, 5],
                'quoteId' => 7,
                'begindate' => formatDate(monthAgo),
                'closedate' => formatDate(twelveDaysInAdvance),
                'opened' => "N",
                'comments' => $commentsExample,
                'assignedById' => 6,
                'sourceId' => "WEB",
                'sourceDescription' => "Additional description about the source",
                'leadId' => 102,
                'additionalInfo' => "Additional information",
                'observers' => [2, 3],
                'utmSource' => "google",
                'utmMedium' => "CPC",
                'ufCrm_1721244707107' => 1111.1,
                'parentId1220' => 2
            ];
            
            $result = CRest::call(
                'crm.item.batchImport',
                [
                    'entityTypeId' => 2,
                    'data' => [
                            $deal,
                            $secondDeal,
                        ],
                ],
            );
            
            echo '<PRE>';
            print_r($result);
            echo '</PRE>';
            
  2. How to Create an SPA Element with a Set of Custom Fields

    Custom Fields Used in the Example
    {
                "ufCrm44_1721812760630": {
                    "type": "string",
                    "isRequired": false,
                    "isReadOnly": false,
                    "isImmutable": false,
                    "isMultiple": false,
                    "isDynamic": true,
                    "title": "Custom field (string)",
                    "listLabel": "Custom field (string)",
                    "formLabel": "Custom field (string)",
                    "filterLabel": "Custom field (string)",
                    "settings": {
                        "SIZE": 20,
                        "ROWS": 1,
                        "REGEXP": "",
                        "MIN_LENGTH": 0,
                        "MAX_LENGTH": 0,
                        "DEFAULT_VALUE": ""
                    },
                    "upperName": "UF_CRM_44_1721812760630"
                },
                "ufCrm44_1721812814433": {
                    "type": "enumeration",
                    "isRequired": false,
                    "isReadOnly": false,
                    "isImmutable": false,
                    "isMultiple": false,
                    "isDynamic": true,
                    "items": [
                        {
                            "ID": "79",
                            "VALUE": "List item #1"
                        },
                        {
                            "ID": "80",
                            "VALUE": "List item #2"
                        },
                        {
                            "ID": "81",
                            "VALUE": "List item #3"
                        },
                        {
                            "ID": "82",
                            "VALUE": "List item #4"
                        }
                    ],
                    "title": "Custom field (list)",
                    "listLabel": "Custom field (list)",
                    "formLabel": "Custom field (list)",
                    "filterLabel": "Custom field (list)",
                    "settings": {
                        "DISPLAY": "LIST",
                        "LIST_HEIGHT": 1,
                        "CAPTION_NO_VALUE": "",
                        "SHOW_NO_VALUE": "Y"
                    },
                    "upperName": "UF_CRM_44_1721812814433"
                },
                "ufCrm44_1721812853419": {
                    "type": "date",
                    "isRequired": false,
                    "isReadOnly": false,
                    "isImmutable": false,
                    "isMultiple": false,
                    "isDynamic": true,
                    "title": "Custom field (date)",
                    "listLabel": "Custom field (date)",
                    "formLabel": "Custom field (date)",
                    "filterLabel": "Custom field (date)",
                    "settings": {
                        "DEFAULT_VALUE": {
                            "TYPE": "NONE",
                            "VALUE": ""
                        }
                    },
                    "upperName": "UF_CRM_44_1721812853419"
                },
                "ufCrm44_1721812885588": {
                    "type": "url",
                    "isRequired": false,
                    "isReadOnly": false,
                    "isImmutable": false,
                    "isMultiple": true,
                    "isDynamic": true,
                    "title": "Multiple custom field (link)",
                    "listLabel": "Multiple custom field (link)",
                    "formLabel": "Multiple custom field (link)",
                    "filterLabel": "Multiple custom field (link)",
                    "settings": {
                        "POPUP": "Y",
                        "SIZE": 20,
                        "MIN_LENGTH": 0,
                        "MAX_LENGTH": 0,
                        "DEFAULT_VALUE": "",
                        "ROWS": 1
                    },
                    "upperName": "UF_CRM_44_1721812885588"
                },
                "ufCrm44_1721812898903": {
                    "type": "file",
                    "isRequired": false,
                    "isReadOnly": false,
                    "isImmutable": false,
                    "isMultiple": false,
                    "isDynamic": true,
                    "title": "Custom field (file)",
                    "listLabel": "Custom field (file)",
                    "formLabel": "Custom field (file)",
                    "filterLabel": "Custom field (file)",
                    "settings": {
                        "SIZE": 20,
                        "LIST_WIDTH": 0,
                        "LIST_HEIGHT": 0,
                        "MAX_SHOW_SIZE": 0,
                        "MAX_ALLOWED_SIZE": 0,
                        "EXTENSIONS": [],
                        "TARGET_BLANK": "Y"
                    },
                    "upperName": "UF_CRM_44_1721812898903"
                },
                "ufCrm44_1721812915476": {
                    "type": "money",
                    "isRequired": false,
                    "isReadOnly": false,
                    "isImmutable": false,
                    "isMultiple": false,
                    "isDynamic": true,
                    "title": "Custom field (money)",
                    "listLabel": "Custom field (money)",
                    "formLabel": "Custom field (money)",
                    "filterLabel": "Custom field (money)",
                    "settings": {
                        "DEFAULT_VALUE": ""
                    },
                    "upperName": "UF_CRM_44_1721812915476"
                },
                "ufCrm44_1721812935209": {
                    "type": "boolean",
                    "isRequired": false,
                    "isReadOnly": false,
                    "isImmutable": false,
                    "isMultiple": false,
                    "isDynamic": true,
                    "title": "Custom field (Yes/No)",
                    "listLabel": "Custom field (Yes/No)",
                    "formLabel": "Custom field (Yes/No)",
                    "filterLabel": "Custom field (Yes/No)",
                    "settings": {
                        "DEFAULT_VALUE": 0,
                        "DISPLAY": "CHECKBOX",
                        "LABEL": [
                            "",
                            ""
                        ],
                        "LABEL_CHECKBOX": {
                            "en": "Custom field (Yes/No)",
                            "ru": "Custom field (Yes/No)",
                            "th": "Custom field (Yes/No)",
                            "la": "Custom field (Yes/No)",
                            "tc": "Custom field (Yes/No)",
                            "sc": "Custom field (Yes/No)",
                            "br": "Custom field (Yes/No)",
                            "ar": "Custom field (Yes/No)",
                            "fr": "Custom field (Yes/No)",
                            "vn": "Custom field (Yes/No)",
                            "pl": "Custom field (Yes/No)",
                            "tr": "Custom field (Yes/No)",
                            "ja": "Custom field (Yes/No)",
                            "it": "Custom field (Yes/No)",
                            "ms": "Custom field (Yes/No)",
                            "id": "Custom field (Yes/No)"
                        }
                    },
                    "upperName": "UF_CRM_44_1721812935209"
                },
                "ufCrm44_1721812948498": {
                    "type": "double",
                    "isRequired": false,
                    "isReadOnly": false,
                    "isImmutable": false,
                    "isMultiple": false,
                    "isDynamic": true,
                    "title": "Custom field (number)",
                    "listLabel": "Custom field (number)",
                    "formLabel": "Custom field (number)",
                    "filterLabel": "Custom field (number)",
                    "settings": {
                        "PRECISION": 2,
                        "SIZE": 20,
                        "MIN_VALUE": 0,
                        "MAX_VALUE": 0,
                        "DEFAULT_VALUE": null
                    },
                    "upperName": "UF_CRM_44_1721812948498"
                }
            }
            
    curl -X POST \
            -H "Content-Type: application/json" \
            -H "Accept: application/json" \
            -d '{
                "entityTypeId": 1302,
                "data": [{
                    "ufCrm44_1721812760630": "String for custom field of type String",
                    "ufCrm44_1721812814433": 81,
                    "ufCrm44_1721812853419": "'"$(date '+%Y-%m-%d')"'",
                    "ufCrm44_1721812885588": [
                        "example.com",
                        "second-example.com"
                    ],
                    "ufCrm44_1721812898903": [
                        "green_pixel.png",
                        "iVBORw0KGgoAAAANSUhEUgAAAIAAAAAMCAYAAACqTLVoAAAALklEQVR42u3SAQEAAAQDsEsuOj3YMqwy6fBWCSCAAAIgAAIgAAIgAAIgAAJw3QLOrRH1U/gU4gAAAABJRU5ErkJggg=="
                    ],
                    "ufCrm44_1721812915476": "300|USD",
                    "ufCrm44_1721812935209": "Y",
                    "ufCrm44_1721812948498": 9999.9
                },{
                    "ufCrm44_1721812760630": "String for custom field of type String",
                    "ufCrm44_1721812814433": 45,
                    "ufCrm44_1721812853419": "'"$(date '+%Y-%m-%d')"'",
                    "ufCrm44_1721812885588": [
                        "example.com",
                        "second-example.com"
                    ],
                    "ufCrm44_1721812898903": [
                        "green_pixel2.png",
                        "iVBORw0KGgoAAAANSUhEUgAAAIAAAAAMCAYAAACqTLVoAAAALklEQVR42u3SAQEAAAQDsEsuOj3YMqwy6fBWCSCAAAIgAAIgAAIgAAIgAAJw3QLOrRH1U/gU4gAAAABJRU5ErkJggg=="
                    ],
                    "ufCrm44_1721812915476": "600|USD",
                    "ufCrm44_1721812935209": "N",
                    "ufCrm44_1721812948498": 9999.9
                }]
            }' \
            https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.item.batchImport
            
    curl -X POST \
            -H "Content-Type: application/json" \
            -H "Accept: application/json" \
            -d '{
                "entityTypeId": 1302,
                "data": [{
                    "ufCrm44_1721812760630": "String for custom field of type String",
                    "ufCrm44_1721812814433": 81,
                    "ufCrm44_1721812853419": "'"$(date '+%Y-%m-%d')"'",
                    "ufCrm44_1721812885588": [
                        "example.com",
                        "second-example.com"
                    ],
                    "ufCrm44_1721812898903": [
                        "green_pixel.png",
                        "iVBORw0KGgoAAAANSUhEUgAAAIAAAAAMCAYAAACqTLVoAAAALklEQVR42u3SAQEAAAQDsEsuOj3YMqwy6fBWCSCAAAIgAAIgAAIgAAIgAAJw3QLOrRH1U/gU4gAAAABJRU5ErkJggg=="
                    ],
                    "ufCrm44_1721812915476": "300|USD",
                    "ufCrm44_1721812935209": "Y",
                    "ufCrm44_1721812948498": 9999.9
                },{
                    "ufCrm44_1721812760630": "String for custom field of type String",
                    "ufCrm44_1721812814433": 45,
                    "ufCrm44_1721812853419": "'"$(date '+%Y-%m-%d')"'",
                    "ufCrm44_1721812885588": [
                        "example.com",
                        "second-example.com"
                    ],
                    "ufCrm44_1721812898903": [
                        "green_pixel2.png",
                        "iVBORw0KGgoAAAANSUhEUgAAAIAAAAAMCAYAAACqTLVoAAAALklEQVR42u3SAQEAAAQDsEsuOj3YMqwy6fBWCSCAAAIgAAIgAAIgAAIgAAJw3QLOrRH1U/gU4gAAAABJRU5ErkJggg=="
                    ],
                    "ufCrm44_1721812915476": "600|USD",
                    "ufCrm44_1721812935209": "N",
                    "ufCrm44_1721812948498": 9999.9
                }],
                "auth": "**put_access_token_here**"
            }' \
            https://**put_your_bitrix24_address**/rest/crm.item.batchImport
            
    const greenPixelInBase64 = "iVBORw0KGgoAAAANSUhEUgAAAIAAAAAMCAYAAACqTLVoAAAALklEQVR42u3SAQEAAAQDsEsuOj3YMqwy6fBWCSCAAAIgAAIgAAIgAAIgAAJw3QLOrRH1U/gU4gAAAABJRU5ErkJggg==";
            
            BX24.callMethod(
                'crm.item.batchImport', 
                {
                    entityTypeId: 1302,
                    data: [
                        {
                            ufCrm44_1721812760630: "String for custom field of type String",
                            ufCrm44_1721812814433: 81,
                            ufCrm44_1721812853419: (new Date()).toISOString().slice(0, 10),
                            ufCrm44_1721812885588: [
                                "example.com",
                                "second-example.com",
                            ],
                            ufCrm44_1721812898903: [
                                "green_pixel.png",
                                greenPixelInBase64,
                            ],
                            ufCrm44_1721812915476: "300|USD",
                            ufCrm44_1721812935209: "Y",
                            ufCrm44_1721812948498: 9999.9,
                        },
                        {
                            ufCrm44_1721812760630: "String for custom field of type String",
                            ufCrm44_1721812814433: 45,
                            ufCrm44_1721812853419: (new Date()).toISOString().slice(0, 10),
                            ufCrm44_1721812885588: [
                                "example.com",
                                "second-example.com",
                            ],
                            ufCrm44_1721812898903: [
                                "green_pixel2.png",
                                greenPixelInBase64,
                            ],
                            ufCrm44_1721812915476: "600|USD",
                            ufCrm44_1721812935209: "N",
                            ufCrm44_1721812948498: 9999.9,
                        }
                    ],
                },
                (result) => 
                {
                    result.error() 
                        ? console.error(result.error()) 
                        : console.info(result.data())
                    ;
                }
            );
            
    require_once('crest.php');
            
            $result = CRest::call(
                'crm.item.batchImport',
                [
                    'entityTypeId' => 1302,
                    'data' => [
                        [
                            'ufCrm44_1721812760630' => "String for custom field of type String",
                            'ufCrm44_1721812814433' => 81,
                            'ufCrm44_1721812853419' => date('Y-m-d'),
                            'ufCrm44_1721812885588' => [
                                "example.com",
                                "second-example.com",
                            ],
                            'ufCrm44_1721812898903' => [
                                "green_pixel.png",
                                "iVBORw0KGgoAAAANSUhEUgAAAIAAAAAMCAYAAACqTLVoAAAALklEQVR42u3SAQEAAAQDsEsuOj3YMqwy6fBWCSCAAAIgAAIgAAIgAAIgAAJw3QLOrRH1U/gU4gAAAABJRU5ErkJggg==",
                            ],
                            'ufCrm44_1721812915476' => "300|USD",
                            'ufCrm44_1721812935209' => "Y",
                            'ufCrm44_1721812948498' => 9999.9,
                        ],
                        [
                            'ufCrm44_1721812760630' => "String for custom field of type String",
                            'ufCrm44_1721812814433' => 45,
                            'ufCrm44_1721812853419' => date('Y-m-d'),
                            'ufCrm44_1721812885588' => [
                                "example.com",
                                "second-example.com",
                            ],
                            'ufCrm44_1721812898903' => [
                                "green_pixel2.png",
                                "iVBORw0KGgoAAAANSUhEUgAAAIAAAAAMCAYAAACqTLVoAAAALklEQVR42u3SAQEAAAQDsEsuOj3YMqwy6fBWCSCAAAIgAAIgAAIgAAIgAAJw3QLOrRH1U/gU4gAAAABJRU5ErkJggg==",
                            ],
                            'ufCrm44_1721812915476' => "600|USD",
                            'ufCrm44_1721812935209' => "N",
                            'ufCrm44_1721812948498' => 9999.9,
                        ],
                    ],
                ]
            );
            
            echo '<PRE>';
            print_r($result);
            echo '</PRE>';
            

Response Handling

The method will return an array items, containing objects where each object in this array will either contain the identifier of the created entity in case of success, or an error message object.

HTTP status: 200

{
            "result": {
                "items": [
                    {
                        "item": {
                            "id": 15
                        }
                    },
                    {
                        "error": "CRM_FIELD_ERROR_REQUIRED",
                        "error_description": "The field \"Title\" is required."
                    }
                ]
            },
            "time": {
                "start": 1723414961.913589,
                "finish": 1723414964.652124,
                "duration": 2.738534927368164,
                "processing": 2.376383066177368,
                "date_start": "2024-08-11T22:22:41+00:00",
                "date_finish": "2024-08-11T22:22:44+00:00",
                "operating": 2.3762991428375244
            }
        }
        

Returned Data

Name
type

Description

result
object

The root element of the response.

Contains a single key item

items
array

An array containing item objects or errors

item
object

Information about the created entity.

Contains a single key id

id
int

Identifier of the created entity

time
time

Information about the execution time of the request

By default, custom field names are passed and returned in camelCase, e.g., ufCrm2_1639669411830.
When the useOriginalUfNames parameter is passed with the value Y, custom fields will be returned with their original names, e.g., UF_CRM_2_1639669411830.

Error Handling

HTTP status: 401, 400, 403

{
            "error": "NOT_FOUND",
            "error_description": "SPA not found."
        }
        

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

Status

Code

Description

Value

400

NOT_FOUND

SPA not found.

Occurs when an invalid entityTypeId is passed.

400

ACCESS_DENIED

Access denied.

The user does not have permission to add entities of type entityTypeId.

400

CRM_FIELD_ERROR_VALUE_NOT_VALID

Invalid value for field "field".

An incorrect value for the field was passed.

For system fields of type createdTime, if the request is not from an administrator.

400

100

Expected iterable value for multiple field, but got type instead.

One of the multiple fields received a value of type type, while an iterable type was expected. This can also occur with an incorrect request (invalid JSON or request headers).

400

CREATE_DYNAMIC_ITEM_RESTRICTED

You cannot create a new entity due to your plan's restrictions.

The plan restrictions do not allow creating SPA entities.

400

MAX_IMPORT_BATCH_SIZE_EXCEEDED

You cannot import more than 20 entities.

Occurs when more than 20 entities are passed during import.

401

INVALID_CREDENTIALS

Invalid authorization data for the request.

Incorrect user ID and/or code in the request path.

403

allowed_only_intranet_user

Action allowed only for intranet users.

The user is not an intranet user.

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 permitted for calls 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 HTTPS protocol is required for method calls

503

OVERLOAD_LIMIT
REST API is blocked due to overload

The REST API is blocked due to overload. This is a manual individual block; please contact Bitrix24 technical support to lift it

403

ACCESS_DENIED
REST API is available only on commercial plans

The REST API is only available on commercial plans

403

INVALID_CREDENTIALS
Invalid request credentials

The user associated with the access token or webhook used to call the method lacks the necessary 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 portal administrator has restricted access to this application to specific users only

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 "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

How to Use Examples in Documentation

Continue Learning