Skip to main content

Leads

Work with leads already in LMS: search, read, create in a campaign, update, and log activity.

Which operation?

  1. Create directly in a campaign with LMS field names, or submit from another system through a Partner API source.

    POSTCreate a leadPOSTSubmit a lead

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

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

List leads

GET/v1/tenants/{tenantSlug}/lms/leads

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.readPaging cursor (items, nextCursor)

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

  • searchstringoptional

    Text to look for in the lead's name, company, phone numbers and email addresses. Partial and case-insensitive: asha matches Asha Verma, 98123 matches +919812345678.

    1–200 characters

Assignment

  • assignedTeamIdstring (uuid)optional

    Only leads owned by this team.

  • assignedUserIdstring (uuid)optional

    Only leads owned by this member (user ID).

  • assignmentStateenumoptional

    Whose leads: MY_LEADS (owned by the API key's acting member), MY_TEAM (owned by that member's teams), UNASSIGNED (no team yet) or ALL.

    One ofMY_LEADSMY_TEAMUNASSIGNEDALL

    default "ALL"

Pipeline

  • campaignIdstring (uuid)optional

    Only leads in this campaign.

  • segmentIdstring (uuid)optional

    Only leads in this segment.

  • currentStageIdstring (uuid)optional

    Only leads currently in this pipeline stage.

  • processIdstring (uuid)optional

    Only leads in this sales process.

  • stageCategoryenumoptional

    Only leads whose stage has this meaning, whatever the stage is called in each process.

    NEW
    Just arrived; nobody has worked it yet.
    OPEN
    Being worked, not yet contacted.
    CONTACTED
    Someone has reached the customer.
    QUALIFIED
    A real opportunity worth pursuing.
    CONVERTED
    Won: the customer bought or signed.
    LOST
    Closed without a sale.
    DISQUALIFIED
    Not a fit or not genuine (spam, wrong number).
  • stageScopealways "open"optional

    open keeps only leads still being worked (NEW, OPEN, CONTACTED or QUALIFIED stages).

  • slaenumoptional

    Only leads with a running SLA clock in this state: AT_RISK (due soon) or BREACHED (overdue).

    One ofAT_RISKBREACHED

Source

  • firstTouchSourcestringoptional

    Only leads whose first enquiry came from this kind of source, by source type key (for example meta_lead_ads or website_form; see List source types).

    pattern ^[a-z][a-z0-9_]{0,63}$

  • lastTouchSourcestringoptional

    Only leads whose latest enquiry came from this kind of source, by source type key.

    pattern ^[a-z][a-z0-9_]{0,63}$

  • sourceConnectionIdstring (uuid)optional

    Only leads that arrived through this source.

Dates

  • providerSubmittedFromstring (date-time)optional

    Only leads the sending system (for example Meta) says were submitted at or after this time (ISO 8601).

  • providerSubmittedTostring (date-time)optional

    Only leads submitted, per the sending system, at or before this time (ISO 8601).

  • receivedFromstring (date-time)optional

    Only leads LMS received at or after this time (ISO 8601).

  • receivedTostring (date-time)optional

    Only leads LMS received at or before this time (ISO 8601).

Sorting

  • sortenumoptional

    received-desc (newest first) or received-asc (oldest first), by the time LMS received the lead.

    One ofreceived-descreceived-asc

    default "received-desc"

    Sorting differs between lists. Conventions

Paging

  • cursorstringoptional

    Opaque cursor from the previous page's nextCursor. Leave it out to start at the first page.

    1–200 characters

  • limitintegeroptional

    Maximum number of records to return in one page.

    1–100 · default 50

Responses

One page of leads.

  • itemsarray of objectrequired

    Leads on this page, in sort order.

  • nextCursorstring or nullrequired

    Pass as cursor to fetch the next page; null on the last page.

  • totalCountintegerrequired

    Number of leads matching the filters, across all pages.

    at least 0

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.read scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"curl -G "$BASE/lms/leads" \  --data-urlencode "limit=50" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "nextCursor": "eyJpZCI6IjBiNmM3YTUyIiwidCI6MTc5NjgxODQwMH0",  "totalCount": 128,  "items": [    {      "appliedAllocationVersionId": "160a5ef3-2701-4516-a30b-f5721f6cd811",      "appliedSegmentationVersionId": "1fe679a3-5977-42fa-9d76-62fa33bc048d",      "assignedTeamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",      "assignedUserId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",      "assignmentLocked": false,      "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",      "city": "Pune",      "companyName": "Verma Traders",      "country": "India",      "createdAt": "2026-11-28T09:15:00.000Z",      "currentSegmentId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e",      "currentStageId": "5d1f2e3a-9b8c-4d7e-a6f5-1c2b3a4d5e6f",      "customAttributes": {        "roofType": "Flat RCC roof"      },      "fullName": "Asha Verma",      "id": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",      "inquirySummary": "Wants a quote for a 5 kW rooftop system before March.",      "lastConnectedAt": "2026-12-01T09:42:18.000Z",      "lastContactAttemptAt": "2026-12-01T09:42:10.000Z",      "platformReceivedAt": "2026-11-28T09:14:52.000Z",      "priority": 3,      "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",      "productInterest": "Rooftop solar, 5 kW",      "providerSubmittedAt": "2026-11-28T09:14:40.000Z",      "segmentLocked": false,      "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",      "sourceRecordId": "4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a",      "stageCategory": "NEW",      "state": "Maharashtra",      "touches": {        "count": 1,        "first": null,        "last": null      },      "sla": {        "state": "ON_TRACK",        "dueAt": "2026-12-02T06:30:00.000Z",        "ruleName": "First call in 5 minutes"      },      "updatedAt": "2026-12-01T10:00:00.000Z"    }  ]}

Query leads

QUERY/v1/tenants/{tenantSlug}/lms/leads

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.readPaging cursor (items, nextCursor)

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)

  • cursorstringoptional

    Opaque cursor from the previous page's nextCursor. Leave it out to start at the first page.

    1–200 characters

  • limitintegeroptional

    Maximum number of records to return in one page.

    1–100 · default 50

  • searchstringoptional

    Text to look for in the lead's name, company, phone numbers and email addresses. Partial and case-insensitive: asha matches Asha Verma, 98123 matches +919812345678.

    1–200 characters

  • firstTouchSourcestringoptional

    Only leads whose first enquiry came from this kind of source, by source type key (for example meta_lead_ads or website_form; see List source types).

    pattern ^[a-z][a-z0-9_]{0,63}$

  • lastTouchSourcestringoptional

    Only leads whose latest enquiry came from this kind of source, by source type key.

    pattern ^[a-z][a-z0-9_]{0,63}$

  • assignedTeamIdstring (uuid)optional

    Only leads owned by this team.

  • assignedUserIdstring (uuid)optional

    Only leads owned by this member (user ID).

  • assignmentStateenumoptional

    Whose leads: MY_LEADS (owned by the API key's acting member), MY_TEAM (owned by that member's teams), UNASSIGNED (no team yet) or ALL.

    One ofMY_LEADSMY_TEAMUNASSIGNEDALL

  • campaignIdstring (uuid)optional

    Only leads in this campaign.

  • segmentIdstring (uuid)optional

    Only leads in this segment.

  • currentStageIdstring (uuid)optional

    Only leads currently in this pipeline stage.

  • processIdstring (uuid)optional

    Only leads in this sales process.

  • providerSubmittedFromstring (date-time)optional

    Only leads the sending system (for example Meta) says were submitted at or after this time (ISO 8601).

  • providerSubmittedTostring (date-time)optional

    Only leads submitted, per the sending system, at or before this time (ISO 8601).

  • receivedFromstring (date-time)optional

    Only leads LMS received at or after this time (ISO 8601).

  • receivedTostring (date-time)optional

    Only leads LMS received at or before this time (ISO 8601).

  • sourceConnectionIdstring (uuid)optional

    Only leads that arrived through this source.

  • stageCategoryenumoptional

    Only leads whose stage has this meaning, whatever the stage is called in each process.

    NEW
    Just arrived; nobody has worked it yet.
    OPEN
    Being worked, not yet contacted.
    CONTACTED
    Someone has reached the customer.
    QUALIFIED
    A real opportunity worth pursuing.
    CONVERTED
    Won: the customer bought or signed.
    LOST
    Closed without a sale.
    DISQUALIFIED
    Not a fit or not genuine (spam, wrong number).
  • stageScopealways "open"optional

    open keeps only leads still being worked (NEW, OPEN, CONTACTED or QUALIFIED stages).

  • slaenumoptional

    Only leads with a running SLA clock in this state: AT_RISK (due soon) or BREACHED (overdue).

    One ofAT_RISKBREACHED

  • sortenumoptional

    received-desc (newest first) or received-asc (oldest first), by the time LMS received the lead.

    One ofreceived-descreceived-asc

    Sorting differs between lists. Conventions

Responses

