Skip to main content

LeadWithContactsResponse

Result of creating a lead with contacts — the created lead and its created contacts.

lead objectrequired

A lead — a potential customer tracked through the pipeline. A lead belongs to exactly one product, sits in a single pipeline stage, and groups one or more contacts (the addresses through which the person is reached). Leads are created via the API or imported from a connected CRM.

idIdrequired

Unique numeric identifier of the record.

product_idProduct Idrequired

ID of the product (workspace) that owns this record. Most endpoints scope access by product.

customer_id object

Canonical company-level customer ID used to connect this lead with communication episodes from other products and channels; null for records not yet resolved.

anyOf
integer
stage_idStage Idrequired

ID of the pipeline stage.

stage_set_at objectrequired

When the lead entered its current stage (UTC).

anyOf
date-time
start_modeLeadStartModerequired

How the lead entered the system. "outbound" — the lead already existed in the database and was contacted by outreach. "inbound" — the lead did not exist before and was created from an incoming message on a known channel whose agent-channel binding has inbound enabled (AgentChannelConfig.inbound_enabled).

Possible values: [inbound, outbound]

started_at object

When the lead first had meaningful dialogue activity (immutable cohort anchor, UTC).

anyOf
date-time
started_dialogue_id object

ID of the dialogue that first started activity for this lead (immutable anchor).

anyOf
integer
first_outreach_dialogue_id object

ID of the first outbound (outreach) dialogue for this lead (immutable anchor).

anyOf
integer
first_reply_dialogue_id object

ID of the first dialogue in which the lead replied (immutable anchor).

anyOf
integer
name objectrequired

Human-readable display name of the lead.

anyOf
string
crm_id objectrequired

Identifier of the matching record in the connected external CRM, if any.

anyOf
string
crm_fields objectrequired

Free-form key/value attributes mirrored to and from the external CRM.

property name* object
anyOf
string
created_atdate-timerequired

Creation time (UTC, ISO 8601).

updated_atdate-timerequired

Last modification time (UTC, ISO 8601).

is_testIs Test

Marks a lead created for testing; excluded from production metrics.

Default value: false
batch_name objectrequired

Optional label grouping leads imported or created together in one batch.

anyOf
string
timezone objectrequired

IANA timezone (e.g. "Europe/Moscow") used to schedule messages within working hours.

anyOf
string
status objectrequired

Optional free-form status string.

anyOf
string
is_activeIs Activerequired

Whether the lead is active. Deactivated leads are excluded from outreach and automation.

from_crm_integration_id objectrequired

ID of the CRM integration this lead was imported from, if any.

anyOf
integer
from_pipeline_id objectrequired

Identifier of the source CRM pipeline this lead was imported from, if any.

anyOf
string
crm_missing_since object

Set when the matching CRM record can no longer be found (UTC); null while the CRM lead exists.

anyOf
date-time
crm_external_takeover_since object

Set when the CRM record moves to an unmapped pipeline or stage (UTC); null while the lead remains in mapped CRM state.

anyOf
date-time
merged_into_lead_id object

Set when this lead's CRM deal was merged into another deal on the CRM side: the ID of the lead that holds the surviving deal. This lead keeps the crm_id it was imported with (that deal no longer exists) and is deactivated with its dialogues muted. Null for normal leads.

anyOf
integer
merged_at object

When this lead was merged into another lead (UTC); null for normal leads.

