Leads
Work with leads already in LMS: search, read, create in a campaign, update, and log activity.
Which operation?
Create directly in a campaign with LMS field names, or submit from another system through a Partner API source.
POSTCreate a leadPOSTSubmit a lead
Find leads with filters in the URL, or send the same filters as a JSON body with QUERY when they are too long for a URL.
GETList leadsQUERYQuery leads
Export the same way: GET for short filters, QUERY for long ones.
GETExport leadsQUERYExport leads (query)
QUERY is a read with a body; see Conventions → QUERY requests.
On this page
Find, read and create
- GETList leads
- QUERYQuery leads
- GETGet a lead
- POSTCreate a lead
- GETExport leads
- QUERYExport leads (query)
Profile and contacts
Pipeline and assignment
Activities
Customer fields
List leads
GET/v1/tenants/{tenantSlug}/lms/leads
Searches and filters leads. Filters combine with AND. Results are sorted by received time (newest first by default) and paged with an opaque cursor: pass nextCursor back as cursor until it is null. Leads outside the acting member's data visibility are never returned. For long filter lists, use the QUERY form of this operation with a JSON body instead.
Query parameters · 21
Search
searchText to look for in the lead's name, company, phone numbers and email addresses. Partial and case-insensitive:
ashamatchesAsha Verma,98123matches+919812345678.
Assignment
assignedTeamIdOnly leads owned by this team.
assignedUserIdOnly leads owned by this member (user ID).
assignmentStateWhose leads:
MY_LEADS(owned by the API key's acting member),MY_TEAM(owned by that member's teams),UNASSIGNED(no team yet) orALL.
Pipeline
campaignIdOnly leads in this campaign.
segmentIdOnly leads in this segment.
currentStageIdOnly leads currently in this pipeline stage.
processIdOnly leads in this sales process.
stageCategoryOnly leads whose stage has this meaning, whatever the stage is called in each process.
stageScopeopenkeeps only leads still being worked (NEW,OPEN,CONTACTEDorQUALIFIEDstages).slaOnly leads with a running SLA clock in this state:
AT_RISK(due soon) orBREACHED(overdue).
Source
firstTouchSourceOnly leads whose first enquiry came from this kind of source, by source type key (for example
meta_lead_adsorwebsite_form; see List source types).lastTouchSourceOnly leads whose latest enquiry came from this kind of source, by source type key.
sourceConnectionIdOnly leads that arrived through this source.
Dates
providerSubmittedFromOnly leads the sending system (for example Meta) says were submitted at or after this time (ISO 8601).
providerSubmittedToOnly leads submitted, per the sending system, at or before this time (ISO 8601).
receivedFromOnly leads LMS received at or after this time (ISO 8601).
receivedToOnly leads LMS received at or before this time (ISO 8601).
Sorting
sortreceived-desc(newest first) orreceived-asc(oldest first), by the time LMS received the lead.
Paging
cursorOpaque cursor from the previous page's
nextCursor. Leave it out to start at the first page.limitMaximum number of records to return in one page.
Responses
One page of leads.
itemsLeads on this page, in
sortorder.nextCursorPass as
cursorto fetch the next page;nullon the last page.totalCountNumber of leads matching the filters, across all pages.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.
Query leads
QUERY/v1/tenants/{tenantSlug}/lms/leads
Same as List leads, with the filters sent as a JSON body using the HTTP QUERY method (safe and idempotent, like GET). Send Content-Type: application/json. Filters combine with AND. Results are sorted by received time (newest first by default) and paged with an opaque cursor: pass nextCursor back as cursor until it is null. Leads outside the acting member's data visibility are never returned.
Request body (application/json)
cursorOpaque cursor from the previous page's
nextCursor. Leave it out to start at the first page.limitMaximum number of records to return in one page.
searchText to look for in the lead's name, company, phone numbers and email addresses. Partial and case-insensitive:
ashamatchesAsha Verma,98123matches+919812345678.firstTouchSourceOnly leads whose first enquiry came from this kind of source, by source type key (for example
meta_lead_adsorwebsite_form; see List source types).lastTouchSourceOnly leads whose latest enquiry came from this kind of source, by source type key.
assignedTeamIdOnly leads owned by this team.
assignedUserIdOnly leads owned by this member (user ID).
assignmentStateWhose leads:
MY_LEADS(owned by the API key's acting member),MY_TEAM(owned by that member's teams),UNASSIGNED(no team yet) orALL.campaignIdOnly leads in this campaign.
segmentIdOnly leads in this segment.
currentStageIdOnly leads currently in this pipeline stage.
processIdOnly leads in this sales process.
providerSubmittedFromOnly leads the sending system (for example Meta) says were submitted at or after this time (ISO 8601).
providerSubmittedToOnly leads submitted, per the sending system, at or before this time (ISO 8601).
receivedFromOnly leads LMS received at or after this time (ISO 8601).
receivedToOnly leads LMS received at or before this time (ISO 8601).
sourceConnectionIdOnly leads that arrived through this source.
stageCategoryOnly leads whose stage has this meaning, whatever the stage is called in each process.
stageScopeopenkeeps only leads still being worked (NEW,OPEN,CONTACTEDorQUALIFIEDstages).slaOnly leads with a running SLA clock in this state:
AT_RISK(due soon) orBREACHED(overdue).sortreceived-desc(newest first) orreceived-asc(oldest first), by the time LMS received the lead.
Responses
One page of leads.
itemsLeads on this page, in
sortorder.nextCursorPass as
cursorto fetch the next page;nullon the last page.totalCountNumber of leads matching the filters, across all pages.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.QUERY_CONTENT_TYPE_UNSUPPORTEDTheQUERYrequest has noContent-Type: application/jsonbody.QUERY_VALIDATION_FAILEDTheQUERYbody is JSON but does not match the request fields.
Get a lead
GET/v1/tenants/{tenantSlug}/lms/leads/{leadId}
Returns the full lead record: identity, contacts, acquisition (source and touches), lifecycle stage, ownership and recent history. Use its updatedAt as expectedUpdatedAt when you change the lead.
Path parameters
leadIdLead ID.
Responses
The lead.
acquisitionWhere the lead came from: source, ad and UTM details of the first enquiry.
assignmentHistoryEvery owner change, oldest first.
campaignHistoryEvery campaign move, oldest first.
identitySignalsPhone numbers, emails and other identifiers used to match duplicates.
leadThe lead itself.
lifecycleEvery stage change, oldest first.
mergesLeads merged into this one, newest first.
mergedIntoLeadIdSet when this lead was merged into another; open that lead instead.
segmentHistoryEvery segment change, oldest first.
Errors
PARTNER_OPERATION_FORBIDDENThe key lacks theleads.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
Create a lead
POST/v1/tenants/{tenantSlug}/lms/leads
Creates a lead directly in a campaign, applying the campaign's process, initial stage, segmentation and allocation rules. Provide at least a name, a company, or a phone, email or WhatsApp contact.
If the lead matches an existing one under the process's identity rules, no new lead is created: the response has created: false, the existing leadId and repeatEnquiry: true, and a lead.repeat_enquiry event is published.
Idempotency-Key is required and must be a UUID for this operation. Retrying with the same key returns the original result.
To feed leads from another system with your own field names and routing, prefer Submit a lead to a Partner API source.
Headers
Idempotency-KeyMakes the request safe to retry: the same key with the same body returns the original result; with a different body,
409.
Request body (application/json)
campaignIdCampaign to create the lead in. It decides the process, pipeline and duplicate rules. Find IDs with List campaigns.
cityCity, for example
Pune.companyNameCompany or business name.
contactsPhone numbers, emails and other contacts. Give at least a name, a company or one phone, email or WhatsApp contact.
countryCountry, for example
India.customAttributesValues for the campaign's customer fields, keyed by field key (see Get a lead's customer fields). Unknown keys are refused.
customerFormRevisionRevision of the customer form your
customAttributeswere built against; if the form changed since, the request fails with409.fullNameThe person's full name.
inquirySummaryWhat the person asked for, in their words or yours. Shown to agents.
priorityHow urgently to work the lead:
LOW,MEDIUM,HIGHorURGENT. Responses and events report it as a rank from1(low) to4(urgent).productInterestProduct or service the person is interested in, for example
Rooftop solar, 5 kW.stateState or region.
Responses
A new lead was created.
LocationURL of the new lead.
createdtruewhen a new lead was created (201);falsewhen the person matched an existing lead (200).leadIdID of the new lead, or of the existing lead it matched.
repeatEnquirytruewhen the request matched an existing lead and was recorded as a repeat enquiry.
Errors
IDEMPOTENCY_KEY_REQUIREDTheIdempotency-Keyheader is missing.VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.IDEMPOTENCY_CONFLICTTheIdempotency-Keywas already used with a different body.
Export leads
GET/v1/tenants/{tenantSlug}/lms/leads/export
Returns the same page as List leads as a downloadable JSON attachment. Needs the export permission on the acting member. Filters combine with AND. Results are sorted by received time (newest first by default) and paged with an opaque cursor: pass nextCursor back as cursor until it is null. Leads outside the acting member's data visibility are never returned.
Query parameters · 21
Search
searchText to look for in the lead's name, company, phone numbers and email addresses. Partial and case-insensitive:
ashamatchesAsha Verma,98123matches+919812345678.
Assignment
assignedTeamIdOnly leads owned by this team.
assignedUserIdOnly leads owned by this member (user ID).
assignmentStateWhose leads:
MY_LEADS(owned by the API key's acting member),MY_TEAM(owned by that member's teams),UNASSIGNED(no team yet) orALL.
Pipeline
campaignIdOnly leads in this campaign.
segmentIdOnly leads in this segment.
currentStageIdOnly leads currently in this pipeline stage.
processIdOnly leads in this sales process.
stageCategoryOnly leads whose stage has this meaning, whatever the stage is called in each process.
stageScopeopenkeeps only leads still being worked (NEW,OPEN,CONTACTEDorQUALIFIEDstages).slaOnly leads with a running SLA clock in this state:
AT_RISK(due soon) orBREACHED(overdue).
Source
firstTouchSourceOnly leads whose first enquiry came from this kind of source, by source type key (for example
meta_lead_adsorwebsite_form; see List source types).lastTouchSourceOnly leads whose latest enquiry came from this kind of source, by source type key.
sourceConnectionIdOnly leads that arrived through this source.
Dates
providerSubmittedFromOnly leads the sending system (for example Meta) says were submitted at or after this time (ISO 8601).
providerSubmittedToOnly leads submitted, per the sending system, at or before this time (ISO 8601).
receivedFromOnly leads LMS received at or after this time (ISO 8601).
receivedToOnly leads LMS received at or before this time (ISO 8601).
Sorting
sortreceived-desc(newest first) orreceived-asc(oldest first), by the time LMS received the lead.
Paging
cursorOpaque cursor from the previous page's
nextCursor. Leave it out to start at the first page.limitMaximum number of records to return in one page.
Responses
One page of leads as an attachment.
Content-DispositionAlwaysattachment; filename="iotindia-lms-leads.json".
itemsLeads on this page, in
sortorder.nextCursorPass as
cursorto fetch the next page;nullon the last page.totalCountNumber of leads matching the filters, across all pages.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.
Export leads (query)
QUERY/v1/tenants/{tenantSlug}/lms/leads/export
Same as Export leads, with the filters sent as a JSON body using the HTTP QUERY method. Returns up to 100 leads per page.
Request body (application/json)
cursorOpaque cursor from the previous page's
nextCursor. Leave it out to start at the first page.limitMaximum number of records to return in one page.
searchText to look for in the lead's name, company, phone numbers and email addresses. Partial and case-insensitive:
ashamatchesAsha Verma,98123matches+919812345678.firstTouchSourceOnly leads whose first enquiry came from this kind of source, by source type key (for example
meta_lead_adsorwebsite_form; see List source types).lastTouchSourceOnly leads whose latest enquiry came from this kind of source, by source type key.
assignedTeamIdOnly leads owned by this team.
assignedUserIdOnly leads owned by this member (user ID).
assignmentStateWhose leads:
MY_LEADS(owned by the API key's acting member),MY_TEAM(owned by that member's teams),UNASSIGNED(no team yet) orALL.campaignIdOnly leads in this campaign.
segmentIdOnly leads in this segment.
currentStageIdOnly leads currently in this pipeline stage.
processIdOnly leads in this sales process.
providerSubmittedFromOnly leads the sending system (for example Meta) says were submitted at or after this time (ISO 8601).
providerSubmittedToOnly leads submitted, per the sending system, at or before this time (ISO 8601).
receivedFromOnly leads LMS received at or after this time (ISO 8601).
receivedToOnly leads LMS received at or before this time (ISO 8601).
sourceConnectionIdOnly leads that arrived through this source.
stageCategoryOnly leads whose stage has this meaning, whatever the stage is called in each process.
stageScopeopenkeeps only leads still being worked (NEW,OPEN,CONTACTEDorQUALIFIEDstages).slaOnly leads with a running SLA clock in this state:
AT_RISK(due soon) orBREACHED(overdue).sortreceived-desc(newest first) orreceived-asc(oldest first), by the time LMS received the lead.
Responses
One page of leads as an attachment.
Content-DispositionAlwaysattachment; filename="iotindia-lms-leads.json".
itemsLeads on this page, in
sortorder.nextCursorPass as
cursorto fetch the next page;nullon the last page.totalCountNumber of leads matching the filters, across all pages.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.QUERY_CONTENT_TYPE_UNSUPPORTEDTheQUERYrequest has noContent-Type: application/jsonbody.QUERY_VALIDATION_FAILEDTheQUERYbody is JSON but does not match the request fields.
Update a lead's profile
PATCH/v1/tenants/{tenantSlug}/lms/leads/{leadId}/profile
Changes profile fields. Send only the fields to change; null clears a field. Send the lead's current updatedAt as expectedUpdatedAt. If someone changed the lead in the meantime the request fails with 409 and nothing is saved: read the lead again and retry.
Path parameters
leadIdLead ID.
Request body (application/json)
cityNew city;
nullclears it, leaving it out keeps it.companyNameNew company name;
nullclears it, leaving it out keeps it.countryNew country;
nullclears it, leaving it out keeps it.expectedUpdatedAtThe lead's
updatedAtfrom your last read. If it changed since, the request fails with409and nothing is saved.fullNameNew full name;
nullclears it, leaving it out keeps it.inquirySummaryNew enquiry summary;
nullclears it, leaving it out keeps it.priorityNew priority:
LOW,MEDIUM,HIGHorURGENT(reported back as rank1–4).productInterestNew product interest;
nullclears it, leaving it out keeps it.stateNew state or region;
nullclears it, leaving it out keeps it.
Responses
The saved profile version.
leadIdLead ID.
priorityPriority rank after the change:
1low …4urgent;nullwhen not set.updatedAtThe lead's new
updatedAt. Use it asexpectedUpdatedAtnext time.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.STALE_LEADThe lead changed after your read (expectedUpdatedAt); read it again and resend.
Add a contact
POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/contacts
Adds a phone number, email address, WhatsApp number or other contact. Phone numbers are normalised; isPrimary: true makes it the primary contact of its type. Send the lead's current updatedAt as expectedUpdatedAt. If someone changed the lead in the meantime the request fails with 409 and nothing is saved: read the lead again and retry.
Path parameters
leadIdLead ID.
Request body (application/json)
contactTypeKind of contact.
PHONEandWHATSAPPtake a phone number (7–15 digits,+country code recommended),EMAILan email address,OTHERany text.isPrimaryMake this the lead's main contact of its kind (agents call or write to it first).
labelYour label for it, for example
WorkorHome.valueThe phone number, email address or other value, as the person gave it. LMS stores a normalised copy for matching duplicates.
expectedUpdatedAtThe lead's
updatedAtfrom your last read;409if it changed since.
Responses
The new contact.
contactTypeKind of contact:
PHONE,EMAIL,WHATSAPPorOTHER.createdAtWhen it was created (ISO 8601).
displayValueThe value as entered, for display.
idContact ID.
isPrimaryWhether it is the lead's main contact of its kind.
labelYour label, for example
Work.leadIdLead ID.
normalizedValueNormalised form used for duplicate matching (E.164 for phones, lower case for emails).
replacedByIdContact that replaced this one;
nullunless replaced.statusACTIVE, orREMOVEDafter it was removed or replaced.updatedAtWhen it last changed (ISO 8601). Send it back as
expectedUpdatedAtwhen you update.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.STALE_LEADThe lead changed after your read (expectedUpdatedAt); read it again and resend.
Update a contact's label or primary flag
PATCH/v1/tenants/{tenantSlug}/lms/leads/{leadId}/contacts/{contactId}
Changes a contact's label or makes it primary. To change the number or address itself, use Replace a contact. Send the lead's current updatedAt as expectedUpdatedAt. If someone changed the lead in the meantime the request fails with 409 and nothing is saved: read the lead again and retry.
Path parameters
leadIdLead ID.
contactIdContact ID.
Request body (application/json)
expectedUpdatedAtThe lead's
updatedAtfrom your last read;409if it changed since.isPrimaryMake this the main contact of its kind.
labelNew label;
nullclears it.
Responses
The updated contact.
contactTypeKind of contact:
PHONE,EMAIL,WHATSAPPorOTHER.createdAtWhen it was created (ISO 8601).
displayValueThe value as entered, for display.
idContact ID.
isPrimaryWhether it is the lead's main contact of its kind.
labelYour label, for example
Work.leadIdLead ID.
normalizedValueNormalised form used for duplicate matching (E.164 for phones, lower case for emails).
replacedByIdContact that replaced this one;
nullunless replaced.statusACTIVE, orREMOVEDafter it was removed or replaced.updatedAtWhen it last changed (ISO 8601). Send it back as
expectedUpdatedAtwhen you update.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.CONTACT_NOT_FOUNDThe contact does not exist or the key cannot see it.STALE_LEADThe lead changed after your read (expectedUpdatedAt); read it again and resend.
Replace a contact
POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/contacts/{contactId}/replace
Replaces a contact's value. The old value is kept in history as removed and a new contact is returned. Send the lead's current updatedAt as expectedUpdatedAt. If someone changed the lead in the meantime the request fails with 409 and nothing is saved: read the lead again and retry.
Path parameters
leadIdLead ID.
contactIdContact ID.
Request body (application/json)
expectedUpdatedAtThe lead's
updatedAtfrom your last read;409if it changed since.isPrimaryMake the new value the main contact of its kind.
labelLabel for the new value;
nullclears it.valueThe new phone number, email or other value. The old one is kept as removed.
Responses
The replacement contact.
contactTypeKind of contact:
PHONE,EMAIL,WHATSAPPorOTHER.createdAtWhen it was created (ISO 8601).
displayValueThe value as entered, for display.
idContact ID.
isPrimaryWhether it is the lead's main contact of its kind.
labelYour label, for example
Work.leadIdLead ID.
normalizedValueNormalised form used for duplicate matching (E.164 for phones, lower case for emails).
replacedByIdContact that replaced this one;
nullunless replaced.statusACTIVE, orREMOVEDafter it was removed or replaced.updatedAtWhen it last changed (ISO 8601). Send it back as
expectedUpdatedAtwhen you update.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.CONTACT_NOT_FOUNDThe contact does not exist or the key cannot see it.STALE_LEADThe lead changed after your read (expectedUpdatedAt); read it again and resend.
Remove a contact
POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/contacts/{contactId}/deactivate
Marks a contact as removed. It stays in history but is no longer used for calls or messages. Send the lead's current updatedAt as expectedUpdatedAt. If someone changed the lead in the meantime the request fails with 409 and nothing is saved: read the lead again and retry.
Path parameters
leadIdLead ID.
contactIdContact ID.
Request body (application/json)
expectedUpdatedAtThe lead's
updatedAtfrom your last read;409if it changed since.
Responses
The contact was removed.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.CONTACT_NOT_FOUNDThe contact does not exist or the key cannot see it.STALE_LEADThe lead changed after your read (expectedUpdatedAt); read it again and resend.
Move a lead to another stage
POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/transition
Moves the lead to a stage of its process, subject to the process's transition rules. Publishes lead.stage_changed. reason is an upper-case code you choose (for example CRM_SYNC) that is stored in the lead's history.
Path parameters
leadIdLead ID.
Request body (application/json)
reasonYour reason code, in upper case (for example
CRM_SYNC). Kept in the lead's history.stageIdID of the stage.
Responses
The transition that was applied.
isFirstConversiontruethe first time this lead reaches aCONVERTEDstage.leadIdLead ID.
occurredAtWhen the move happened (ISO 8601).
previousStageCategoryMeaning of the stage the lead left.
previousStageIdStage the lead left.
stageCategoryMeaning of the new stage.
stageIdStage the lead is now in.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.- The change conflicts with the record's current state or a workflow rule;
error.codenames it.
Assign a lead
POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/assignment
Assigns the lead to a team and, optionally, a member of that team (userId: null leaves it in the team queue). A manual assignment locks ownership so allocation rules no longer change it; clear the lock to hand control back to the rules. Publishes lead.assigned. reason is an upper-case code you choose (for example CRM_SYNC) that is stored in the lead's history.
Path parameters
leadIdLead ID.
Request body (application/json)
reasonYour reason code, in upper case (for example
CRM_SYNC). Kept in the lead's history.teamIdID of the team.
userIdID of the user;
nullif none.
Responses
The lead's ownership after the change.
assignmentLockedtruewhen the owner was set by hand, so allocation rules leave it alone.campaignIdCampaign of the lead.
leadIdLead ID.
segmentIdSegment of the lead;
nullif none.segmentLockedtruewhen the segment was set by hand, so segmentation rules leave it alone.teamIdOwning team;
nullif unassigned.userIdOwning member;
nullwhile in a team queue.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.- The change conflicts with the record's current state or a workflow rule;
error.codenames it.
Release a manual assignment
POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/assignment-lock/clear
Clears the assignment lock so allocation rules may reassign the lead on their next evaluation. reason is an upper-case code you choose (for example CRM_SYNC) that is stored in the lead's history.
Path parameters
leadIdLead ID.
Request body (application/json)
reasonYour reason code, in upper case (for example
CRM_SYNC). Kept in the lead's history.
Responses
The lead's ownership after the change.
assignmentLockedtruewhen the owner was set by hand, so allocation rules leave it alone.campaignIdCampaign of the lead.
leadIdLead ID.
segmentIdSegment of the lead;
nullif none.segmentLockedtruewhen the segment was set by hand, so segmentation rules leave it alone.teamIdOwning team;
nullif unassigned.userIdOwning member;
nullwhile in a team queue.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.- The change conflicts with the record's current state or a workflow rule;
error.codenames it.
Set a lead's segment
POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/segment
Places the lead in a segment (or none with segmentId: null) and locks the choice against segmentation rules. reason is an upper-case code you choose (for example CRM_SYNC) that is stored in the lead's history.
Path parameters
leadIdLead ID.
Request body (application/json)
reasonYour reason code, in upper case (for example
CRM_SYNC). Kept in the lead's history.segmentIdID of the segment;
nullif none.
Responses
The lead's ownership after the change.
assignmentLockedtruewhen the owner was set by hand, so allocation rules leave it alone.campaignIdCampaign of the lead.
leadIdLead ID.
segmentIdSegment of the lead;
nullif none.segmentLockedtruewhen the segment was set by hand, so segmentation rules leave it alone.teamIdOwning team;
nullif unassigned.userIdOwning member;
nullwhile in a team queue.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.- The change conflicts with the record's current state or a workflow rule;
error.codenames it.
Release a manual segment
POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/segment-lock/clear
Clears the segment lock so segmentation rules apply again. reason is an upper-case code you choose (for example CRM_SYNC) that is stored in the lead's history.
Path parameters
leadIdLead ID.
Request body (application/json)
reasonYour reason code, in upper case (for example
CRM_SYNC). Kept in the lead's history.
Responses
The lead's ownership after the change.
assignmentLockedtruewhen the owner was set by hand, so allocation rules leave it alone.campaignIdCampaign of the lead.
leadIdLead ID.
segmentIdSegment of the lead;
nullif none.segmentLockedtruewhen the segment was set by hand, so segmentation rules leave it alone.teamIdOwning team;
nullif unassigned.userIdOwning member;
nullwhile in a team queue.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.- The change conflicts with the record's current state or a workflow rule;
error.codenames it.
Re-run ownership rules
POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/reevaluate
Re-applies the published segmentation and allocation rules to the lead now. Locked choices are kept. reason is an upper-case code you choose (for example CRM_SYNC) that is stored in the lead's history.
Path parameters
leadIdLead ID.
Request body (application/json)
reasonYour reason code, in upper case (for example
CRM_SYNC). Kept in the lead's history.
Responses
Ownership after re-evaluation, with what changed.
assignmentLockedtruewhen the owner was set by hand, so allocation rules leave it alone.campaignIdCampaign of the lead.
leadIdLead ID.
segmentIdSegment of the lead;
nullif none.segmentLockedtruewhen the segment was set by hand, so segmentation rules leave it alone.teamIdOwning team;
nullif unassigned.userIdOwning member;
nullwhile in a team queue.assignmentChangedWhether re-running the rules changed the owner.
segmentChangedWhether re-running the rules changed the segment.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.- The change conflicts with the record's current state or a workflow rule;
error.codenames it.
Move a lead to another campaign
POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/campaign
Moves the lead to another campaign of the same process. Ownership is re-evaluated for the new campaign. reason is an upper-case code you choose (for example CRM_SYNC) that is stored in the lead's history.
Path parameters
leadIdLead ID.
Request body (application/json)
campaignIdID of the campaign.
reasonYour reason code, in upper case (for example
CRM_SYNC). Kept in the lead's history.
Responses
The lead's ownership after the change.
assignmentLockedtruewhen the owner was set by hand, so allocation rules leave it alone.campaignIdCampaign of the lead.
leadIdLead ID.
segmentIdSegment of the lead;
nullif none.segmentLockedtruewhen the segment was set by hand, so segmentation rules leave it alone.teamIdOwning team;
nullif unassigned.userIdOwning member;
nullwhile in a team queue.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.- The change conflicts with the record's current state or a workflow rule;
error.codenames it.
Log an activity
POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/activities
Records a contact attempt, a note or a follow-up on the lead's timeline. A FOLLOW_UP with dueAt schedules a follow-up and publishes followup.created.
Path parameters
leadIdLead ID.
Request body (application/json)
Responses
The recorded activity.
activityTypeCONTACT(a call, message or meeting),NOTEorFOLLOW_UP.actorIdMember who logged it.
channelHow contact was made:
PHONE,EMAIL,WHATSAPP,SMS,MEETINGorOTHER;nullfor notes.contactIdContact used;
nullif not recorded.createdAtWhen it was created (ISO 8601).
directionINBOUNDorOUTBOUND;nullfor notes and follow-ups.dueAtWhen a follow-up is due;
nullfor other activities.idActivity ID.
leadIdLead ID.
noteFree-text note.
occurredAtWhen it happened (ISO 8601).
outcomeResult of a contact attempt, for example
CONNECTEDorNO_ANSWER;nullfor notes and follow-ups.recordedAtWhen it was logged (ISO 8601).
revisionRevision number, increased on each correction. Send it as
expectedRevision.updatedAtWhen it last changed (ISO 8601). Send it back as
expectedUpdatedAtwhen you update.voidReasonWhy it was voided;
nullunless voided.voidedAtWhen it was voided;
nullunless voided.voidedByMember who voided it;
nullunless voided.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.- The change conflicts with the record's current state or a workflow rule;
error.codenames it.
Query a lead's activities
QUERY/v1/tenants/{tenantSlug}/lms/leads/{leadId}/activities
Lists the lead's timeline, newest first, filtered by activity type, channel and time range, using the HTTP QUERY method with a JSON body. Page with cursor / nextCursor. Voided activities are excluded unless includeVoided is true.
Path parameters
leadIdLead ID.
Request body (application/json)
activityTypesOnly these kinds:
CONTACT,NOTE,FOLLOW_UP.channelsOnly activities on these channels.
cursorCursor from the previous page's
nextCursor; leave out for the first page.includeVoidedInclude voided activities (left out by default).
limitActivities per page (1–100).
occurredFromOnly activities that happened at or after this time (ISO 8601).
occurredToOnly activities that happened at or before this time (ISO 8601).
Responses
One page of activities.
itemsThe records in this response, in the documented order.
nextCursorPass as
cursorto fetch the next page;nullon the last page.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.QUERY_CONTENT_TYPE_UNSUPPORTEDTheQUERYrequest has noContent-Type: application/jsonbody.QUERY_VALIDATION_FAILEDTheQUERYbody is JSON but does not match the request fields.
Correct an activity
PATCH/v1/tenants/{tenantSlug}/lms/leads/{leadId}/activities/{activityId}
Replaces an activity with a corrected version and records why. Send the activity's current revision as expectedRevision; a stale revision returns 409.
Path parameters
leadIdLead ID.
activityIdActivity ID.
Request body (application/json)
correctionReasonWhy you are correcting it; kept in the audit trail.
expectedRevisionThe activity's
revisionfrom your last read;409if it changed since.activityThe corrected activity, in full.
Responses
The corrected activity.
activityTypeCONTACT(a call, message or meeting),NOTEorFOLLOW_UP.actorIdMember who logged it.
channelHow contact was made:
PHONE,EMAIL,WHATSAPP,SMS,MEETINGorOTHER;nullfor notes.contactIdContact used;
nullif not recorded.createdAtWhen it was created (ISO 8601).
directionINBOUNDorOUTBOUND;nullfor notes and follow-ups.dueAtWhen a follow-up is due;
nullfor other activities.idActivity ID.
leadIdLead ID.
noteFree-text note.
occurredAtWhen it happened (ISO 8601).
outcomeResult of a contact attempt, for example
CONNECTEDorNO_ANSWER;nullfor notes and follow-ups.recordedAtWhen it was logged (ISO 8601).
revisionRevision number, increased on each correction. Send it as
expectedRevision.updatedAtWhen it last changed (ISO 8601). Send it back as
expectedUpdatedAtwhen you update.voidReasonWhy it was voided;
nullunless voided.voidedAtWhen it was voided;
nullunless voided.voidedByMember who voided it;
nullunless voided.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.ACTIVITY_NOT_FOUNDThe activity does not exist or the key cannot see it.STALE_REVISIONThe record changed after your read (expectedRevision); read it again and resend.
Void an activity
POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/activities/{activityId}/void
Marks an activity as void (for example, logged on the wrong lead). It stays in history for audit. Send the current revision as expectedRevision.
Path parameters
leadIdLead ID.
activityIdActivity ID.
Request body (application/json)
expectedRevisionThe activity's
revisionfrom your last read;409if it changed since.reasonWhy you are voiding it; kept in the audit trail.
Responses
The activity was voided.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.ACTIVITY_NOT_FOUNDThe activity does not exist or the key cannot see it.STALE_REVISIONThe record changed after your read (expectedRevision); read it again and resend.
Get a lead's customer fields
GET/v1/tenants/{tenantSlug}/lms/leads/{leadId}/customer-fields
Returns the values of the campaign's customer form for this lead, with the form revision they were saved against.
Path parameters
leadIdLead ID.
Responses
Customer field values.
leadIdLead ID.
leadNameThe lead's name, for display.
maskedFieldsKeys of fields whose values are hidden from the API key's acting member.
formThe campaign's customer form.
valuesCurrent values keyed by field key.
updatedAtThe lead's
updatedAt. Send it asexpectedUpdatedAtwhen saving.
Errors
PARTNER_OPERATION_FORBIDDENThe key lacks theleads.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
Save a lead's customer fields
PUT/v1/tenants/{tenantSlug}/lms/leads/{leadId}/customer-fields
Saves values for the campaign's customer form. Values are validated against the form's field types and required fields; send the form revision you read so a changed form is detected.
Path parameters
leadIdLead ID.
Request body (application/json)
campaignIdCampaign whose form the values belong to; defaults to the lead's campaign.
expectedUpdatedAtThe lead's
updatedAtfrom your last read;409if it changed since.formRevisionThe form
revisionyou built the values against;409if the form changed since.valuesValues keyed by field key. Unknown and archived fields are refused.
Responses
The saved values.
leadIdLead ID.
leadNameThe lead's name, for display.
maskedFieldsKeys of fields whose values are hidden from the API key's acting member.
formThe campaign's customer form.
valuesCurrent values keyed by field key.
updatedAtThe lead's
updatedAt. Send it asexpectedUpdatedAtwhen saving.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theleads.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.STALE_LEADThe lead changed after your read (expectedUpdatedAt); read it again and resend.