One page of leads.

  • itemsarray of objectrequired

    Leads on this page, in sort order.

  • nextCursorstring or nullrequired

    Pass as cursor to fetch the next page; null on the last page.

  • totalCountintegerrequired

    Number of leads matching the filters, across all pages.

    at least 0

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.read scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 415 Unsupported Media TypeQUERY_CONTENT_TYPE_UNSUPPORTEDThe QUERY request has no Content-Type: application/json body.
  • 422 Unprocessable ContentQUERY_VALIDATION_FAILEDThe QUERY body is JSON but does not match the request fields.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"curl -X QUERY "$BASE/lms/leads" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "stageCategory": "QUALIFIED",    "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",    "limit": 50  }'
Example response (200 OK) (200 OK)
{  "nextCursor": "eyJpZCI6IjBiNmM3YTUyIiwidCI6MTc5NjgxODQwMH0",  "totalCount": 128,  "items": [    {      "appliedAllocationVersionId": "160a5ef3-2701-4516-a30b-f5721f6cd811",      "appliedSegmentationVersionId": "1fe679a3-5977-42fa-9d76-62fa33bc048d",      "assignedTeamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",      "assignedUserId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",      "assignmentLocked": false,      "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",      "city": "Pune",      "companyName": "Verma Traders",      "country": "India",      "createdAt": "2026-11-28T09:15:00.000Z",      "currentSegmentId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e",      "currentStageId": "5d1f2e3a-9b8c-4d7e-a6f5-1c2b3a4d5e6f",      "customAttributes": {        "roofType": "Flat RCC roof"      },      "fullName": "Asha Verma",      "id": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",      "inquirySummary": "Wants a quote for a 5 kW rooftop system before March.",      "lastConnectedAt": "2026-12-01T09:42:18.000Z",      "lastContactAttemptAt": "2026-12-01T09:42:10.000Z",      "platformReceivedAt": "2026-11-28T09:14:52.000Z",      "priority": 3,      "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",      "productInterest": "Rooftop solar, 5 kW",      "providerSubmittedAt": "2026-11-28T09:14:40.000Z",      "segmentLocked": false,      "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",      "sourceRecordId": "4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a",      "stageCategory": "NEW",      "state": "Maharashtra",      "touches": {        "count": 1,        "first": null,        "last": null      },      "sla": {        "state": "ON_TRACK",        "dueAt": "2026-12-02T06:30:00.000Z",        "ruleName": "First call in 5 minutes"      },      "updatedAt": "2026-12-01T10:00:00.000Z"    }  ]}

Get a lead

GET/v1/tenants/{tenantSlug}/lms/leads/{leadId}

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.read

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

  • leadIdstring (uuid)required

    Lead ID.

Responses

The lead.

  • acquisitionobjectrequired

    Where the lead came from: source, ad and UTM details of the first enquiry.

  • assignmentHistoryarray of objectrequired

    Every owner change, oldest first.

  • campaignHistoryarray of objectrequired

    Every campaign move, oldest first.

  • identitySignalsarray of objectrequired

    Phone numbers, emails and other identifiers used to match duplicates.

  • leadobjectrequired

    The lead itself.

  • lifecyclearray of objectrequired

    Every stage change, oldest first.

  • mergesarray of objectoptional

    Leads merged into this one, newest first.

  • mergedIntoLeadIdstring (uuid) or nulloptional

    Set when this lead was merged into another; open that lead instead.

  • segmentHistoryarray of objectrequired

    Every segment change, oldest first.

Errors

  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.read scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"curl "$BASE/lms/leads/$LEAD_ID" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "acquisition": {    "channel": "META",    "clickId": "fbclid.IwAR2k9Xb7",    "externalAccountId": "acct-1029",    "externalAccountName": "Verma Traders HQ",    "externalAdGroupId": "120208431577231",    "externalAdGroupName": "Pune homeowners 30–55",    "externalAdId": "120208431577232",    "externalAdName": "5 kW system · carousel",    "externalCampaignId": "120208431577230",    "externalCampaignName": "Pune rooftop launch · Leads",    "externalFormId": "848213907551",    "externalFormName": "Solar quote form",    "landingPage": "https://www.example.com/solar/pune",    "platformReceivedAt": "2026-11-28T09:14:52.000Z",    "provider": "META",    "providerSubmittedAt": "2026-11-28T09:14:40.000Z",    "referrer": "https://www.facebook.com/",    "sourceDefinitionKey": "indiamart",    "utmCampaign": "pune_rooftop_launch",    "utmContent": "carousel_v2",    "utmMedium": "paid_social",    "utmSource": "facebook",    "utmTerm": "rooftop solar pune"  },  "assignmentHistory": [    {      "actorId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",      "actorType": "USER",      "allocationVersionId": "ffc4eb36-c20e-4e0c-be1f-7573cb1c9469",      "id": "f3e035d2-1792-4830-9d43-aa53e0c077c9",      "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",      "matchedRuleId": "71695db6-d47a-4c84-9ec2-5d5f839b6561",      "metadata": {        "via": "api_key"      },      "newTeamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",      "newUserId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",      "occurredAt": "2026-12-01T09:45:22.000Z",      "previousTeamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",      "previousUserId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",      "reasonCode": "MAPPING_FIXED",      "source": "RULE",      "strategy": "FIXED_AGENT"    }  ],  "campaignHistory": [    {      "actorId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",      "actorType": "USER",      "id": "ab803a1f-c406-4d5e-bea0-444831369de1",      "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",      "metadata": {        "via": "api_key"      },      "newCampaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",      "occurredAt": "2026-12-01T09:45:22.000Z",      "previousCampaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",      "reasonCode": "MAPPING_FIXED",      "source": "INITIAL"    }  ],  "identitySignals": [    {      "displayValue": "+91 98123 45678",      "id": "760bb909-9294-412a-9c71-c1c854e6d019",      "isPrimary": true,      "normalizedValue": "+919812345678",      "signalType": "PHONE",      "status": "ACTIVE"    }  ],  "lead": {    "appliedAllocationVersionId": "160a5ef3-2701-4516-a30b-f5721f6cd811",    "appliedSegmentationVersionId": "1fe679a3-5977-42fa-9d76-62fa33bc048d",    "assignedTeamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",    "assignedUserId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",    "assignmentLocked": false,    "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",    "city": "Pune",    "companyName": "Verma Traders",    "country": "India",    "createdAt": "2026-11-28T09:15:00.000Z",    "currentSegmentId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e",    "currentStageId": "5d1f2e3a-9b8c-4d7e-a6f5-1c2b3a4d5e6f",    "customAttributes": {      "roofType": "Flat RCC roof"    },    "fullName": "Asha Verma",    "id": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",    "inquirySummary": "Wants a quote for a 5 kW rooftop system before March.",    "lastConnectedAt": "2026-12-01T09:42:18.000Z",    "lastContactAttemptAt": "2026-12-01T09:42:10.000Z",    "platformReceivedAt": "2026-11-28T09:14:52.000Z",    "priority": 3,    "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",    "productInterest": "Rooftop solar, 5 kW",    "providerSubmittedAt": "2026-11-28T09:14:40.000Z",    "segmentLocked": false,    "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",    "sourceRecordId": "4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a",    "stageCategory": "NEW",    "state": "Maharashtra",    "touches": {      "count": 1,      "first": {        "channel": null,        "externalCampaignName": null,        "receivedAt": null,        "sourceDefinitionKey": null      },      "last": {        "channel": null,        "externalCampaignName": null,        "receivedAt": null,        "sourceDefinitionKey": null      }    },    "sla": {      "state": "ON_TRACK",      "dueAt": "2026-12-02T06:30:00.000Z",      "ruleName": "First call in 5 minutes"    },    "updatedAt": "2026-12-01T10:00:00.000Z"  },  "lifecycle": [    {      "actorId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",      "actorType": "USER",      "id": "3489d9cd-db2a-45a2-a4f0-a812254b0795",      "metadata": {        "via": "api_key"      },      "newStageCategory": "NEW",      "newStageId": "5d1f2e3a-9b8c-4d7e-a6f5-1c2b3a4d5e6f",      "occurredAt": "2026-12-01T09:45:22.000Z",      "previousStageCategory": "NEW",      "previousStageId": "8c7b6a59-4d3e-4f2a-9b1c-0d9e8f7a6b5c",      "reasonCode": "MAPPING_FIXED",      "recordedAt": "2026-12-01T10:00:00.000Z"    }  ],  "merges": [    {      "id": "39267ab5-0a8f-4852-864c-87b6d5ab2a25",      "mergedAt": "2026-12-01T10:00:00.000Z",      "mergedLeadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",      "moved": {        "activities": 1      }    }  ],  "mergedIntoLeadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "segmentHistory": [    {      "actorId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",      "actorType": "USER",      "id": "4937e6e4-8268-4c82-9189-358577af595d",      "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",      "matchedRuleId": "71695db6-d47a-4c84-9ec2-5d5f839b6561",      "metadata": {        "via": "api_key"      },      "newSegmentId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e",      "occurredAt": "2026-12-01T09:45:22.000Z",      "previousSegmentId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e",      "reasonCode": "MAPPING_FIXED",      "segmentationVersionId": "27486746-ead2-4074-84b6-bfff14d03a11",      "source": "RULE"    }  ]}

Create a lead

POST/v1/tenants/{tenantSlug}/lms/leads

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.write

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-Keystringrequired

    Makes the request safe to retry: the same key with the same body returns the original result; with a different body, 409.

    pattern ^[A-Za-z0-9._:-]{8,128}$

Request body (application/json)

  • campaignIdstring (uuid)required

    Campaign to create the lead in. It decides the process, pipeline and duplicate rules. Find IDs with List campaigns.

  • citystringoptional

    City, for example Pune.

    1–200 characters

  • companyNamestringoptional

    Company or business name.

    1–300 characters

  • contactsarray of objectoptional

    Phone numbers, emails and other contacts. Give at least a name, a company or one phone, email or WhatsApp contact.

    up to 20 items · default []

  • countrystringoptional

    Country, for example India.

    1–200 characters

  • customAttributesmap of any JSON valueoptional

    Values for the campaign's customer fields, keyed by field key (see Get a lead's customer fields). Unknown keys are refused.

    default {}

  • customerFormRevisionintegeroptional

    Revision of the customer form your customAttributes were built against; if the form changed since, the request fails with 409.

    at least 0

  • fullNamestringoptional

    The person's full name.

    1–300 characters

  • inquirySummarystringoptional

    What the person asked for, in their words or yours. Shown to agents.

    1–5000 characters

  • priorityenumoptional

    How urgently to work the lead: LOW, MEDIUM, HIGH or URGENT. Responses and events report it as a rank from 1 (low) to 4 (urgent).

    One ofLOWMEDIUMHIGHURGENT

    Sent as a name; responses and events report a rank. Conventions

  • productIntereststringoptional

    Product or service the person is interested in, for example Rooftop solar, 5 kW.

    1–500 characters

  • statestringoptional

    State or region.

    1–200 characters

Responses

A new lead was created.

Headers

  • Location URL of the new lead.
  • createdbooleanrequired

    true when a new lead was created (201); false when the person matched an existing lead (200).

  • leadIdstring (uuid)required

    ID of the new lead, or of the existing lead it matched.

  • repeatEnquirybooleanoptional

    true when the request matched an existing lead and was recorded as a repeat enquiry.

Errors

  • 400 Bad RequestIDEMPOTENCY_KEY_REQUIREDThe Idempotency-Key header is missing.
  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 409 ConflictIDEMPOTENCY_CONFLICTThe Idempotency-Key was already used with a different body.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"# One key per new request; reuse it unchanged on every retry.IDEMPOTENCY_KEY="${IDEMPOTENCY_KEY:-$(uuidgen)}"curl -X POST "$BASE/lms/leads" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \  -H "Content-Type: application/json" \  -d '{    "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",    "fullName": "Asha Verma",    "companyName": "Verma Traders",    "city": "Pune",    "state": "Maharashtra",    "country": "India",    "productInterest": "Rooftop solar, 5 kW",    "priority": "HIGH",    "contacts": [      {        "contactType": "PHONE",        "value": "+919812345678",        "isPrimary": true      },      {        "contactType": "EMAIL",        "value": "asha@example.com"      }    ],    "customAttributes": {      "budget": "3-4 lakh"    }  }'
Example response
{  "created": true,  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"}

Export leads

GET/v1/tenants/{tenantSlug}/lms/leads/export

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.readPaging cursor (items, nextCursor)

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

  • searchstringoptional

    Text to look for in the lead's name, company, phone numbers and email addresses. Partial and case-insensitive: asha matches Asha Verma, 98123 matches +919812345678.

    1–200 characters

Assignment

  • assignedTeamIdstring (uuid)optional

    Only leads owned by this team.

  • assignedUserIdstring (uuid)optional

    Only leads owned by this member (user ID).

  • assignmentStateenumoptional

    Whose leads: MY_LEADS (owned by the API key's acting member), MY_TEAM (owned by that member's teams), UNASSIGNED (no team yet) or ALL.

    One ofMY_LEADSMY_TEAMUNASSIGNEDALL

    default "ALL"

Pipeline

  • campaignIdstring (uuid)optional

    Only leads in this campaign.

  • segmentIdstring (uuid)optional

    Only leads in this segment.

  • currentStageIdstring (uuid)optional

    Only leads currently in this pipeline stage.

  • processIdstring (uuid)optional

    Only leads in this sales process.

  • stageCategoryenumoptional

    Only leads whose stage has this meaning, whatever the stage is called in each process.

    NEW
    Just arrived; nobody has worked it yet.
    OPEN
    Being worked, not yet contacted.
    CONTACTED
    Someone has reached the customer.
    QUALIFIED
    A real opportunity worth pursuing.
    CONVERTED
    Won: the customer bought or signed.
    LOST
    Closed without a sale.
    DISQUALIFIED
    Not a fit or not genuine (spam, wrong number).
  • stageScopealways "open"optional

    open keeps only leads still being worked (NEW, OPEN, CONTACTED or QUALIFIED stages).

  • slaenumoptional

    Only leads with a running SLA clock in this state: AT_RISK (due soon) or BREACHED (overdue).

    One ofAT_RISKBREACHED

Source

  • firstTouchSourcestringoptional

    Only leads whose first enquiry came from this kind of source, by source type key (for example meta_lead_ads or website_form; see List source types).

    pattern ^[a-z][a-z0-9_]{0,63}$

  • lastTouchSourcestringoptional

    Only leads whose latest enquiry came from this kind of source, by source type key.

    pattern ^[a-z][a-z0-9_]{0,63}$

  • sourceConnectionIdstring (uuid)optional

    Only leads that arrived through this source.

Dates

  • providerSubmittedFromstring (date-time)optional

    Only leads the sending system (for example Meta) says were submitted at or after this time (ISO 8601).

  • providerSubmittedTostring (date-time)optional

    Only leads submitted, per the sending system, at or before this time (ISO 8601).

  • receivedFromstring (date-time)optional

    Only leads LMS received at or after this time (ISO 8601).

  • receivedTostring (date-time)optional

    Only leads LMS received at or before this time (ISO 8601).

Sorting

  • sortenumoptional

    received-desc (newest first) or received-asc (oldest first), by the time LMS received the lead.

    One ofreceived-descreceived-asc

    default "received-desc"

    Sorting differs between lists. Conventions

Paging

  • cursorstringoptional

    Opaque cursor from the previous page's nextCursor. Leave it out to start at the first page.

    1–200 characters

  • limitintegeroptional

    Maximum number of records to return in one page.

    1–100 · default 50

Responses

One page of leads as an attachment.

Headers

  • Content-Disposition Always attachment; filename="iotindia-lms-leads.json".
  • itemsarray of objectrequired

    Leads on this page, in sort order.

  • nextCursorstring or nullrequired

    Pass as cursor to fetch the next page; null on the last page.

  • totalCountintegerrequired

    Number of leads matching the filters, across all pages.

    at least 0

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.read scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"curl -G "$BASE/lms/leads/export" \  --data-urlencode "limit=50" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "nextCursor": "eyJpZCI6IjBiNmM3YTUyIiwidCI6MTc5NjgxODQwMH0",  "totalCount": 128,  "items": [    {      "appliedAllocationVersionId": "160a5ef3-2701-4516-a30b-f5721f6cd811",      "appliedSegmentationVersionId": "1fe679a3-5977-42fa-9d76-62fa33bc048d",      "assignedTeamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",      "assignedUserId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",      "assignmentLocked": false,      "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",      "city": "Pune",      "companyName": "Verma Traders",      "country": "India",      "createdAt": "2026-11-28T09:15:00.000Z",      "currentSegmentId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e",      "currentStageId": "5d1f2e3a-9b8c-4d7e-a6f5-1c2b3a4d5e6f",      "customAttributes": {        "roofType": "Flat RCC roof"      },      "fullName": "Asha Verma",      "id": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",      "inquirySummary": "Wants a quote for a 5 kW rooftop system before March.",      "lastConnectedAt": "2026-12-01T09:42:18.000Z",      "lastContactAttemptAt": "2026-12-01T09:42:10.000Z",      "platformReceivedAt": "2026-11-28T09:14:52.000Z",      "priority": 3,      "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",      "productInterest": "Rooftop solar, 5 kW",      "providerSubmittedAt": "2026-11-28T09:14:40.000Z",      "segmentLocked": false,      "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",      "sourceRecordId": "4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a",      "stageCategory": "NEW",      "state": "Maharashtra",      "touches": {        "count": 1,        "first": null,        "last": null      },      "sla": {        "state": "ON_TRACK",        "dueAt": "2026-12-02T06:30:00.000Z",        "ruleName": "First call in 5 minutes"      },      "updatedAt": "2026-12-01T10:00:00.000Z"    }  ]}

