Skip to main content

Update lead

Modifies an existing lead

Function UpdateLead(Val URL, Val LeadID, Val FieldsStructure, Val Token = "") Export

ParameterCLI optionTypeRequiredDescription
URL--urlStringURL of webhook or a Bitrix24 domain, when token used
LeadID--leadNumber, StringLead ID
FieldsStructure--fieldsStructure Of KeyAndValueStructure of lead fields
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.update


1C:Enterprise/OneScript code example
    FieldsStructure = New Structure;
FieldsStructure.Insert("ADDRESS" , "Lermontov st., b. 20");
FieldsStructure.Insert("ADDRESS_COUNTRY", "Belarus");
FieldsStructure.Insert("TITLE" , "SuperClient");

URL = "https://b24-ar17wx.bitrix24.by/rest/1/ps5...";
LeadID = "1248";

Result = OPI_Bitrix24.UpdateLead(URL, LeadID, FieldsStructure);

FieldsStructure.Insert("NAME" , "Evgeniy");
FieldsStructure.Insert("LAST_NAME" , "Evgeniev");

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

Result = OPI_Bitrix24.UpdateLead(URL, LeadID, FieldsStructure, Token);
    # JSON data can also be passed as a path to a .json file

oint bitrix24 UpdateLead \
--url "b24-ar17wx.bitrix24.by" \
--lead 1214 \
--fields "{'ADDRESS':'Lermontov st., b. 20','ADDRESS_COUNTRY':'Belarus','TITLE':'SuperClient','NAME':'Evgeniy','LAST_NAME':'Evgeniev'}" \
--token "***"
Result
{
"result": true,
"time": {
"start": 1728454942.70493,
"finish": 1728454942.90789,
"duration": 0.202960014343262,
"processing": 0.174932956695557,
"date_start": "2024-10-09T09:22:22+03:00",
"date_finish": "2024-10-09T09:22:22+03:00",
"operating_reset_at": 1728455542,
"operating": 0.17490816116333
}
}