Leads
This page provides API documentation for creating a lead in Saleschat.pro, including the required parameters and sample responses for successful lead creation.
Creates a new lead with the provided details. The request must include either a valid bearer token or an x-org-api-key for authentication. The response will contain the details of the created lead.
Successfully created lead
Unauthorized - Authentication is required
Forbidden - You don't have permission to access this resource
Org not found
Invalid request payload
Lead with this crm_id already exists
Failed to create lead
POST /v4/orgs/{orgId}/leads HTTP/1.1
Host: apis.saleschat.pro
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 138
{
"crm_id": "text",
"first_name": "text",
"last_name": "text",
"attributes": {
"ANY_ADDITIONAL_PROPERTY": {}
},
"phone_number": "text",
"opt_in_date": 1
}{
"lead_id": "text",
"crm_id": "text",
"first_name": "text",
"last_name": "text",
"attributes": {
"ANY_ADDITIONAL_PROPERTY": {}
},
"phone_number": "text",
"opt_in_date": 1
}Assigns the specified lead to a user. The request must include either a valid bearer token or an x-org-api-key for authentication. The request body should contain either the ID or the email of the user to assign the lead to.
Saleschat-generated lead ID (UUID) or the lead's CRM ID — both are resolved.
Successfully assigned lead
No content
Unauthorized - Authentication is required
Forbidden - You don't have permission to access this resource
Org or lead not found
Invalid request payload
Failed to assign lead
PUT /v4/orgs/{orgId}/leads/{leadId}/assign HTTP/1.1
Host: apis.saleschat.pro
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 38
{
"user_id": "text",
"user_email": "text"
}No content
Records a custom event for the specified lead. If the event type matches a known automation trigger it will be enqueued for processing. Uses distinct_id for idempotency — duplicate requests with the same distinct_id are silently accepted.
Saleschat-generated lead ID (UUID) or the lead's CRM ID — both are resolved.
Optional idempotency key. Empty or whitespace-only values are treated as having no value at all (no deduplication is performed); otherwise surrounding whitespace is stripped.
Event accepted
No content
Unauthorized - Authentication is required
Forbidden - You don't have permission to access this resource
Org or lead not found
Invalid request payload
Failed to process event
PUT /v4/orgs/{orgId}/leads/{leadId}/events HTTP/1.1
Host: apis.saleschat.pro
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 81
{
"distinct_id": "text",
"event": "text",
"attributes": {
"ANY_ADDITIONAL_PROPERTY": {}
}
}No content
Translates a CRM ID into the Saleschat lead ID, returning the lead_id/crm_id pair. Responds 404 when no live lead or contact exists for the CRM ID, including when the matched contact has been expired. Note: a matched legacy contact is promoted to a lead on first access, so this endpoint is not side-effect-free and must not be cached.
The lead's CRM ID. A Saleschat lead ID (UUID) also resolves. Percent-encode reserved characters — in particular a leading '+' on an E.164 phone number should be sent as %2B (a raw '+' decodes to a space in a query string, though that common case is recovered server-side).
Lead found
Unauthorized - Authentication is required
Forbidden - You don't have permission to access this resource
Org not found, or no live lead for crm_id
Missing or invalid crm_id
Failed to look up lead
GET /v4/orgs/{orgId}/leads/lookup HTTP/1.1
Host: apis.saleschat.pro
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"lead_id": "text",
"crm_id": "text"
}Lead lifecycle
Activate, deactivate, or expire a lead by hand. Lifecycle rules usually decide which lead is active; use these endpoints for exceptions. See Lead Lifecycle.
Activates the lead's chatroom. With force_deactivate=true, every other lead on the same phone number is deactivated first, and this lead is activated even if it means taking over the number; if this lead has no chatroom the related leads are still deactivated. With force_deactivate=false only this lead is activated and a conflicting active lead on the number yields 422 (no sweep). Async (202).
Saleschat-generated lead ID (UUID) or the lead's CRM ID — both are resolved.
falseActivation accepted
No content
Unauthorized - Authentication is required
Forbidden - You don't have permission to access this resource
Org or lead not found
A conflicting active lead exists on the phone number (force_deactivate=false)
Failed to activate lead
PUT /v4/orgs/{orgId}/leads/{leadId}/activate HTTP/1.1
Host: apis.saleschat.pro
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Deactivates the lead's chatroom. With include_related=true every other lead on the same phone number is deactivated too, leaving nothing active on that number. Idempotent — an already-inactive lead is accepted and its stored status re-synced. A lead that is expired, was never given a WhatsApp channel, or has no chatroom reports self_deactivated=false while the related sweep still runs. Async (202): the response counts deactivations that were initiated, and the WABA bridge completes them shortly after. Note this does not block the number — the next inbound message creates a new chatroom.
Saleschat-generated lead ID (UUID) or the lead's CRM ID — both are resolved.
Also deactivate every other lead sharing this lead's phone number. Default false deactivates only this lead.
falseDeactivation accepted
Unauthorized - Authentication is required
Forbidden - You don't have permission to access this resource
Org or lead not found
Failed to deactivate lead
PUT /v4/orgs/{orgId}/leads/{leadId}/deactivate HTTP/1.1
Host: apis.saleschat.pro
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"self_deactivated": true,
"related_found": 1,
"deactivated": 1,
"failed": 1
}Expires the lead permanently, closing its chatroom. This is terminal — an expired lead cannot be reactivated. Accepts a dormant lead: expiry is a lifecycle transition, not an action on the record, so an already-inactive lead is still expirable. Idempotent — expiring an already-expired lead is accepted and does nothing. A lead with no WhatsApp pairing (mock or another channel only) has nothing to expire and is also accepted. Async (202): the WABA bridge closes the chatroom shortly after.
Saleschat-generated lead ID (UUID) or the lead's CRM ID — both are resolved.
Skip the org's expiry-threshold check. Default false applies the threshold, as the Contact-side expire does.
falseExpiry accepted
No content
Unauthorized - Authentication is required
Forbidden - You don't have permission to access this resource
Org or lead not found
Failed to expire lead
PUT /v4/orgs/{orgId}/leads/{leadId}/expire HTTP/1.1
Host: apis.saleschat.pro
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Last updated