Export leads (query)

QUERY/v1/tenants/{tenantSlug}/lms/leads/export

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.readPaging cursor (items, nextCursor)

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)

  • cursorstringoptional

    Opaque cursor from the previous page's nextCursor. Leave it out to start at the first page.

    1–200 characters

  • limitintegeroptional

    Maximum number of records to return in one page.

    1–100 · default 50

  • searchstringoptional

    Text to look for in the lead's name, company, phone numbers and email addresses. Partial and case-insensitive: asha matches Asha Verma, 98123 matches +919812345678.

    1–200 characters

  • firstTouchSourcestringoptional

    Only leads whose first enquiry came from this kind of source, by source type key (for example meta_lead_ads or website_form; see List source types).

    pattern ^[a-z][a-z0-9_]{0,63}$

  • lastTouchSourcestringoptional

    Only leads whose latest enquiry came from this kind of source, by source type key.

    pattern ^[a-z][a-z0-9_]{0,63}$

  • assignedTeamIdstring (uuid)optional

    Only leads owned by this team.

  • assignedUserIdstring (uuid)optional

    Only leads owned by this member (user ID).

  • assignmentStateenumoptional

    Whose leads: MY_LEADS (owned by the API key's acting member), MY_TEAM (owned by that member's teams), UNASSIGNED (no team yet) or ALL.

    One ofMY_LEADSMY_TEAMUNASSIGNEDALL

  • campaignIdstring (uuid)optional

    Only leads in this campaign.

  • segmentIdstring (uuid)optional

    Only leads in this segment.

  • currentStageIdstring (uuid)optional

    Only leads currently in this pipeline stage.

  • processIdstring (uuid)optional

    Only leads in this sales process.

  • providerSubmittedFromstring (date-time)optional

    Only leads the sending system (for example Meta) says were submitted at or after this time (ISO 8601).

  • providerSubmittedTostring (date-time)optional

    Only leads submitted, per the sending system, at or before this time (ISO 8601).

  • receivedFromstring (date-time)optional

    Only leads LMS received at or after this time (ISO 8601).

  • receivedTostring (date-time)optional

    Only leads LMS received at or before this time (ISO 8601).

  • sourceConnectionIdstring (uuid)optional

    Only leads that arrived through this source.

  • stageCategoryenumoptional

    Only leads whose stage has this meaning, whatever the stage is called in each process.

    NEW
    Just arrived; nobody has worked it yet.
    OPEN
    Being worked, not yet contacted.
    CONTACTED
    Someone has reached the customer.
    QUALIFIED
    A real opportunity worth pursuing.
    CONVERTED
    Won: the customer bought or signed.
    LOST
    Closed without a sale.
    DISQUALIFIED
    Not a fit or not genuine (spam, wrong number).
  • stageScopealways "open"optional

    open keeps only leads still being worked (NEW, OPEN, CONTACTED or QUALIFIED stages).

  • slaenumoptional

    Only leads with a running SLA clock in this state: AT_RISK (due soon) or BREACHED (overdue).

    One ofAT_RISKBREACHED

  • sortenumoptional

    received-desc (newest first) or received-asc (oldest first), by the time LMS received the lead.

    One ofreceived-descreceived-asc

    Sorting differs between lists. Conventions

