Register an External Call in Bitrix24 telephony.externalCall.register
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:
telephonyWho 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 must also call the method telephony.externalCall.finish.
The method works only in the context of an application.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
USER_ID* |
The identifier of the user for whom the call is registered. The identifier can be obtained using the user.get method. |
|
USER_PHONE_INNER* |
The internal number of the user. The internal number can be obtained using the user.get method. At least one of the parameters must be specified: |
|
PHONE_NUMBER* |
The client's phone number. |
|
TYPE* |
The type of call. Possible values:
|
|
CALL_START_DATE |
The date and time the call started in ISO-8601 format with timezone indication, for example, By default — the current time on the server. |
|
CRM_CREATE |
Automatic creation of a CRM object if no suitable object is found by the number. Possible values:
By default — For outgoing calls through an external line, the final behavior also depends on the value of the |
|
CRM_SOURCE |
The identifier of the CRM source (the value of the The list of values can be obtained using the crm.status.list method with the filter |
|
CRM_ENTITY_TYPE |
The type of CRM object to associate with the call. Possible values:
|
|
CRM_ENTITY_ID |
The identifier of the CRM object from The identifier can be obtained using the following methods: |
|
SHOW |
Show the call detail form after registration. Possible values:
By default — |
|
ADD_TO_CHAT |
Add a message about the call to the employee's chat. Possible values:
By default — |
|
CALL_LIST_ID |
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 |
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 reporting/analytics of telephony. |
|
EXTERNAL_CALL_ID |
The external identifier of the call on the side of the PBX/integration. It is recommended to pass a unique value for each physical call to avoid returning an existing |
Features of Re-registration
If the method telephony.externalCall.register is called again within 30 minutes, Bitrix24 may return an existing CALL_ID instead of creating a new registration.
To find an existing registration, the following technical call parameters are used:
PHONE_NUMBERTYPEUSER_IDorUSER_PHONE_INNERLINE_NUMBER(if provided)EXTERNAL_CALL_ID(if provided)
The search is performed within the application and only among registrations made in the last 30 minutes.
The CRM fields and start time are not used as deduplication keys:
CRM_ENTITY_TYPECRM_ENTITY_IDCALL_START_DATE
To ensure that each physical call is registered as separate, pass a unique EXTERNAL_CALL_ID for each call on the side of the PBX/integration.
In click-to-call scenarios, where the call is created by Bitrix24 itself, the internal registration call is performed without EXTERNAL_CALL_ID. Therefore, in the statistics for such calls, the EXTERNAL_CALL_ID field is usually empty.
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":"79062195047","TYPE":2,"CRM_ENTITY_TYPE":"CONTACT","CRM_ENTITY_ID":797,"SHOW":1,"LINE_NUMBER":"3","EXTERNAL_CALL_ID":"asterisk-1710140185.18441","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: '79062195047',
TYPE: 2,
CRM_ENTITY_TYPE: 'CONTACT',
CRM_ENTITY_ID: 797,
SHOW: 1,
LINE_NUMBER: '3',
EXTERNAL_CALL_ID: 'asterisk-1710140185.18441'
}
);
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' => '79062195047',
'TYPE' => 2,
'CRM_ENTITY_TYPE' => 'CONTACT',
'CRM_ENTITY_ID' => 797,
'SHOW' => 1,
'LINE_NUMBER' => '3',
'EXTERNAL_CALL_ID' => 'asterisk-1710140185.18441'
]
);
$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: '79062195047',
TYPE: 2,
CRM_ENTITY_TYPE: 'CONTACT',
CRM_ENTITY_ID: 797,
SHOW: 1,
LINE_NUMBER: '3',
EXTERNAL_CALL_ID: 'asterisk-1710140185.18441'
},
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' => '79062195047',
'TYPE' => 2,
'CRM_ENTITY_TYPE' => 'CONTACT',
'CRM_ENTITY_ID' => 797,
'SHOW' => 1,
'LINE_NUMBER' => '3',
'EXTERNAL_CALL_ID' => 'asterisk-1710140185.18441'
]
);
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 |
Description |
|
result |
The root element of the response. |
|
CALL_ID |
The identifier of the call. |
|
CRM_CREATED_LEAD |
The identifier of the automatically created lead. |
|
CRM_CREATED_ENTITIES |
An array of automatically created CRM entities. |
|
CRM_ENTITY_TYPE |
The type of the main CRM object of the call. |
|
CRM_ENTITY_ID |
The identifier of the main CRM object of the call. |
|
LEAD_CREATION_ERROR |
The error message during lead auto-creation (if any). |
|
time |
Information about the request execution time. |
CRM_CREATED_ENTITIES Object
|
Name |
Description |
|
ENTITY_TYPE |
The type of the created CRM object. |
|
ENTITY_ID |
The identifier of the created CRM object. |
Error Handling
HTTP Status: 400, 403
{
"error": "ERROR_CORE",
"error_description": "Unknown TYPE"
}
|
Name |
Description |
|
error |
String error code. It may consist of digits, Latin letters, and underscores |
|
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 |
|
|
Current authorization type is denied for this method. |
Method called outside the application context. |
|
|
USER_ID or USER_PHONE_INNER should be set. |
|
|
|
Unknown TYPE. |
Invalid value for |
|
|
CALL_START_DATE should be in the ISO-8601 format. |
Incorrect format for |
|
|
Unsupported phone number format. |
Incorrect format for |
|
|
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 |
Description |
|
|
|
An internal server error has occurred. Please contact the server administrator or Bitrix24 technical support |
|
|
|
An internal server error has occurred. Please contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The current method is not permitted for calls using batch |
|
|
|
The maximum length of parameters passed to the batch method has been exceeded |
|
|
|
Invalid access token or webhook code |
|
|
|
The HTTPS protocol is required for method calls |
|
|
|
The REST API is blocked due to overload. This is a manual individual block; please contact Bitrix24 technical support to lift it |
|
|
|
The REST API is only available on commercial plans |
|
|
|
The user associated with the access token or webhook used to call the method lacks the necessary permissions |
|
|
|
The manifest is not available |
|
|
|
The request requires higher privileges than those provided by the webhook token |
|
|
|
The provided access token has expired |
|
|
|
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 |
|
|
|
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 |
Continue Learning
- Find a Client in CRM by Phone Number telephony.externalCall.searchCrmEntities
- Show Call Card to User telephony.externalCall.show
- Hide Call Card for User telephony.externalCall.hide
- Finish Call and Log It in Telephony Statistics telephony.externalCall.finish
- Attach a Record to a Completed Call telephony.externalCall.attachRecord