Register an External Call in Bitrix24 telephony.externalCall.register

Scope: telephony

Who can execute the method: any user

The method telephony.externalCall.register registers an external call in Bitrix24.

To create a CRM activity for the call, you also need to call the method telephony.externalcall.finish.

The method works only in the context of an application.

Method Parameters

Required parameters are marked with *

Name
type

Description

USER_ID*
integer

The identifier of the user for whom the call is being registered.

The identifier can be obtained using the user.get method.

USER_PHONE_INNER*
string

The internal phone number of the user.

The internal number can be obtained using the user.get method.

At least one of the parameters must be specified: USER_ID or USER_PHONE_INNER.

PHONE_NUMBER*
string

The client's phone number.

TYPE*
integer

The type of call.

Possible values:

  • 1 — outgoing
  • 2 — incoming
  • 3 — incoming with redirection
  • 4 — callback
  • 5 — informational call.

CALL_START_DATE
string

The date and time the call started in ISO-8601 format with timezone indication, e.g., 2026-03-07T10:20:30+03:00.

Default — current server time.

CRM_CREATE
integer

Automatic creation of a CRM object if no suitable object is found by the number.

Possible values:

  • 0 — do not create
  • 1 — create

Default — 0.

CRM_SOURCE
string

The identifier of the CRM source (the value of the STATUS_ID field).

The list of values can be obtained using the crm.status.list method with the filter ENTITY_ID: 'SOURCE'.

CRM_ENTITY_TYPE
string

The type of CRM object to associate with the call.

Possible values:

  • CONTACT — contact
  • COMPANY — company
  • LEAD — lead.

CRM_ENTITY_ID
integer

The identifier of the CRM object from CRM_ENTITY_TYPE.

The identifier can be obtained using the following methods:

SHOW
integer

Show the call detail form after registration.

Possible values:

  • 0 — do not show
  • 1 — show

Default — 1.

ADD_TO_CHAT
integer

Add a message about the call to the employee's chat.

Possible values:

  • 0 — do not add
  • 1 — add

Default — 1.

CALL_LIST_ID
integer

The identifier of the call list to which the call is linked.

If the call is initiated from a call list, pass the identifier obtained in the ONEXTERNALCALLSTART event.

The list of available call lists can be obtained using the crm.calllist.list method.

LINE_NUMBER
string

The number of the external line.

The line number can be obtained using the telephony.externalLine.get method.

This parameter is not mandatory, but it is recommended to always pass it, especially for incoming calls, to ensure proper line binding and telephony reports/analytics.

EXTERNAL_CALL_ID
string

The external identifier of the call on the PBX/integration side. Used for deduplication of repeated registrations.

Code Examples

How to Use Examples in Documentation

curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"USER_ID":1269,"PHONE_NUMBER":"19062195047","TYPE":2,"CRM_ENTITY_TYPE":"CONTACT","CRM_ENTITY_ID":797,"SHOW":1,"LINE_NUMBER":"3","auth":"**put_access_token_here**"}' \
        https://**put_your_bitrix24_address**/rest/telephony.externalCall.register
        
try
        {
            const response = await $b24.callMethod(
                'telephony.externalCall.register',
                {
                    USER_ID: 1269,
                    PHONE_NUMBER: '19062195047',
                    TYPE: 2,
                    CRM_ENTITY_TYPE: 'CONTACT',
                    CRM_ENTITY_ID: 797,
                    SHOW: 1,
                    LINE_NUMBER: '3'
                }
            );
            
            const result = response.getData().result;
            console.log('Call registered:', result);
            processResult(result);
        }
        catch( error )
        {
            console.error('Error:', error);
        }
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'telephony.externalCall.register',
                    [
                        'USER_ID' => 1269,
                        'PHONE_NUMBER' => '19062195047',
                        'TYPE' => 2,
                        'CRM_ENTITY_TYPE' => 'CONTACT',
                        'CRM_ENTITY_ID' => 797,
                        'SHOW' => 1,
                        'LINE_NUMBER' => '3'
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            echo 'Success: ' . print_r($result, true);
            processData($result);
        
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error registering call: ' . $e->getMessage();
        }
        
BX24.callMethod(
            "telephony.externalCall.register",
            {
                USER_ID: 1269,
                PHONE_NUMBER: '19062195047',
                TYPE: 2,
                CRM_ENTITY_TYPE: 'CONTACT',
                CRM_ENTITY_ID: 797,
                SHOW: 1,
                LINE_NUMBER: '3'
            },
            function(result)
            {
                if (result.error())
                {
                    console.error(result.error(), result.error_description());
                }
                else
                {
                    console.log(result.data());
                }
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'telephony.externalCall.register',
            [
                'USER_ID' => 1269,
                'PHONE_NUMBER' => '19062195047',
                'TYPE' => 2,
                'CRM_ENTITY_TYPE' => 'CONTACT',
                'CRM_ENTITY_ID' => 797,
                'SHOW' => 1,
                'LINE_NUMBER' => '3'
            ]
        );
        
        echo '<PRE>';
        print_r($result);
        echo '</PRE>';
        

Response Handling

HTTP Status: 200

{
            "result": {
                "CALL_ID": "externalCall.716f1cb73def9700a23842adf9c4c568.1773130779",
                "CRM_CREATED_LEAD": null,
                "CRM_CREATED_ENTITIES": [],
                "CRM_ENTITY_TYPE": "CONTACT",
                "CRM_ENTITY_ID": 797
            },
            "time": {
                "start": 1773130778,
                "finish": 1773130779.120838,
                "duration": 1.120837926864624,
                "processing": 1,
                "date_start": "2026-03-10T11:19:38+03:00",
                "date_finish": "2026-03-10T11:19:39+03:00",
                "operating_reset_at": 1773131378,
                "operating": 0.22185301780700684
            }
        }
        

Returned Data

Name
type

Description

result
object

The root element of the response.

CALL_ID
string

The identifier of the call.

CRM_CREATED_LEAD
integer

The identifier of the automatically created lead.

CRM_CREATED_ENTITIES
array

An array of automatically created CRM objects.

CRM_ENTITY_TYPE
string

The type of the main CRM object of the call.

CRM_ENTITY_ID
integer

The identifier of the main CRM object of the call.

LEAD_CREATION_ERROR
string

The error message during lead auto-creation (if any).

time
time

Information about the request execution time.

CRM_CREATED_ENTITIES Object

Name
type

Description

ENTITY_TYPE
string

The type of the created CRM object.

ENTITY_ID
integer

The identifier of the created CRM object.

Error Handling

HTTP Status: 400, 403

{
            "error": "ERROR_CORE",
            "error_description": "Unknown TYPE"
        }
        

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

Value

WRONG_AUTH_TYPE

Current authorization type is denied for this method.

Method called outside the application context.

ERROR_CORE

USER_ID or USER_PHONE_INNER should be set.

Neither USER_ID nor USER_PHONE_INNER were provided.

ERROR_CORE

Unknown TYPE.

An invalid value for TYPE was provided.

ERROR_CORE

CALL_START_DATE should be in the ISO-8601 format.

Incorrect format for CALL_START_DATE.

ERROR_CORE

Unsupported phone number format.

Incorrect format for PHONE_NUMBER.

ERROR_CORE

User is not found or is not active.

User not found or inactive.

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