LeadCreateRequestDTO
Lead create / update request body. The endpoint serves both create and update,
distinguished by the id field:
idomitted (ornull) → a new lead is created.idprovided → the existing lead is updated.
Partial update (tri-state) semantics. On update, every updatable field is interpreted by its presence in the JSON body:
- absent (key not sent) → the current value is left unchanged.
- present with a value → the field is updated.
- present and explicitly
null→ the field is cleared.
Nested tri-state. The same presence-based semantics apply to the keys inside
each contacts[] and fields[] item. Within an item, an omitted key leaves that
attribute's current value untouched, a key with a value updates it, and an explicit
null clears it. The write-variants ContactRequestDTO and FieldValueRequestDTO
describe these per-key rules in detail.
Example: \{"id": 26801, "pipeStatusId": 603, "contacts": [\{"id": 1001, "phones": ["+998991112233"], "username": null\}]\} updates only contact 1001's phone and
clears its username; its name, type and fields are left unchanged.
Warning — lists are replaced as a whole. The nested tri-state above applies to the keys inside an item, but each list itself is taken as the complete set when its key is present:
fields— the list is treated as the lead's full set of custom field values. Any existing field value not named in the list is DELETED (send 3 of 10 and the other 7 are removed).contacts— likewise, any existing contact not present in the list is UNLINKED from the lead.To leave fields or contacts untouched, omit the key entirely — do not send an empty array
[](its behaviour is not guaranteed). To change only some of a lead's field values without deleting the rest, usePOST /v1/open-api/lead/{leadId}/field/listinstead of thefieldskey here.
Exception — pipeStatusId is always required on every request (create and
update); missing it returns 400 (pipeStatusId / NOT_NULL).
Lead ID. Omit to create, provide to update.
1001Lead name
New apartment buyerLead balance
100Currency ID
24Pipeline status ID. Required on every request (create and update).
979Responsible user ID
101Tag IDs attached to the lead.
[3,7]contacts object[]
Contacts attached to the lead. Replace-all: when this key is present the list is the complete set of contacts — any existing contact not in it is unlinked from the lead. Omit the key entirely to leave contacts untouched.
Contact ID. Omit to create a new contact, provide to update an existing one.
1001Contact name. Required when creating.
John Doefields object[]nullable
Contact custom field values.
CRM field identifier this value belongs to. Always required.
1Simple value (as text)
VIPMultiple values (for multi-select fields).
["VIP","New"]Field value type enum.
Possible values: [STREET, DISTRICT, DEFAULT]
DEFAULTDEFAULTField type (lowercased, e.g. text, select)
selectWhich entity a field/value belongs to.
LED— the leadCONTACT— the contact
Possible values: [LED, CONTACT]
LEDGeo coordinate: longitude (for location fields)
69.2401Geo coordinate: latitude (for location fields)
41.2995Value for NUMBER fields. Required (directly or via the value fallback) when the field's type is NUMBER.
1500.5Currency ID. Required when the NUMBER field's format is CURRENCY.
24Contact type enum.
Possible values: [SIMPLE, TELEGRAM, INSTAGRAM, WEBSITE, FACEBOOK, OTHER, CALL_PBX, MARKETPLACE, GOOGLE_SHEETS, WEB_FORM, WAZZUP, AMO_CRM, TELEGRAM_BUSINESS]
SIMPLETELEGRAMAccount ID (if available)
acc123Username
johndoePhone numbers. Required (non-empty) when creating.
["+998901234567"]Receiver ID (if available)
rec123fields object[]
Additional field values. Replace-all: when this key is present the list is the complete set of the lead's custom field values — any existing value not in it is deleted. Omit the key entirely to leave fields untouched. To update only some fields without deleting the rest, use POST /v1/open-api/lead/{leadId}/field/list instead.
CRM field identifier this value belongs to. Always required.
1Simple value (as text)
VIPMultiple values (for multi-select fields).
["VIP","New"]Field value type enum.
Possible values: [STREET, DISTRICT, DEFAULT]
DEFAULTDEFAULTField type (lowercased, e.g. text, select)
selectWhich entity a field/value belongs to.
LED— the leadCONTACT— the contact
Possible values: [LED, CONTACT]
LEDGeo coordinate: longitude (for location fields)
69.2401Geo coordinate: latitude (for location fields)
41.2995Value for NUMBER fields. Required (directly or via the value fallback) when the field's type is NUMBER.
1500.5Currency ID. Required when the NUMBER field's format is CURRENCY.
24Free-text note
Called, will visit FridayChannel a lead originated from. Serialized by name.
Possible values: [INSTAGRAM, FACEBOOK, FACEBOOK_FORM, TELEGRAM, TELEGRAM_BUSINESS, TELEGRAM_BOT, WHATSAPP, WABA, VK, VIBER, AVITO, WEBSITE, AMO_CRM, ONLINE_PBX, UTEL, SIPUNI, ASTERISK, MOI_ZVONKI, WEB_FORM, EMPLOYEE, UNKNOWN]
INSTAGRAMFree-text channel identifier
ig-promo-2026utmData object
UTM / tracking attribution data attached to a lead.
UTM source
instagramUTM medium
cpcUTM campaign
spring_saleUTM term
apartmentUTM content
banner_aFacebook click ID (fbclid)
IwAR0...Client IP address (Facebook CAPI)
203.0.113.5Client user agent (Facebook CAPI)
Mozilla/5.0 ...Facebook browser ID (_fbp cookie)
fb.1.1672531200.1234567890{
"id": 1001,
"name": "New apartment buyer",
"balance": 100,
"currencyId": 24,
"pipeStatusId": 979,
"responsibleById": 101,
"tagIds": [
3,
7
],
"contacts": [
{
"id": 1001,
"name": "John Doe",
"fields": [
{
"id": 1,
"value": "VIP",
"valueList": [
"VIP",
"New"
],
"valueType": "DEFAULT",
"type": "select",
"infoType": "LED",
"longitude": 69.2401,
"latitude": 41.2995,
"number": 1500.5,
"currencyId": 24
}
],
"type": "TELEGRAM",
"accountId": "acc123",
"username": "johndoe",
"phones": [
"+998901234567"
],
"receiverId": "rec123"
}
],
"fields": [
{
"id": 1,
"value": "VIP",
"valueList": [
"VIP",
"New"
],
"valueType": "DEFAULT",
"type": "select",
"infoType": "LED",
"longitude": 69.2401,
"latitude": 41.2995,
"number": 1500.5,
"currencyId": 24
}
],
"note": "Called, will visit Friday",
"source": "INSTAGRAM",
"sourceChannel": "ig-promo-2026",
"utmData": {
"utmSource": "instagram",
"utmMedium": "cpc",
"utmCampaign": "spring_sale",
"utmTerm": "apartment",
"utmContent": "banner_a",
"fbcLid": "IwAR0...",
"fbClientIpAddress": "203.0.113.5",
"fbClientUserAgent": "Mozilla/5.0 ...",
"fbp": "fb.1.1672531200.1234567890"
}
}