Responses

One page of leads as an attachment.

Headers

  • Content-Disposition Always attachment; filename="iotindia-lms-leads.json".
  • itemsarray of objectrequired

    Leads on this page, in sort order.

  • nextCursorstring or nullrequired

    Pass as cursor to fetch the next page; null on the last page.

  • totalCountintegerrequired

    Number of leads matching the filters, across all pages.

    at least 0

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.read scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 415 Unsupported Media TypeQUERY_CONTENT_TYPE_UNSUPPORTEDThe QUERY request has no Content-Type: application/json body.
  • 422 Unprocessable ContentQUERY_VALIDATION_FAILEDThe QUERY body is JSON but does not match the request fields.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"curl -X QUERY "$BASE/lms/leads/export" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "cursor": "eyJpZCI6IjBiNmM3YTUyIiwidCI6MTc5NjgxODQwMH0",    "limit": 50,    "search": "Asha",    "firstTouchSource": "meta_lead_ads",    "lastTouchSource": "website_form",    "assignedTeamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",    "assignedUserId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",    "assignmentState": "MY_LEADS",    "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",    "segmentId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e",    "currentStageId": "5d1f2e3a-9b8c-4d7e-a6f5-1c2b3a4d5e6f",    "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",    "providerSubmittedFrom": "2026-12-01T10:00:00.000Z",    "providerSubmittedTo": "2026-12-01T10:00:00.000Z",    "receivedFrom": "2026-12-01T10:00:00.000Z",    "receivedTo": "2026-12-01T10:00:00.000Z",    "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",    "stageCategory": "NEW",    "stageScope": "open",    "sla": "AT_RISK",    "sort": "received-desc"  }'
