Skip to main content

Delete lead

Deletes a lead by ID

Function DeleteLead(Val URL, Val LeadID, Val Token = "") Export

ParameterCLI optionTypeRequiredDescription
URL--urlStringURL of webhook or a Bitrix24 domain, when token used
LeadID--leadNumber, StringLead ID
Token--tokenStringAccess token, when app auth method used

Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API


tip

Method at API documentation: crm.lead.delete


1C:Enterprise/OneScript code example
    URL    = "https://b24-ar17wx.bitrix24.by/rest/1/ps5...";
LeadID = "1248";

Result = OPI_Bitrix24.DeleteLead(URL, LeadID);

URL = "b24-ar17wx.bitrix24.by";
Token = "14bb8267006e9f06006b12e400000001000...";
LeadID = "1250";

Result = OPI_Bitrix24.DeleteLead(URL, LeadID, Token);
    oint bitrix24 DeleteLead \
--url "b24-ar17wx.bitrix24.by" \
--lead 1214 \
--token "***"
Result
{
"result": true,
"time": {
"start": 1728454943.26955,
"finish": 1728454943.58409,
"duration": 0.314532041549683,
"processing": 0.281855821609497,
"date_start": "2024-10-09T09:22:23+03:00",
"date_finish": "2024-10-09T09:22:23+03:00",
"operating_reset_at": 1728455543,
"operating": 0.281836032867432
}
}