For the complete documentation index, see llms.txt. This page is also available as Markdown.

Leads

This page provides API documentation for creating a lead in Saleschat.pro, including the required parameters and sample responses for successful lead creation.

Create a new lead for the specified organization

post

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.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
orgIdstringRequired
Body
crm_idstringRequired
first_namestringRequired
last_namestringOptional
phone_numberstringRequired
opt_in_dateinteger · int64Optional
Responses
200

Successfully created lead

application/json
lead_idstringOptional
crm_idstringOptional
first_namestringOptional
last_namestringOptional
phone_numberstringOptional
opt_in_dateinteger · int64Optional
post/v4/orgs/{orgId}/leads
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
}

Assign a lead to a user

put

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.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
orgIdstringRequired
leadIdstringRequired

Saleschat-generated lead ID (UUID) or the lead's CRM ID — both are resolved.

Body
user_idstringOptional
user_emailstringOptional
Responses
202

Successfully assigned lead

No content

put/v4/orgs/{orgId}/leads/{leadId}/assign
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

Add an event for a lead

put

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.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
orgIdstringRequired
leadIdstringRequired

Saleschat-generated lead ID (UUID) or the lead's CRM ID — both are resolved.

Body
distinct_idstring · max: 36Optional

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.

eventstring · max: 128Required
Responses
202

Event accepted

No content

put/v4/orgs/{orgId}/leads/{leadId}/events
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

Look up a lead by CRM ID

get

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.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
orgIdstringRequired
Query parameters
crm_idstringOptional

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).

Responses
200

Lead found

application/json
lead_idstringOptional
crm_idstringOptional
get/v4/orgs/{orgId}/leads/lookup
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.

Activate a lead

put

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).

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
orgIdstringRequired
leadIdstringRequired

Saleschat-generated lead ID (UUID) or the lead's CRM ID — both are resolved.

Query parameters
force_deactivatebooleanOptionalDefault: false
Responses
202

Activation accepted

No content

put/v4/orgs/{orgId}/leads/{leadId}/activate
PUT /v4/orgs/{orgId}/leads/{leadId}/activate HTTP/1.1
Host: apis.saleschat.pro
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Deactivate a lead

put

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.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
orgIdstringRequired
leadIdstringRequired

Saleschat-generated lead ID (UUID) or the lead's CRM ID — both are resolved.

Query parameters
include_relatedbooleanOptional

Also deactivate every other lead sharing this lead's phone number. Default false deactivates only this lead.

Default: false
Responses
202

Deactivation accepted

application/json
self_deactivatedbooleanOptional
related_foundinteger · int32Optional
deactivatedinteger · int32Optional
failedinteger · int32Optional
put/v4/orgs/{orgId}/leads/{leadId}/deactivate
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
}

Expire a lead

put

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.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
orgIdstringRequired
leadIdstringRequired

Saleschat-generated lead ID (UUID) or the lead's CRM ID — both are resolved.

Query parameters
skip_threshold_checkbooleanOptional

Skip the org's expiry-threshold check. Default false applies the threshold, as the Contact-side expire does.

Default: false
Responses
202

Expiry accepted

No content

put/v4/orgs/{orgId}/leads/{leadId}/expire
PUT /v4/orgs/{orgId}/leads/{leadId}/expire HTTP/1.1
Host: apis.saleschat.pro
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Last updated