anyOf
date-time
contacts object[]required
  • Array [
  • idIdrequired

    Unique numeric identifier of the record.

    lead_idLead Idrequired

    ID of the lead this record relates to.

    product_idProduct Idrequired

    ID of the product (workspace) that owns this record. Most endpoints scope access by product.

    customer_id object

    Canonical company-level customer ID shared by contacts and dialogues resolved as the same real customer; null for records not yet resolved.

    anyOf
    integer
    contactContactrequired

    The address value itself — e.g. a phone number, a username, a chat id, or an email.

    contact_typeContactTyperequired

    The kind of address — phone, username, chat_id, or email.

    Possible values: [phone, username, chat_id, email]

    channel_type objectrequired

    The messaging platform the address is valid on. Null means universal (typically a phone number).

    anyOf
    string

    Possible values: [telegram, whatsapp, waba, max, viber, instagram, fasttrack, usedesk, salebot, avito, vk, yandex_messenger, email, sms, pinbox, linkedin, amocrm_salesbot, bitrix24_openlines, sip, webrtc, bothelp]

    ext_channel_id objectrequired

    Optional binding to a specific external channel; narrows where the address is used.

    anyOf
    string
    channel_vendor objectrequired

    Optional messaging-provider vendor the address is pinned to.

    anyOf
    string

    Possible values: [wazzup24, self_wz, chatpush, greenapi, wappi, chatapp, yandex_messenger, salebot, bothelp, radist, fasttrack, usedesk, amocrm_salesbot, bitrix24_openlines, twilio, mail.ru, gmail, pinbox, unipile, voice]

    created_atdate-timerequired

    Creation time (UTC, ISO 8601).

    is_mainIs Mainrequired

    Whether this is the lead's primary contact.

    crm_id object

    Identifier of the matching record in the connected external CRM, if any.

    anyOf
    string
    contact_sourceContactSourcerequired

    Where this contact originated (e.g. api, custom_field, default_field, derived_title).

    Possible values: [custom_field, default_field, derived_title, api, unknown]

    source_name object

    Free-form label describing the origin of the contact.

    anyOf
    string
    last_dialogue_id objectrequired

    ID of the most recent dialogue conducted through this contact.

    anyOf
    integer
    skip_routingSkip Routingrequired

    When true, the contact is excluded from automatic outreach routing.

    waba_window_open_until objectrequired

    For WhatsApp Business API contacts, when the current 24-hour free-form messaging window closes (UTC).

    anyOf
    date-time
    waba_windows_openedWaba Windows Openedrequired

    Count of WABA messaging windows opened for this contact so far.

  • ]
  • LeadWithContactsResponse
    {
    "lead": {
    "id": 0,
    "product_id": 0,
    "customer_id": 0,
    "stage_id": 0,
    "stage_set_at": "2024-07-29T15:51:28.071Z",
    "start_mode": "inbound",
    "started_at": "2024-07-29T15:51:28.071Z",
    "started_dialogue_id": 0,
    "first_outreach_dialogue_id": 0,
    "first_reply_dialogue_id": 0,
    "name": "string",
    "crm_id": "string",
    "crm_fields": {},
    "created_at": "2024-07-29T15:51:28.071Z",
    "updated_at": "2024-07-29T15:51:28.071Z",
    "is_test": false,
    "batch_name": "string",
    "timezone": "string",
    "status": "string",
    "is_active": true,
    "from_crm_integration_id": 0,
    "from_pipeline_id": "string",
    "crm_missing_since": "2024-07-29T15:51:28.071Z",
    "crm_external_takeover_since": "2024-07-29T15:51:28.071Z",
    "merged_into_lead_id": 0,
    "merged_at": "2024-07-29T15:51:28.071Z"
    },
    "contacts": [
    {
    "id": 0,
    "lead_id": 0,
    "product_id": 0,
    "customer_id": 0,
    "contact": "string",
    "contact_type": "phone",
    "channel_type": "telegram",
    "ext_channel_id": "string",
    "channel_vendor": "wazzup24",
    "created_at": "2024-07-29T15:51:28.071Z",
    "is_main": true,
    "crm_id": "string",
    "contact_source": "custom_field",
    "source_name": "string",
    "last_dialogue_id": 0,
    "skip_routing": true,
    "waba_window_open_until": "2024-07-29T15:51:28.071Z",
    "waba_windows_opened": 0
    }
    ]
    }