Example response (200 OK) (200 OK)
{  "nextCursor": "eyJpZCI6IjBiNmM3YTUyIiwidCI6MTc5NjgxODQwMH0",  "totalCount": 128,  "items": [    {      "appliedAllocationVersionId": "160a5ef3-2701-4516-a30b-f5721f6cd811",      "appliedSegmentationVersionId": "1fe679a3-5977-42fa-9d76-62fa33bc048d",      "assignedTeamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",      "assignedUserId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",      "assignmentLocked": false,      "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",      "city": "Pune",      "companyName": "Verma Traders",      "country": "India",      "createdAt": "2026-11-28T09:15:00.000Z",      "currentSegmentId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e",      "currentStageId": "5d1f2e3a-9b8c-4d7e-a6f5-1c2b3a4d5e6f",      "customAttributes": {        "roofType": "Flat RCC roof"      },      "fullName": "Asha Verma",      "id": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",      "inquirySummary": "Wants a quote for a 5 kW rooftop system before March.",      "lastConnectedAt": "2026-12-01T09:42:18.000Z",      "lastContactAttemptAt": "2026-12-01T09:42:10.000Z",      "platformReceivedAt": "2026-11-28T09:14:52.000Z",      "priority": 3,      "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",      "productInterest": "Rooftop solar, 5 kW",      "providerSubmittedAt": "2026-11-28T09:14:40.000Z",      "segmentLocked": false,      "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",      "sourceRecordId": "4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a",      "stageCategory": "NEW",      "state": "Maharashtra",      "touches": {        "count": 1,        "first": null,        "last": null      },      "sla": {        "state": "ON_TRACK",        "dueAt": "2026-12-02T06:30:00.000Z",        "ruleName": "First call in 5 minutes"      },      "updatedAt": "2026-12-01T10:00:00.000Z"    }  ]}

Update a lead's profile

PATCH/v1/tenants/{tenantSlug}/lms/leads/{leadId}/profile

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.write

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

  • leadIdstring (uuid)required

    Lead ID.

Request body (application/json)

  • citystring or nulloptional

    New city; null clears it, leaving it out keeps it.

    1–200 characters

  • companyNamestring or nulloptional

    New company name; null clears it, leaving it out keeps it.

    1–300 characters

  • countrystring or nulloptional

    New country; null clears it, leaving it out keeps it.

    1–200 characters

  • expectedUpdatedAtstring (date-time)required

    The lead's updatedAt from your last read. If it changed since, the request fails with 409 and nothing is saved.

    One of two concurrency tokens. Conventions

  • fullNamestring or nulloptional

    New full name; null clears it, leaving it out keeps it.

    1–300 characters

  • inquirySummarystring or nulloptional

    New enquiry summary; null clears it, leaving it out keeps it.

    1–5000 characters

  • priorityenumoptional

    New priority: LOW, MEDIUM, HIGH or URGENT (reported back as rank 1–4).

    One ofLOWMEDIUMHIGHURGENT

    Sent as a name; responses and events report a rank. Conventions

  • productIntereststring or nulloptional

    New product interest; null clears it, leaving it out keeps it.

    1–500 characters

  • statestring or nulloptional

    New state or region; null clears it, leaving it out keeps it.

    1–200 characters

Responses

The saved profile version.

  • leadIdstring (uuid)required

    Lead ID.

  • priorityinteger or nullrequired

    Priority rank after the change: 1 low … 4 urgent; null when not set.

    1–4

    A rank from 1 to 4; requests send the name. Conventions

  • updatedAtstring (date-time)required

    The lead's new updatedAt. Use it as expectedUpdatedAt next time.

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
  • 409 ConflictSTALE_LEADThe lead changed after your read (expectedUpdatedAt); read it again and resend.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"curl -X PATCH "$BASE/lms/leads/$LEAD_ID/profile" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "expectedUpdatedAt": "2026-12-01T10:00:00.000Z",    "city": "Mumbai",    "priority": "URGENT"  }'
Example response (200 OK) (200 OK)
{  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "priority": 4,  "updatedAt": "2026-12-01T10:05:00.000Z"}

Add a contact

POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/contacts

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.write

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

  • leadIdstring (uuid)required

    Lead ID.

Request body (application/json)

  • contactTypeenumrequired

    Kind of contact. PHONE and WHATSAPP take a phone number (7–15 digits, + country code recommended), EMAIL an email address, OTHER any text.

    One ofPHONEEMAILWHATSAPPOTHER

  • isPrimarybooleanoptional

    Make this the lead's main contact of its kind (agents call or write to it first).

    default false

  • labelstringoptional

    Your label for it, for example Work or Home.

    1–80 characters

  • valuestringrequired

    The phone number, email address or other value, as the person gave it. LMS stores a normalised copy for matching duplicates.

    1–500 characters

  • expectedUpdatedAtstring (date-time)required

    The lead's updatedAt from your last read; 409 if it changed since.

    One of two concurrency tokens. Conventions

Responses

The new contact.

  • contactTypeenumrequired

    Kind of contact: PHONE, EMAIL, WHATSAPP or OTHER.

    One ofPHONEEMAILWHATSAPPOTHER

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • displayValuestringrequired

    The value as entered, for display.

  • idstring (uuid)required

    Contact ID.

  • isPrimarybooleanrequired

    Whether it is the lead's main contact of its kind.

  • labelstring or nullrequired

    Your label, for example Work.

  • leadIdstring (uuid)required

    Lead ID.

  • normalizedValuestringrequired

    Normalised form used for duplicate matching (E.164 for phones, lower case for emails).

  • replacedByIdstring (uuid) or nullrequired

    Contact that replaced this one; null unless replaced.

  • statusenumrequired

    ACTIVE, or REMOVED after it was removed or replaced.

    One ofACTIVEREMOVED

  • updatedAtstring (date-time)required

    When it last changed (ISO 8601). Send it back as expectedUpdatedAt when you update.

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
  • 409 ConflictSTALE_LEADThe lead changed after your read (expectedUpdatedAt); read it again and resend.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"curl -X POST "$BASE/lms/leads/$LEAD_ID/contacts" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "expectedUpdatedAt": "2026-12-01T10:00:00.000Z",    "contactType": "WHATSAPP",    "value": "+919812345678",    "label": "Personal",    "isPrimary": true  }'
Example response (201 Created) (201 Created)
{  "contactType": "PHONE",  "createdAt": "2026-11-28T09:15:00.000Z",  "displayValue": "+91 98123 45678",  "id": "fd4ee06b-4716-49ae-a23a-0b9c63970101",  "isPrimary": true,  "label": "Work",  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "normalizedValue": "+919812345678",  "replacedById": "2cfd63ab-5f9a-494e-96d3-6b6abd467361",  "status": "ACTIVE",  "updatedAt": "2026-12-01T10:00:00.000Z"}

Update a contact's label or primary flag

PATCH/v1/tenants/{tenantSlug}/lms/leads/{leadId}/contacts/{contactId}

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.write

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

  • leadIdstring (uuid)required

    Lead ID.

  • contactIdstring (uuid)required

    Contact ID.

Request body (application/json)

  • expectedUpdatedAtstring (date-time)required

    The lead's updatedAt from your last read; 409 if it changed since.

    One of two concurrency tokens. Conventions

  • isPrimarybooleanoptional

    Make this the main contact of its kind.

  • labelstring or nulloptional

    New label; null clears it.

    1–80 characters

Responses

The updated contact.

  • contactTypeenumrequired

    Kind of contact: PHONE, EMAIL, WHATSAPP or OTHER.

    One ofPHONEEMAILWHATSAPPOTHER

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • displayValuestringrequired

    The value as entered, for display.

  • idstring (uuid)required

    Contact ID.

  • isPrimarybooleanrequired

    Whether it is the lead's main contact of its kind.

  • labelstring or nullrequired

    Your label, for example Work.

  • leadIdstring (uuid)required

    Lead ID.

  • normalizedValuestringrequired

    Normalised form used for duplicate matching (E.164 for phones, lower case for emails).

  • replacedByIdstring (uuid) or nullrequired

    Contact that replaced this one; null unless replaced.

  • statusenumrequired

    ACTIVE, or REMOVED after it was removed or replaced.

    One ofACTIVEREMOVED

  • updatedAtstring (date-time)required

    When it last changed (ISO 8601). Send it back as expectedUpdatedAt when you update.

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
  • 404 Not FoundCONTACT_NOT_FOUNDThe contact does not exist or the key cannot see it.
  • 409 ConflictSTALE_LEADThe lead changed after your read (expectedUpdatedAt); read it again and resend.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"CONTACT_ID="3a9b8c7d-6e5f-4a1b-9c2d-8e7f6a5b4c3d"curl -X PATCH "$BASE/lms/leads/$LEAD_ID/contacts/$CONTACT_ID" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "expectedUpdatedAt": "2026-12-01T10:00:00.000Z",    "isPrimary": true,    "label": "Work"  }'
Example response (200 OK) (200 OK)
{  "contactType": "PHONE",  "createdAt": "2026-11-28T09:15:00.000Z",  "displayValue": "+91 98123 45678",  "id": "fd4ee06b-4716-49ae-a23a-0b9c63970101",  "isPrimary": true,  "label": "Work",  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "normalizedValue": "+919812345678",  "replacedById": "2cfd63ab-5f9a-494e-96d3-6b6abd467361",  "status": "ACTIVE",  "updatedAt": "2026-12-01T10:00:00.000Z"}

Replace a contact

POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/contacts/{contactId}/replace

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.write

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

  • leadIdstring (uuid)required

    Lead ID.

  • contactIdstring (uuid)required

    Contact ID.

Request body (application/json)

  • expectedUpdatedAtstring (date-time)required

    The lead's updatedAt from your last read; 409 if it changed since.

    One of two concurrency tokens. Conventions

  • isPrimarybooleanoptional

    Make the new value the main contact of its kind.

  • labelstring or nulloptional

    Label for the new value; null clears it.

    1–80 characters

  • valuestringrequired

    The new phone number, email or other value. The old one is kept as removed.

    1–500 characters

Responses

The replacement contact.

  • contactTypeenumrequired

    Kind of contact: PHONE, EMAIL, WHATSAPP or OTHER.

    One ofPHONEEMAILWHATSAPPOTHER

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • displayValuestringrequired

    The value as entered, for display.

  • idstring (uuid)required

    Contact ID.

  • isPrimarybooleanrequired

    Whether it is the lead's main contact of its kind.

  • labelstring or nullrequired

    Your label, for example Work.

  • leadIdstring (uuid)required

    Lead ID.

  • normalizedValuestringrequired

    Normalised form used for duplicate matching (E.164 for phones, lower case for emails).

  • replacedByIdstring (uuid) or nullrequired

    Contact that replaced this one; null unless replaced.

  • statusenumrequired

    ACTIVE, or REMOVED after it was removed or replaced.

    One ofACTIVEREMOVED

  • updatedAtstring (date-time)required

    When it last changed (ISO 8601). Send it back as expectedUpdatedAt when you update.

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
  • 404 Not FoundCONTACT_NOT_FOUNDThe contact does not exist or the key cannot see it.
  • 409 ConflictSTALE_LEADThe lead changed after your read (expectedUpdatedAt); read it again and resend.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"CONTACT_ID="3a9b8c7d-6e5f-4a1b-9c2d-8e7f6a5b4c3d"curl -X POST "$BASE/lms/leads/$LEAD_ID/contacts/$CONTACT_ID/replace" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "expectedUpdatedAt": "2026-12-01T10:00:00.000Z",    "isPrimary": true,    "label": "Work",    "value": "+919812345678"  }'
Example response (201 Created) (201 Created)
{  "contactType": "PHONE",  "createdAt": "2026-11-28T09:15:00.000Z",  "displayValue": "+91 98123 45678",  "id": "fd4ee06b-4716-49ae-a23a-0b9c63970101",  "isPrimary": true,  "label": "Work",  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "normalizedValue": "+919812345678",  "replacedById": "2cfd63ab-5f9a-494e-96d3-6b6abd467361",  "status": "ACTIVE",  "updatedAt": "2026-12-01T10:00:00.000Z"}

Remove a contact

POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/contacts/{contactId}/deactivate

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.write

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

  • leadIdstring (uuid)required

    Lead ID.

  • contactIdstring (uuid)required

    Contact ID.

Request body (application/json)

  • expectedUpdatedAtstring (date-time)required

    The lead's updatedAt from your last read; 409 if it changed since.

    One of two concurrency tokens. Conventions

Responses

The contact was removed.

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
  • 404 Not FoundCONTACT_NOT_FOUNDThe contact does not exist or the key cannot see it.
  • 409 ConflictSTALE_LEADThe lead changed after your read (expectedUpdatedAt); read it again and resend.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"CONTACT_ID="3a9b8c7d-6e5f-4a1b-9c2d-8e7f6a5b4c3d"curl -X POST \  "$BASE/lms/leads/$LEAD_ID/contacts/$CONTACT_ID/deactivate" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "expectedUpdatedAt": "2026-12-01T10:00:00.000Z"  }'

Move a lead to another stage

POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/transition

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.write

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

  • leadIdstring (uuid)required

    Lead ID.

Request body (application/json)

  • reasonstringrequired

    Your reason code, in upper case (for example CRM_SYNC). Kept in the lead's history.

    3–100 characters · pattern ^[A-Z][A-Z0-9_:-]*$

  • stageIdstring (uuid)required

    ID of the stage.

Responses

The transition that was applied.

  • isFirstConversionbooleanrequired

    true the first time this lead reaches a CONVERTED stage.

  • leadIdstring (uuid)required

    Lead ID.

  • occurredAtstring (date-time)required

    When the move happened (ISO 8601).

  • previousStageCategoryenumrequired

    Meaning of the stage the lead left.

    NEW
    Just arrived; nobody has worked it yet.
    OPEN
    Being worked, not yet contacted.
    CONTACTED
    Someone has reached the customer.
    QUALIFIED
    A real opportunity worth pursuing.
    CONVERTED
    Won: the customer bought or signed.
    LOST
    Closed without a sale.
    DISQUALIFIED
    Not a fit or not genuine (spam, wrong number).
  • previousStageIdstring (uuid)required

    Stage the lead left.

  • stageCategoryenumrequired

    Meaning of the new stage.

    NEW
    Just arrived; nobody has worked it yet.
    OPEN
    Being worked, not yet contacted.
    CONTACTED
    Someone has reached the customer.
    QUALIFIED
    A real opportunity worth pursuing.
    CONVERTED
    Won: the customer bought or signed.
    LOST
    Closed without a sale.
    DISQUALIFIED
    Not a fit or not genuine (spam, wrong number).
  • stageIdstring (uuid)required

    Stage the lead is now in.

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
  • 409 ConflictThe change conflicts with the record's current state or a workflow rule; error.code names it.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"curl -X POST "$BASE/lms/leads/$LEAD_ID/transition" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "stageId": "5d1f2e3a-9b8c-4d7e-a6f5-1c2b3a4d5e6f",    "reason": "CRM_SYNC"  }'
Example response (200 OK) (200 OK)
{  "isFirstConversion": false,  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "occurredAt": "2026-12-01T10:00:00.000Z",  "previousStageCategory": "NEW",  "previousStageId": "8c7b6a59-4d3e-4f2a-9b1c-0d9e8f7a6b5c",  "stageCategory": "QUALIFIED",  "stageId": "5d1f2e3a-9b8c-4d7e-a6f5-1c2b3a4d5e6f"}

Assign a lead

POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/assignment

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.write

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

  • leadIdstring (uuid)required

    Lead ID.

Request body (application/json)

  • reasonstringrequired

    Your reason code, in upper case (for example CRM_SYNC). Kept in the lead's history.

    3–100 characters · pattern ^[A-Z][A-Z0-9_:-]*$

  • teamIdstring (uuid)required

    ID of the team.

  • userIdstring (uuid) or nullrequired

    ID of the user; null if none.

Responses

The lead's ownership after the change.

  • assignmentLockedbooleanrequired

    true when the owner was set by hand, so allocation rules leave it alone.

  • campaignIdstring (uuid)required

    Campaign of the lead.

  • leadIdstring (uuid)required

    Lead ID.

  • segmentIdstring (uuid) or nullrequired

    Segment of the lead; null if none.

  • segmentLockedbooleanrequired

    true when the segment was set by hand, so segmentation rules leave it alone.

  • teamIdstring (uuid) or nullrequired

    Owning team; null if unassigned.

  • userIdstring (uuid) or nullrequired

    Owning member; null while in a team queue.

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
  • 409 ConflictThe change conflicts with the record's current state or a workflow rule; error.code names it.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"curl -X POST "$BASE/lms/leads/$LEAD_ID/assignment" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "teamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",    "userId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",    "reason": "CRM_OWNER_SYNC"  }'
Example response (200 OK) (200 OK)
{  "assignmentLocked": true,  "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "segmentId": null,  "segmentLocked": false,  "teamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",  "userId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a"}

Release a manual assignment

POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/assignment-lock/clear

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.write

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

  • leadIdstring (uuid)required

    Lead ID.

Request body (application/json)

  • reasonstringrequired

    Your reason code, in upper case (for example CRM_SYNC). Kept in the lead's history.

    3–100 characters · pattern ^[A-Z][A-Z0-9_:-]*$

Responses

The lead's ownership after the change.

  • assignmentLockedbooleanrequired

    true when the owner was set by hand, so allocation rules leave it alone.

  • campaignIdstring (uuid)required

    Campaign of the lead.

  • leadIdstring (uuid)required

    Lead ID.

  • segmentIdstring (uuid) or nullrequired

    Segment of the lead; null if none.

  • segmentLockedbooleanrequired

    true when the segment was set by hand, so segmentation rules leave it alone.

  • teamIdstring (uuid) or nullrequired

    Owning team; null if unassigned.

  • userIdstring (uuid) or nullrequired

    Owning member; null while in a team queue.

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
  • 409 ConflictThe change conflicts with the record's current state or a workflow rule; error.code names it.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"curl -X POST "$BASE/lms/leads/$LEAD_ID/assignment-lock/clear" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "reason": "CUSTOMER_ASKED_TO_BE_CALLED_NEXT_WEEK_"  }'
Example response (200 OK) (200 OK)
{  "assignmentLocked": true,  "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "segmentId": null,  "segmentLocked": false,  "teamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",  "userId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a"}

Set a lead's segment

POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/segment

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.write

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

  • leadIdstring (uuid)required

    Lead ID.

Request body (application/json)

  • reasonstringrequired

    Your reason code, in upper case (for example CRM_SYNC). Kept in the lead's history.

    3–100 characters · pattern ^[A-Z][A-Z0-9_:-]*$

  • segmentIdstring (uuid) or nullrequired

    ID of the segment; null if none.

Responses

The lead's ownership after the change.

  • assignmentLockedbooleanrequired

    true when the owner was set by hand, so allocation rules leave it alone.

  • campaignIdstring (uuid)required

    Campaign of the lead.

  • leadIdstring (uuid)required

    Lead ID.

  • segmentIdstring (uuid) or nullrequired

    Segment of the lead; null if none.

  • segmentLockedbooleanrequired

    true when the segment was set by hand, so segmentation rules leave it alone.

  • teamIdstring (uuid) or nullrequired

    Owning team; null if unassigned.

  • userIdstring (uuid) or nullrequired

    Owning member; null while in a team queue.

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
  • 409 ConflictThe change conflicts with the record's current state or a workflow rule; error.code names it.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"curl -X POST "$BASE/lms/leads/$LEAD_ID/segment" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "reason": "CUSTOMER_ASKED_TO_BE_CALLED_NEXT_WEEK_",    "segmentId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e"  }'
Example response (200 OK) (200 OK)
{  "assignmentLocked": true,  "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "segmentId": null,  "segmentLocked": false,  "teamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",  "userId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a"}

Release a manual segment

POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/segment-lock/clear

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.write

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

  • leadIdstring (uuid)required

    Lead ID.

Request body (application/json)

  • reasonstringrequired

    Your reason code, in upper case (for example CRM_SYNC). Kept in the lead's history.

    3–100 characters · pattern ^[A-Z][A-Z0-9_:-]*$

Responses

The lead's ownership after the change.

  • assignmentLockedbooleanrequired

    true when the owner was set by hand, so allocation rules leave it alone.

  • campaignIdstring (uuid)required

    Campaign of the lead.

  • leadIdstring (uuid)required

    Lead ID.

  • segmentIdstring (uuid) or nullrequired

    Segment of the lead; null if none.

  • segmentLockedbooleanrequired

    true when the segment was set by hand, so segmentation rules leave it alone.

  • teamIdstring (uuid) or nullrequired

    Owning team; null if unassigned.

  • userIdstring (uuid) or nullrequired

    Owning member; null while in a team queue.

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
  • 409 ConflictThe change conflicts with the record's current state or a workflow rule; error.code names it.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"curl -X POST "$BASE/lms/leads/$LEAD_ID/segment-lock/clear" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "reason": "CUSTOMER_ASKED_TO_BE_CALLED_NEXT_WEEK_"  }'
Example response (200 OK) (200 OK)
{  "assignmentLocked": true,  "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "segmentId": null,  "segmentLocked": false,  "teamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",  "userId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a"}

Re-run ownership rules

POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/reevaluate

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.write

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

  • leadIdstring (uuid)required

    Lead ID.

Request body (application/json)

  • reasonstringrequired

    Your reason code, in upper case (for example CRM_SYNC). Kept in the lead's history.

    3–100 characters · pattern ^[A-Z][A-Z0-9_:-]*$

Responses

Ownership after re-evaluation, with what changed.

  • assignmentLockedbooleanrequired

    true when the owner was set by hand, so allocation rules leave it alone.

  • campaignIdstring (uuid)required

    Campaign of the lead.

  • leadIdstring (uuid)required

    Lead ID.

  • segmentIdstring (uuid) or nullrequired

    Segment of the lead; null if none.

  • segmentLockedbooleanrequired

    true when the segment was set by hand, so segmentation rules leave it alone.

  • teamIdstring (uuid) or nullrequired

    Owning team; null if unassigned.

  • userIdstring (uuid) or nullrequired

    Owning member; null while in a team queue.

  • assignmentChangedbooleanrequired

    Whether re-running the rules changed the owner.

  • segmentChangedbooleanrequired

    Whether re-running the rules changed the segment.

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
  • 409 ConflictThe change conflicts with the record's current state or a workflow rule; error.code names it.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"curl -X POST "$BASE/lms/leads/$LEAD_ID/reevaluate" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "reason": "CUSTOMER_ASKED_TO_BE_CALLED_NEXT_WEEK_"  }'
Example response (200 OK) (200 OK)
{  "assignmentLocked": false,  "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "segmentId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e",  "segmentLocked": false,  "teamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",  "userId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",  "assignmentChanged": false,  "segmentChanged": false}

Move a lead to another campaign

POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/campaign

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.write

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

  • leadIdstring (uuid)required

    Lead ID.

Request body (application/json)

  • campaignIdstring (uuid)required

    ID of the campaign.

  • reasonstringrequired

    Your reason code, in upper case (for example CRM_SYNC). Kept in the lead's history.

    3–100 characters · pattern ^[A-Z][A-Z0-9_:-]*$

Responses

The lead's ownership after the change.

  • assignmentLockedbooleanrequired

    true when the owner was set by hand, so allocation rules leave it alone.

  • campaignIdstring (uuid)required

    Campaign of the lead.

  • leadIdstring (uuid)required

    Lead ID.

  • segmentIdstring (uuid) or nullrequired

    Segment of the lead; null if none.

  • segmentLockedbooleanrequired

    true when the segment was set by hand, so segmentation rules leave it alone.

  • teamIdstring (uuid) or nullrequired

    Owning team; null if unassigned.

  • userIdstring (uuid) or nullrequired

    Owning member; null while in a team queue.

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
  • 409 ConflictThe change conflicts with the record's current state or a workflow rule; error.code names it.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"curl -X POST "$BASE/lms/leads/$LEAD_ID/campaign" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",    "reason": "CUSTOMER_ASKED_TO_BE_CALLED_NEXT_WEEK_"  }'
Example response (200 OK) (200 OK)
{  "assignmentLocked": true,  "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "segmentId": null,  "segmentLocked": false,  "teamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",  "userId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a"}

Log an activity

POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/activities

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.write

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

  • leadIdstring (uuid)required

    Lead ID.

Request body (application/json)

Responses

The recorded activity.

  • activityTypeenumrequired

    CONTACT (a call, message or meeting), NOTE or FOLLOW_UP.

    One ofCONTACTNOTEFOLLOW_UP

  • actorIdstring (uuid)required

    Member who logged it.

  • channelenum or nullrequired

    How contact was made: PHONE, EMAIL, WHATSAPP, SMS, MEETING or OTHER; null for notes.

    One ofPHONEEMAILWHATSAPPSMSMEETINGOTHER

  • contactIdstring (uuid) or nullrequired

    Contact used; null if not recorded.

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • directionenum or nullrequired

    INBOUND or OUTBOUND; null for notes and follow-ups.

    One ofINBOUNDOUTBOUND

  • dueAtstring (date-time) or nullrequired

    When a follow-up is due; null for other activities.

  • idstring (uuid)required

    Activity ID.

  • leadIdstring (uuid)required

    Lead ID.

  • notestring or nullrequired

    Free-text note.

  • occurredAtstring (date-time)required

    When it happened (ISO 8601).

  • outcomeenum or nullrequired

    Result of a contact attempt, for example CONNECTED or NO_ANSWER; null for notes and follow-ups.

    CONNECTED
    Spoke with the customer.
    NO_ANSWER
    No reply or the call rang out.
    BUSY
    The line was busy.
    INVALID_CONTACT
    Wrong or unreachable number or address.
    LEFT_MESSAGE
    Left a voicemail or message.
    REPLIED
    The customer replied to a message.
    BOUNCED_FAILED
    The message bounced or failed.
    FOLLOW_UP_SCHEDULED
    Booked a follow-up.
    OTHER
    Anything else; add a note.
  • recordedAtstring (date-time)required

    When it was logged (ISO 8601).

  • revisionintegerrequired

    Revision number, increased on each correction. Send it as expectedRevision.

    at least 0

  • updatedAtstring (date-time)required

    When it last changed (ISO 8601). Send it back as expectedUpdatedAt when you update.

  • voidReasonstring or nullrequired

    Why it was voided; null unless voided.

  • voidedAtstring (date-time) or nullrequired

    When it was voided; null unless voided.

  • voidedBystring (uuid) or nullrequired

    Member who voided it; null unless voided.

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
  • 409 ConflictThe change conflicts with the record's current state or a workflow rule; error.code names it.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"curl -X POST "$BASE/lms/leads/$LEAD_ID/activities" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "activityType": "FOLLOW_UP",    "channel": "PHONE",    "dueAt": "2026-12-02T05:30:00.000Z",    "note": "Call back with the revised quote.",    "occurredAt": "2026-12-01T10:00:00.000Z"  }'
Example response (201 Created) (201 Created)
{  "activityType": "CONTACT",  "actorId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",  "channel": "PHONE",  "contactId": "3a9b8c7d-6e5f-4a1b-9c2d-8e7f6a5b4c3d",  "createdAt": "2026-11-28T09:15:00.000Z",  "direction": "INBOUND",  "dueAt": "2026-12-02T06:30:00.000Z",  "id": "6012a2a4-2c62-484a-a221-badd894cec25",  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "note": "Asked for a callback after 6 pm.",  "occurredAt": "2026-12-01T09:45:22.000Z",  "outcome": "CONNECTED",  "recordedAt": "2026-12-01T10:00:00.000Z",  "revision": 4,  "updatedAt": "2026-12-01T10:00:00.000Z",  "voidReason": null,  "voidedAt": "2026-12-01T10:00:00.000Z",  "voidedBy": "09368ce5-e4bd-4d32-903f-077045cf1725"}

Query a lead's activities

QUERY/v1/tenants/{tenantSlug}/lms/leads/{leadId}/activities

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.readPaging cursor (items, nextCursor)

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

  • leadIdstring (uuid)required

    Lead ID.

Request body (application/json)

  • activityTypesarray of enumoptional

    Only these kinds: CONTACT, NOTE, FOLLOW_UP.

    One ofCONTACTNOTEFOLLOW_UP

    up to 3 items

  • channelsarray of enumoptional

    Only activities on these channels.

    One ofPHONEEMAILWHATSAPPSMSMEETINGOTHER

    up to 6 items

  • cursorstringoptional

    Cursor from the previous page's nextCursor; leave out for the first page.

    1–1000 characters

  • includeVoidedbooleanoptional

    Include voided activities (left out by default).

    default false

  • limitintegeroptional

    Activities per page (1–100).

    1–100 · default 50

  • occurredFromstring (date-time)optional

    Only activities that happened at or after this time (ISO 8601).

  • occurredTostring (date-time)optional

    Only activities that happened at or before this time (ISO 8601).

Responses

One page of activities.

  • itemsarray of objectrequired

    The records in this response, in the documented order.

  • nextCursorstring or nullrequired

    Pass as cursor to fetch the next page; null on the last page.

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.read scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
  • 415 Unsupported Media TypeQUERY_CONTENT_TYPE_UNSUPPORTEDThe QUERY request has no Content-Type: application/json body.
  • 422 Unprocessable ContentQUERY_VALIDATION_FAILEDThe QUERY body is JSON but does not match the request fields.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"curl -X QUERY "$BASE/lms/leads/$LEAD_ID/activities" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "activityTypes": [      "CONTACT",      "FOLLOW_UP"    ],    "limit": 20  }'
Example response (200 OK) (200 OK)
{  "nextCursor": "eyJpZCI6IjBiNmM3YTUyIiwidCI6MTc5NjgxODQwMH0",  "items": [    {      "activityType": "CONTACT",      "actorId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",      "channel": "PHONE",      "contactId": "3a9b8c7d-6e5f-4a1b-9c2d-8e7f6a5b4c3d",      "createdAt": "2026-11-28T09:15:00.000Z",      "direction": "INBOUND",      "dueAt": "2026-12-02T06:30:00.000Z",      "id": "6012a2a4-2c62-484a-a221-badd894cec25",      "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",      "note": "Asked for a callback after 6 pm.",      "occurredAt": "2026-12-01T09:45:22.000Z",      "outcome": "CONNECTED",      "recordedAt": "2026-12-01T10:00:00.000Z",      "revision": 4,      "updatedAt": "2026-12-01T10:00:00.000Z",      "voidReason": null,      "voidedAt": "2026-12-01T10:00:00.000Z",      "voidedBy": "09368ce5-e4bd-4d32-903f-077045cf1725"    }  ]}

Correct an activity

PATCH/v1/tenants/{tenantSlug}/lms/leads/{leadId}/activities/{activityId}

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.write

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

  • leadIdstring (uuid)required

    Lead ID.

  • activityIdstring (uuid)required

    Activity ID.

Request body (application/json)

  • correctionReasonstringrequired

    Why you are correcting it; kept in the audit trail.

    1–500 characters

  • expectedRevisionintegerrequired

    The activity's revision from your last read; 409 if it changed since.

    at least 0

    One of two concurrency tokens. Conventions

  • activityone of 3 shapesrequired

    The corrected activity, in full.

Responses

The corrected activity.

  • activityTypeenumrequired

    CONTACT (a call, message or meeting), NOTE or FOLLOW_UP.

    One ofCONTACTNOTEFOLLOW_UP

  • actorIdstring (uuid)required

    Member who logged it.

  • channelenum or nullrequired

    How contact was made: PHONE, EMAIL, WHATSAPP, SMS, MEETING or OTHER; null for notes.

    One ofPHONEEMAILWHATSAPPSMSMEETINGOTHER

  • contactIdstring (uuid) or nullrequired

    Contact used; null if not recorded.

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • directionenum or nullrequired

    INBOUND or OUTBOUND; null for notes and follow-ups.

    One ofINBOUNDOUTBOUND

  • dueAtstring (date-time) or nullrequired

    When a follow-up is due; null for other activities.

  • idstring (uuid)required

    Activity ID.

  • leadIdstring (uuid)required

    Lead ID.

  • notestring or nullrequired

    Free-text note.

  • occurredAtstring (date-time)required

    When it happened (ISO 8601).

  • outcomeenum or nullrequired

    Result of a contact attempt, for example CONNECTED or NO_ANSWER; null for notes and follow-ups.

    CONNECTED
    Spoke with the customer.
    NO_ANSWER
    No reply or the call rang out.
    BUSY
    The line was busy.
    INVALID_CONTACT
    Wrong or unreachable number or address.
    LEFT_MESSAGE
    Left a voicemail or message.
    REPLIED
    The customer replied to a message.
    BOUNCED_FAILED
    The message bounced or failed.
    FOLLOW_UP_SCHEDULED
    Booked a follow-up.
    OTHER
    Anything else; add a note.
  • recordedAtstring (date-time)required

    When it was logged (ISO 8601).

  • revisionintegerrequired

    Revision number, increased on each correction. Send it as expectedRevision.

    at least 0

  • updatedAtstring (date-time)required

    When it last changed (ISO 8601). Send it back as expectedUpdatedAt when you update.

  • voidReasonstring or nullrequired

    Why it was voided; null unless voided.

  • voidedAtstring (date-time) or nullrequired

    When it was voided; null unless voided.

  • voidedBystring (uuid) or nullrequired

    Member who voided it; null unless voided.

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
  • 404 Not FoundACTIVITY_NOT_FOUNDThe activity does not exist or the key cannot see it.
  • 409 ConflictSTALE_REVISIONThe record changed after your read (expectedRevision); read it again and resend.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"ACTIVITY_ID="5d1e2f3a-4b5c-4d6e-8f70-81a2b3c4d5e6"curl -X PATCH "$BASE/lms/leads/$LEAD_ID/activities/$ACTIVITY_ID" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "activity": {      "activityType": "CONTACT",      "channel": "PHONE",      "contactId": "3a9b8c7d-6e5f-4a1b-9c2d-8e7f6a5b4c3d",      "direction": "INBOUND",      "note": "Asked for a callback after 6 pm.",      "occurredAt": "2026-12-01T09:45:22.000Z",      "outcome": "CONNECTED"    },    "correctionReason": "Logged against the wrong contact.",    "expectedRevision": 4  }'
Example response (200 OK) (200 OK)
{  "activityType": "CONTACT",  "actorId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",  "channel": "PHONE",  "contactId": "3a9b8c7d-6e5f-4a1b-9c2d-8e7f6a5b4c3d",  "createdAt": "2026-11-28T09:15:00.000Z",  "direction": "INBOUND",  "dueAt": "2026-12-02T06:30:00.000Z",  "id": "6012a2a4-2c62-484a-a221-badd894cec25",  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "note": "Asked for a callback after 6 pm.",  "occurredAt": "2026-12-01T09:45:22.000Z",  "outcome": "CONNECTED",  "recordedAt": "2026-12-01T10:00:00.000Z",  "revision": 4,  "updatedAt": "2026-12-01T10:00:00.000Z",  "voidReason": null,  "voidedAt": "2026-12-01T10:00:00.000Z",  "voidedBy": "09368ce5-e4bd-4d32-903f-077045cf1725"}

Void an activity

POST/v1/tenants/{tenantSlug}/lms/leads/{leadId}/activities/{activityId}/void

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.write

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

  • leadIdstring (uuid)required

    Lead ID.

  • activityIdstring (uuid)required

    Activity ID.

Request body (application/json)

  • expectedRevisionintegerrequired

    The activity's revision from your last read; 409 if it changed since.

    at least 0

    One of two concurrency tokens. Conventions

  • reasonstringrequired

    Why you are voiding it; kept in the audit trail.

    1–500 characters

Responses

The activity was voided.

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
  • 404 Not FoundACTIVITY_NOT_FOUNDThe activity does not exist or the key cannot see it.
  • 409 ConflictSTALE_REVISIONThe record changed after your read (expectedRevision); read it again and resend.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"ACTIVITY_ID="5d1e2f3a-4b5c-4d6e-8f70-81a2b3c4d5e6"curl -X POST "$BASE/lms/leads/$LEAD_ID/activities/$ACTIVITY_ID/void" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "expectedRevision": 4,    "reason": "Customer asked to be called next week."  }'

Get a lead's customer fields

GET/v1/tenants/{tenantSlug}/lms/leads/{leadId}/customer-fields

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.read

Returns the values of the campaign's customer form for this lead, with the form revision they were saved against.

Path parameters

  • leadIdstring (uuid)required

    Lead ID.

Responses

Customer field values.

  • leadIdstring (uuid)required

    Lead ID.

  • leadNamestring or nulloptional

    The lead's name, for display.

  • maskedFieldsarray of stringrequired

    Keys of fields whose values are hidden from the API key's acting member.

    default []

  • formobjectrequired

    The campaign's customer form.

  • valuesmap of any JSONrequired

    Current values keyed by field key.

  • updatedAtstring (date-time)required

    The lead's updatedAt. Send it as expectedUpdatedAt when saving.

Errors

  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.read scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"curl "$BASE/lms/leads/$LEAD_ID/customer-fields" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "leadName": "Asha Verma",  "maskedFields": [],  "form": {    "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",    "revision": 4,    "fields": [      {        "key": "roof_type",        "label": "Work",        "type": null,        "section": "Customer details",        "helpText": "",        "placeholder": "",        "required": false,        "editable": true,        "masked": false,        "active": true,        "options": []      }    ],    "updatedAt": "2026-12-01T10:00:00.000Z"  },  "values": {    "roofType": "Flat RCC roof"  },  "updatedAt": "2026-12-01T10:00:00.000Z"}

Save a lead's customer fields

PUT/v1/tenants/{tenantSlug}/lms/leads/{leadId}/customer-fields

{tenantSlug} is your workspace slug, the first part of your LMS web address.

Scope leads.write

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

  • leadIdstring (uuid)required

    Lead ID.

Request body (application/json)

  • campaignIdstring (uuid)optional

    Campaign whose form the values belong to; defaults to the lead's campaign.

  • expectedUpdatedAtstring (date-time)required

    The lead's updatedAt from your last read; 409 if it changed since.

    One of two concurrency tokens. Conventions

  • formRevisionintegerrequired

    The form revision you built the values against; 409 if the form changed since.

    at least 0

  • valuesany JSONrequired

    Values keyed by field key. Unknown and archived fields are refused.

Responses

The saved values.

  • leadIdstring (uuid)required

    Lead ID.

  • leadNamestring or nulloptional

    The lead's name, for display.

  • maskedFieldsarray of stringrequired

    Keys of fields whose values are hidden from the API key's acting member.

    default []

  • formobjectrequired

    The campaign's customer form.

  • valuesmap of any JSONrequired

    Current values keyed by field key.

  • updatedAtstring (date-time)required

    The lead's updatedAt. Send it as expectedUpdatedAt when saving.

Errors

  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the leads.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundLEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.
  • 409 ConflictSTALE_LEADThe lead changed after your read (expectedUpdatedAt); read it again and resend.

Also, like every operation: 401 invalid key, 429 rate limited and 500 unexpected error. Errors and retries

Request
BASE="https://lms.iotindia.ai/v1/tenants/your-workspace"LEAD_ID="0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"curl -X PUT "$BASE/lms/leads/$LEAD_ID/customer-fields" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",    "expectedUpdatedAt": "2026-12-01T10:00:00.000Z",    "formRevision": 1,    "values": {      "roofType": "Flat RCC roof"    }  }'
Example response (200 OK) (200 OK)
{  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "leadName": "Asha Verma",  "maskedFields": [],  "form": {    "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",    "revision": 4,    "fields": [      {        "key": "roof_type",        "label": "Work",        "type": null,        "section": "Customer details",        "helpText": "",        "placeholder": "",        "required": false,        "editable": true,        "masked": false,        "active": true,        "options": []      }    ],    "updatedAt": "2026-12-01T10:00:00.000Z"  },  "values": {    "roofType": "Flat RCC roof"  },  "updatedAt": "2026-12-01T10:00:00.000Z"}
    Leads API · IoTIndia developers