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/yg2...";
LeadID = "856";

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

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

URL = "b24-ar17wx.bitrix24.by";
Token = "2f4e4067006e9f06006b12e400000001000...";
LeadID = "858";

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 874 \
--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
}
}