Lead Update
Updates lead data in Liner.
Endpoint and Method
POST /v2/lead/update/{leadId}/
leadIdint
Lead identifier in Liner. Value must be> 0.
Parameters (Body)
Send only the fields you want to update.
namestringoptional
Client name.
phonestringoptional
Client phone number in E.164 format (numbers with or without the leading + are allowed), e.g.79001234567.
sourceCommentstringoptional
Questionnaire comment/log (string; JSON string if needed).
externalIdBitrix24stringoptional
Lead identifier in Bitrix24 system.
externalIdAmostringoptional
Lead identifier in AmoCRM system.
externalIdMacrostringoptional
Lead identifier in MacroCRM system.
externalIdDomoplanerstringoptional
Lead identifier in Domoplaner system.
statusIdintoptional
Lead status code in Liner.
priorityintoptional
Lead priority in the call queue.
utcOffsetintoptional
Client time zone — UTC offset, e.g.3,-5.
telegramUserNamestringoptional
Telegram username.
telegramPhonestringoptional
Telegram phone number (E.164 recommended).
vkIdstringoptional
VK user identifier. Value must be> 0.
instagramLoginstringoptional
Instagram user login.
customValuesobjectoptional
Map of custom field values: key is the custom field ID, value is the value to be stored for that field.
Request Example
curl -X POST "https://YOUR_LINER_API_HOST/v2/lead/update/{{leadId}}" \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_TOKEN" \
-d '{
"name": "{{name}}",
"phone": "{{phone}}",
"sourceComment": "{{sourceComment}}",
"externalIdBitrix24": "{{externalIdBitrix24}}",
"externalIdAmo": "{{externalIdAmo}}",
"externalIdMacro": "{{externalIdMacro}}",
"externalIdDomoplaner": "{{externalIdDomoplaner}}",
"statusId": {{statusId}},
"priority": {{callPriority}},
"utcOffset": {{utcOffset}},
"telegramUserName": "{{telegramUserName}}",
"telegramPhone": "{{telegramPhone}}",
"vkId": {{vkId}},
"instagramLogin": "{{instagramLogin}}",
"customValues": {
"{{customFieldId}}": "{{customFieldValue}}"
}
}'
<?php
$host = 'https://YOUR_LINER_API_HOST';
$token = 'YOUR_API_TOKEN';
$leadId = (int)$leadId;
// Important: fill only the fields you want to update
$payload = [
'name' => $name,
'phone' => $phone,
'sourceComment' => '',
'externalIdBitrix24' => $externalIdBitrix24,
'externalIdAmo' => $externalIdAmo,
'externalIdMacro' => $externalIdMacro,
'externalIdDomoplaner' => $externalIdDomoplaner,
'statusId' => $statusId,
'priority' => isset($callPriority) ? (int)$callPriority : null,
'utcOffset' => isset($utcOffset) ? (int)$utcOffset : null,
'telegramUserName' => $telegramUserName,
'telegramPhone' => $telegramPhone,
'vkId' => isset($vkId) ? $vkId : null,
'instagramLogin' => $instagramLogin,
'customValues' => [
$customFieldId => $customFieldValue,
],
];
// Remove null fields to avoid overwriting values by accident
$payload = array_filter($payload, fn($v) => $v !== null);
$ch = curl_init($host . '/v2/lead/update/' . $leadId);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-Api-Key: ' . $token,
],
CURLOPT_POSTFIELDS => json_encode($payload, JSON_UNESCAPED_UNICODE),
CURLOPT_TIMEOUT => 15,
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($response === false) {
throw new RuntimeException('cURL error: ' . curl_error($ch));
}
curl_close($ch);
echo "HTTP {$httpCode}\n";
echo $response;
const host = "https://YOUR_LINER_API_HOST";
const token = "YOUR_API_TOKEN";
const leadId = Number(leadId);
// Important: include only the fields you want to update
const payload = {
name: name,
phone: phone,
sourceComment: "",
externalIdBitrix24: externalIdBitrix24,
externalIdAmo: externalIdAmo,
externalIdMacro: externalIdMacro,
externalIdDomoplaner: externalIdDomoplaner,
statusId: statusId,
priority: callPriority != null ? Number(callPriority) : undefined,
utcOffset: utcOffset != null ? Number(utcOffset) : undefined,
telegramUserName: telegramUserName,
telegramPhone: telegramPhone,
vkId: vkId != null ? vkId : undefined,
instagramLogin: instagramLogin,
customValues: {
[customFieldId]: customFieldValue
}
};
// Remove undefined fields
Object.keys(payload).forEach((k) => payload[k] === undefined && delete payload[k]);
const res = await fetch(`${host}/v2/lead/update/${leadId}`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": token
},
body: JSON.stringify(payload)
});
const data = await res.json();
console.log("HTTP", res.status, data);