Skip to main content

Lead intake

Set up where leads come from: sources, field mappings, routing, imports and intake problems.

Set up a source

  1. Choose a source type.

    GETList source types

  2. Create the connection.

    POSTCreate a source connection

  3. Create and publish its field mapping.

    POSTCreate a field mappingPOSTPublish a field mapping

  4. Create and publish the routing that picks a campaign.

    POSTCreate a routing rulesetPOSTPublish a routing ruleset

  5. Turn the connection on and watch its health.

    PATCHUpdate a source connectionGETGet source health

List source types

GET/v1/tenants/{tenantSlug}/lms/source-definitions

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

Scope intake.readPaging Not paged

Lists the kinds of lead source you can connect (for example Meta Lead Ads, IndiaMART, Justdial or a website webhook), with how each one connects and what it needs before it can be used. Use a definition's key as sourceDefinitionKey when you create a source connection. Deprecated types are not returned.

Responses

Active source types.

An array, not paged. Each item:

  • availabilityenumrequired

    Whether this source type can be connected in your workspace.

    GENERALLY_AVAILABLE
    Connect it yourself, now.
    APP_APPROVAL_REQUIRED
    The provider must approve our app for your account first.
    PARTNER_AGREEMENT_REQUIRED
    Needs an agreement between IoTIndia and the provider.
    CUSTOMER_CREDENTIALS_REQUIRED
    You supply your own API credentials from the provider.
    MANUAL_IMPORT_ONLY
    No live connection; import files instead.
  • channelCapabilitiesarray of stringrequired

    Channels the source can deliver leads from.

  • connectionMechanismenumrequired

    How LMS receives leads: push from the sender, or polling.

    WEBHOOK
    The provider pushes each lead to a URL LMS gives you.
    POLL_API
    LMS fetches new leads from the provider's API.
    OAUTH_API
    LMS fetches leads after you sign in to the provider.
    PARTNER_FEED
    A feed arranged between IoTIndia and the provider.
    FILE_IMPORT
    You upload CSV or Excel files.
    GENERIC_WEBHOOK
    Any system posts leads to a URL, mapped by you.
    MANUAL_ENTRY
    People type leads into LMS.
  • credentialMechanismstringrequired

    How the source authenticates, for example an OAuth app or a signing secret.

  • displayNamestringrequired

    Name shown in the LMS.

  • keystringrequired

    Stable machine key. Unlike the label, it never changes.

  • maximumContractVersionintegerrequired

    Newest payload version LMS accepts from it.

  • minimumContractVersionintegerrequired

    Oldest payload version LMS accepts from it.

  • providerstringrequired

    System behind the source, for example meta or partner_api.

  • statusenumrequired

    Current status of the lead source definition.

    One ofACTIVEDEPRECATED

Errors

  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the intake.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 "$BASE/lms/source-definitions" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
[  {    "availability": "APP_APPROVAL_REQUIRED",    "channelCapabilities": [      "FACEBOOK",      "INSTAGRAM"    ],    "connectionMechanism": "WEBHOOK",    "credentialMechanism": "SECRET_REFERENCE",    "displayName": "Meta Lead Ads",    "key": "meta_lead_ads",    "maximumContractVersion": 1,    "minimumContractVersion": 1,    "provider": "META",    "status": "ACTIVE"  }]

List source connections

GET/v1/tenants/{tenantSlug}/lms/source-connections

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

Scope intake.readPaging Not paged

Lists every source connection in the workspace, oldest first. Configuration keys that look like credentials are never returned; secretConfigured tells you whether a credential is attached.

Responses

All source connections.

An array, not paged. Each item:

  • configurationmap of any JSONrequired

    Settings specific to this kind of source.

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • defaultCampaignIdstring (uuid) or nullrequired

    ID of the default campaign; null if none.

  • externalAccountIdstring or nullrequired

    ID of the external account; null if none.

  • externalAccountNamestring or nullrequired

    Name of the external account, as shown in the LMS.

  • idstring (uuid)required

    ID of the lead source connection.

  • namestringrequired

    Name of the lead source connection, as shown in the LMS.

  • secretConfiguredbooleanrequired

    Whether a secret is stored for it.

  • sourceDefinitionKeystringrequired

    Source type key, for example meta_lead_ads (see List source types).

  • statusenumrequired

    Current status of the lead source connection.

    DRAFT
    Being set up; not receiving leads.
    ACTIVE
    Receiving leads.
    PAUSED
    Stopped on purpose; leads are not taken in.
    ERROR
    Failing; see the last failure.
    DISCONNECTED
    The provider connection was lost; reconnect it.
    ARCHIVED
    Retired; kept for history.
  • tenantIdstring (uuid)required

    ID of the workspace.

  • updatedAtstring (date-time)required

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

Errors

  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the intake.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 "$BASE/lms/source-connections" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
[  {    "configuration": {      "pollIntervalMinutes": 15    },    "createdAt": "2026-11-28T09:15:00.000Z",    "defaultCampaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",    "externalAccountId": "GLID-4471923",    "externalAccountName": "Verma Solar Solutions",    "id": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",    "name": "IndiaMART · Pune",    "secretConfigured": true,    "sourceDefinitionKey": "indiamart",    "status": "ACTIVE",    "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",    "updatedAt": "2026-12-01T10:00:00.000Z"  }]

Create a source connection

POST/v1/tenants/{tenantSlug}/lms/source-connections

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

Scope intake.write

Connects a lead source of an active source type (see List source types). New connections start in DRAFT; set status to ACTIVE with Update a source connection once the mapping and routing are published.

  • configuration holds non-secret provider settings. A key that looks like a credential (token, password, secret, apiKey, accessToken) is rejected with 400.
  • secretReference attaches a credential your LMS administrator has stored in the platform's secret manager; it must be a secret-manager ARN and is never returned.
  • defaultCampaignId is where records go when no routing rule matches.

An unknown or deprecated sourceDefinitionKey returns 404. Connection names are unique among active connections: a duplicate name returns 409.

Request body (application/json)

  • configurationmap of any JSON valueoptional

    Settings specific to this kind of source.

    default {}

  • defaultCampaignIdstring (uuid) or nulloptional

    ID of the default campaign; null if none.

  • externalAccountIdstring or nulloptional

    ID of the external account; null if none.

    1–500 characters

  • externalAccountNamestring or nulloptional

    Name of the external account, as shown in the LMS.

    1–500 characters

  • namestringrequired

    Name of the source connection, as shown in the LMS.

    1–120 characters

  • secretReferencestring or nulloptional

    Reference to a stored secret; the secret itself is never returned.

    1–2000 characters

  • sourceDefinitionKeystringrequired

    Source type key, for example meta_lead_ads (see List source types).

    1–100 characters

Responses

The new source connection, in DRAFT.

Headers

  • Location URL of the new source connection.
  • configurationmap of any JSONrequired

    Settings specific to this kind of source.

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • defaultCampaignIdstring (uuid) or nullrequired

    ID of the default campaign; null if none.

  • externalAccountIdstring or nullrequired

    ID of the external account; null if none.

  • externalAccountNamestring or nullrequired

    Name of the external account, as shown in the LMS.

  • idstring (uuid)required

    ID of the lead source connection.

  • namestringrequired

    Name of the lead source connection, as shown in the LMS.

  • secretConfiguredbooleanrequired

    Whether a secret is stored for it.

  • sourceDefinitionKeystringrequired

    Source type key, for example meta_lead_ads (see List source types).

  • statusenumrequired

    Current status of the lead source connection.

    DRAFT
    Being set up; not receiving leads.
    ACTIVE
    Receiving leads.
    PAUSED
    Stopped on purpose; leads are not taken in.
    ERROR
    Failing; see the last failure.
    DISCONNECTED
    The provider connection was lost; reconnect it.
    ARCHIVED
    Retired; kept for history.
  • tenantIdstring (uuid)required

    ID of the workspace.

  • 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 intake.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundThe record does not exist or the key cannot see it.
  • 409 ConflictSOURCE_CONNECTION_NAME_CONFLICTAnother source connection already has this name.

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 POST "$BASE/lms/source-connections" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "sourceDefinitionKey": "indiamart",    "name": "IndiaMART · Pune",    "externalAccountId": "GLID-4471923",    "externalAccountName": "Verma Solar Solutions",    "defaultCampaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",    "configuration": {      "pollIntervalMinutes": 15    }  }'
Example response (201 Created) (201 Created)
{  "configuration": {    "pollIntervalMinutes": 15  },  "createdAt": "2026-11-28T09:15:00.000Z",  "defaultCampaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",  "externalAccountId": "GLID-4471923",  "externalAccountName": "Verma Solar Solutions",  "id": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",  "name": "IndiaMART · Pune",  "secretConfigured": false,  "sourceDefinitionKey": "indiamart",  "status": "DRAFT",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "updatedAt": "2026-12-01T10:00:00.000Z"}

Get a source connection

GET/v1/tenants/{tenantSlug}/lms/source-connections/{connectionId}

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

Scope intake.read

Returns one source connection: its source type, status, default campaign and non-secret configuration.

Path parameters

  • connectionIdstring (uuid)required

    Source connection ID.

Responses

The source connection.

  • configurationmap of any JSONrequired

    Settings specific to this kind of source.

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • defaultCampaignIdstring (uuid) or nullrequired

    ID of the default campaign; null if none.

  • externalAccountIdstring or nullrequired

    ID of the external account; null if none.

  • externalAccountNamestring or nullrequired

    Name of the external account, as shown in the LMS.

  • idstring (uuid)required

    ID of the lead source connection.

  • namestringrequired

    Name of the lead source connection, as shown in the LMS.

  • secretConfiguredbooleanrequired

    Whether a secret is stored for it.

  • sourceDefinitionKeystringrequired

    Source type key, for example meta_lead_ads (see List source types).

  • statusenumrequired

    Current status of the lead source connection.

    DRAFT
    Being set up; not receiving leads.
    ACTIVE
    Receiving leads.
    PAUSED
    Stopped on purpose; leads are not taken in.
    ERROR
    Failing; see the last failure.
    DISCONNECTED
    The provider connection was lost; reconnect it.
    ARCHIVED
    Retired; kept for history.
  • tenantIdstring (uuid)required

    ID of the workspace.

  • updatedAtstring (date-time)required

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

Errors

  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the intake.read scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundSOURCE_CONNECTION_NOT_FOUNDThe source connection 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"CONNECTION_ID="7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d"curl "$BASE/lms/source-connections/$CONNECTION_ID" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "configuration": {    "pollIntervalMinutes": 15  },  "createdAt": "2026-11-28T09:15:00.000Z",  "defaultCampaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",  "externalAccountId": "GLID-4471923",  "externalAccountName": "Verma Solar Solutions",  "id": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",  "name": "IndiaMART · Pune",  "secretConfigured": true,  "sourceDefinitionKey": "indiamart",  "status": "ACTIVE",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "updatedAt": "2026-12-01T10:00:00.000Z"}

Update a source connection

PATCH/v1/tenants/{tenantSlug}/lms/source-connections/{connectionId}

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

Scope intake.write

Changes a connection's name, account details, default campaign, configuration, credential reference or status (ACTIVE, PAUSED, ARCHIVED, …). Send only the fields to change; null clears a nullable field. configuration, when sent, replaces the whole object and follows the same no-secrets rule as on create. A name already used by another active connection returns 409.

Path parameters

  • connectionIdstring (uuid)required

    Source connection ID.

Request body (application/json)

  • configurationmap of any JSON valueoptional

    Settings specific to this kind of source.

  • defaultCampaignIdstring (uuid) or nulloptional

    ID of the default campaign; null if none.

  • externalAccountIdstring or nulloptional

    ID of the external account; null if none.

    1–500 characters

  • externalAccountNamestring or nulloptional

    Name of the external account, as shown in the LMS.

    1–500 characters

  • namestringoptional

    Name of the source connection, as shown in the LMS.

    1–120 characters

  • secretReferencestring or nulloptional

    Reference to a stored secret; the secret itself is never returned.

    1–2000 characters

  • statusenumoptional

    Current status of the source connection.

    DRAFT
    Being set up; not receiving leads.
    ACTIVE
    Receiving leads.
    PAUSED
    Stopped on purpose; leads are not taken in.
    ERROR
    Failing; see the last failure.
    DISCONNECTED
    The provider connection was lost; reconnect it.
    ARCHIVED
    Retired; kept for history.

Responses

The updated source connection.

  • configurationmap of any JSONrequired

    Settings specific to this kind of source.

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • defaultCampaignIdstring (uuid) or nullrequired

    ID of the default campaign; null if none.

  • externalAccountIdstring or nullrequired

    ID of the external account; null if none.

  • externalAccountNamestring or nullrequired

    Name of the external account, as shown in the LMS.

  • idstring (uuid)required

    ID of the lead source connection.

  • namestringrequired

    Name of the lead source connection, as shown in the LMS.

  • secretConfiguredbooleanrequired

    Whether a secret is stored for it.

  • sourceDefinitionKeystringrequired

    Source type key, for example meta_lead_ads (see List source types).

  • statusenumrequired

    Current status of the lead source connection.

    DRAFT
    Being set up; not receiving leads.
    ACTIVE
    Receiving leads.
    PAUSED
    Stopped on purpose; leads are not taken in.
    ERROR
    Failing; see the last failure.
    DISCONNECTED
    The provider connection was lost; reconnect it.
    ARCHIVED
    Retired; kept for history.
  • tenantIdstring (uuid)required

    ID of the workspace.

  • 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 intake.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundSOURCE_CONNECTION_NOT_FOUNDThe source connection does not exist or the key cannot see it.
  • 409 ConflictSOURCE_CONNECTION_NAME_CONFLICTAnother source connection already has this name.

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"CONNECTION_ID="7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d"curl -X PATCH "$BASE/lms/source-connections/$CONNECTION_ID" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "status": "ACTIVE",    "defaultCampaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f"  }'
Example response (200 OK) (200 OK)
{  "configuration": {    "pageId": "108231754529"  },  "createdAt": "2026-11-28T09:15:00.000Z",  "defaultCampaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",  "externalAccountId": "acct-1029",  "externalAccountName": "Verma Traders HQ",  "id": "23ffe624-524c-4d32-9425-1951bf45afc1",  "name": "Asha Verma",  "secretConfigured": false,  "sourceDefinitionKey": "indiamart",  "status": "DRAFT",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "updatedAt": "2026-12-01T10:00:00.000Z"}

Create a field mapping

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

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

Scope intake.write

Creates the field mapping for a source connection: how the provider's field names translate into lead fields. Each source connection has one mapping; creating a second returns 409.

Each rule copies one sourceField to a targetField, optionally trimmed or case-converted. Targets are lead.* profile fields, identity.phone / identity.email / identity.whatsapp, attribution.* acquisition details, routing.<name> values that routing rules can match on, and attributes.<name> custom attributes. A record missing a required field waits in NEEDS_MAPPING. Map a field to attribution.channel: records without a channel cannot become leads.

A mapping has one editable draft and a history of immutable published versions. Editing the draft changes nothing for incoming leads; they keep using the last published version until you publish again. The new draft has revision 1 and no published version. The response is the mapping draft: id, name, sourceConnectionId, rules, revision, status (ACTIVE or ARCHIVED), tenantId, createdAt and updatedAt.

Request body (application/json)

  • namestringrequired

    Name of the mapping draft, as shown in the LMS.

    1–120 characters

  • rulesarray of objectoptional

    Rules, checked in priority order; the first match wins.

    up to 500 items · default []

  • sourceConnectionIdstring (uuid)required

    ID of the source connection.

Responses

The new mapping draft.

Headers

  • Location URL of the new mapping.
  • idstring (uuid)required

    ID of the mapping draft.

  • tenantIdstring (uuid)required

    ID of the workspace.

  • namestringrequired

    Name of the mapping draft, as shown in the LMS.

  • revisionintegerrequired

    Revision number, increased on every change. Send it back as expectedRevision when you update.

    at least 0

  • sourceConnectionIdstring (uuid)required

    ID of the source connection.

  • statusenumrequired

    ARCHIVED drafts are kept for history.

    One ofACTIVEARCHIVED

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • updatedAtstring (date-time)required

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

  • rulesarray of objectrequired

    Rules, checked in priority order; the first match wins.

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 intake.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundThe record 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"curl -X POST "$BASE/lms/mappings" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "name": "IndiaMART enquiry fields",    "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",    "rules": [      {        "sourceField": "SENDER_NAME",        "targetField": "lead.fullName",        "required": true,        "transform": "TRIM"      },      {        "sourceField": "SENDER_MOBILE",        "targetField": "identity.phone",        "required": true,        "transform": "NONE"      },      {        "sourceField": "SENDER_EMAIL",        "targetField": "identity.email",        "required": false,        "transform": "LOWERCASE"      },      {        "sourceField": "SENDER_CITY",        "targetField": "lead.city",        "required": false,        "transform": "TRIM"      },      {        "sourceField": "QUERY_PRODUCT_NAME",        "targetField": "lead.productInterest",        "required": false,        "transform": "TRIM"      },      {        "sourceField": "QUERY_TYPE",        "targetField": "attribution.channel",        "required": true,        "transform": "UPPERCASE"      },      {        "sourceField": "SENDER_STATE",        "targetField": "routing.state",        "required": false,        "transform": "TRIM"      }    ]  }'
Example response (201 Created) (201 Created)
{  "id": "e3f4a5b6-c7d8-4e9f-8a0b-1c2d3e4f5a6b",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "name": "IndiaMART enquiry fields",  "revision": 1,  "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",  "status": "ACTIVE",  "rules": [    {      "sourceField": "SENDER_NAME",      "targetField": "lead.fullName",      "required": true,      "transform": "TRIM"    },    {      "sourceField": "SENDER_MOBILE",      "targetField": "identity.phone",      "required": true,      "transform": "NONE"    },    {      "sourceField": "QUERY_TYPE",      "targetField": "attribution.channel",      "required": true,      "transform": "UPPERCASE"    },    {      "sourceField": "SENDER_STATE",      "targetField": "routing.state",      "required": false,      "transform": "TRIM"    }  ],  "createdAt": "2026-11-20T06:30:00.000Z",  "updatedAt": "2026-11-20T06:30:00.000Z"}

Get a field mapping

GET/v1/tenants/{tenantSlug}/lms/mappings/{mappingId}

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

Scope intake.read

Returns the current draft of a field mapping. The response is the mapping draft: id, name, sourceConnectionId, rules, revision, status (ACTIVE or ARCHIVED), tenantId, createdAt and updatedAt. Use revision as expectedRevision when you update or publish it.

Path parameters

  • mappingIdstring (uuid)required

    Field mapping ID.

Responses

The mapping draft.

  • idstring (uuid)required

    ID of the mapping draft.

  • tenantIdstring (uuid)required

    ID of the workspace.

  • namestringrequired

    Name of the mapping draft, as shown in the LMS.

  • revisionintegerrequired

    Revision number, increased on every change. Send it back as expectedRevision when you update.

    at least 0

  • sourceConnectionIdstring (uuid)required

    ID of the source connection.

  • statusenumrequired

    ARCHIVED drafts are kept for history.

    One ofACTIVEARCHIVED

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • updatedAtstring (date-time)required

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

  • rulesarray of objectrequired

    Rules, checked in priority order; the first match wins.

Errors

  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the intake.read scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundMAPPING_NOT_FOUNDThe field mapping 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"MAPPING_ID="e3f4a5b6-c7d8-4e9f-8a0b-1c2d3e4f5a6b"curl "$BASE/lms/mappings/$MAPPING_ID" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "id": "e3f4a5b6-c7d8-4e9f-8a0b-1c2d3e4f5a6b",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "name": "IndiaMART enquiry fields",  "revision": 3,  "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",  "status": "ACTIVE",  "rules": [    {      "sourceField": "SENDER_NAME",      "targetField": "lead.fullName",      "required": true,      "transform": "TRIM"    },    {      "sourceField": "SENDER_MOBILE",      "targetField": "identity.phone",      "required": true,      "transform": "NONE"    },    {      "sourceField": "QUERY_TYPE",      "targetField": "attribution.channel",      "required": true,      "transform": "UPPERCASE"    },    {      "sourceField": "SENDER_STATE",      "targetField": "routing.state",      "required": false,      "transform": "TRIM"    }  ],  "createdAt": "2026-11-20T06:30:00.000Z",  "updatedAt": "2026-12-01T10:00:00.000Z"}

Update a field mapping draft

PATCH/v1/tenants/{tenantSlug}/lms/mappings/{mappingId}

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

Scope intake.write

Renames the draft or replaces its whole rules list; send at least one of the two. Each save increases revision. Send the draft's current revision as expectedRevision. If someone changed the draft since you read it, the request fails with 409 (STALE_REVISION) and nothing is saved: read it again and retry. A mapping has one editable draft and a history of immutable published versions. Editing the draft changes nothing for incoming leads; they keep using the last published version until you publish again. The response is the mapping draft: id, name, sourceConnectionId, rules, revision, status (ACTIVE or ARCHIVED), tenantId, createdAt and updatedAt.

Path parameters

  • mappingIdstring (uuid)required

    Field mapping ID.

Request body (application/json)

  • expectedRevisionintegerrequired

    The revision from your last read. If the record changed since, the request fails with 409 and nothing is saved.

    One of two concurrency tokens. Conventions

  • namestringoptional

    Name of the mapping draft, as shown in the LMS.

    1–120 characters

  • rulesarray of objectoptional

    Rules, checked in priority order; the first match wins.

    up to 500 items

Responses

The updated mapping draft.

  • idstring (uuid)required

    ID of the mapping draft.

  • tenantIdstring (uuid)required

    ID of the workspace.

  • namestringrequired

    Name of the mapping draft, as shown in the LMS.

  • revisionintegerrequired

    Revision number, increased on every change. Send it back as expectedRevision when you update.

    at least 0

  • sourceConnectionIdstring (uuid)required

    ID of the source connection.

  • statusenumrequired

    ARCHIVED drafts are kept for history.

    One ofACTIVEARCHIVED

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • updatedAtstring (date-time)required

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

  • rulesarray of objectrequired

    Rules, checked in priority order; the first match wins.

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 intake.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundMAPPING_NOT_FOUNDThe field mapping 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"MAPPING_ID="e3f4a5b6-c7d8-4e9f-8a0b-1c2d3e4f5a6b"curl -X PATCH "$BASE/lms/mappings/$MAPPING_ID" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "expectedRevision": 4,    "name": "Asha Verma",    "rules": [      {        "sourceField": "SENDER_NAME",        "targetField": "lead.fullName",        "required": false,        "transform": "NONE"      }    ]  }'
Example response (200 OK) (200 OK)
{  "id": "e3f4a5b6-c7d8-4e9f-8a0b-1c2d3e4f5a6b",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "name": "IndiaMART enquiry fields",  "revision": 4,  "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",  "status": "ACTIVE",  "rules": [    {      "sourceField": "SENDER_NAME",      "targetField": "lead.fullName",      "required": true,      "transform": "TRIM"    },    {      "sourceField": "SENDER_MOBILE",      "targetField": "identity.phone",      "required": true,      "transform": "NONE"    },    {      "sourceField": "QUERY_TYPE",      "targetField": "attribution.channel",      "required": true,      "transform": "UPPERCASE"    },    {      "sourceField": "SENDER_STATE",      "targetField": "routing.state",      "required": false,      "transform": "TRIM"    }  ],  "createdAt": "2026-11-20T06:30:00.000Z",  "updatedAt": "2026-12-01T10:00:00.000Z"}

Publish a field mapping

POST/v1/tenants/{tenantSlug}/lms/mappings/{mappingId}/publish

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

Scope intake.write

Freezes the current draft as the next numbered version. Records received from now on are mapped with it; records already processed keep the version they were mapped with (replay them to apply the new one). Send the draft's current revision as expectedRevision. If someone changed the draft since you read it, the request fails with 409 (STALE_REVISION) and nothing is saved: read it again and retry. The response is the published version: id, mappingDefinitionId, version, rules, publishedAt, publishedBy and tenantId.

Path parameters

  • mappingIdstring (uuid)required

    Field mapping ID.

Request body (application/json)

  • expectedRevisionintegerrequired

    The revision from your last read. If the record changed since, the request fails with 409 and nothing is saved.

    One of two concurrency tokens. Conventions

Responses

The published mapping version.

  • idstring (uuid)required

    ID of the mapping version.

  • tenantIdstring (uuid)required

    ID of the workspace.

  • mappingDefinitionIdstring (uuid)required

    ID of the mapping draft this was published from.

  • versionintegerrequired

    Version number, from 1.

  • rulesarray of objectrequired

    Rules, checked in priority order; the first match wins.

  • publishedAtstring (date-time)required

    When it was published (ISO 8601).

  • publishedBystring (uuid)required

    User ID of the member who published it.

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 intake.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundMAPPING_NOT_FOUNDThe field mapping 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"MAPPING_ID="e3f4a5b6-c7d8-4e9f-8a0b-1c2d3e4f5a6b"curl -X POST "$BASE/lms/mappings/$MAPPING_ID/publish" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "expectedRevision": 3  }'
Example response (201 Created) (201 Created)
{  "id": "c5d6e7f8-a9b0-4c1d-8e2f-3a4b5c6d7e8f",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "mappingDefinitionId": "e3f4a5b6-c7d8-4e9f-8a0b-1c2d3e4f5a6b",  "version": 2,  "rules": [    {      "sourceField": "SENDER_NAME",      "targetField": "lead.fullName",      "required": true,      "transform": "TRIM"    },    {      "sourceField": "SENDER_MOBILE",      "targetField": "identity.phone",      "required": true,      "transform": "NONE"    },    {      "sourceField": "QUERY_TYPE",      "targetField": "attribution.channel",      "required": true,      "transform": "UPPERCASE"    },    {      "sourceField": "SENDER_STATE",      "targetField": "routing.state",      "required": false,      "transform": "TRIM"    }  ],  "publishedAt": "2026-12-01T10:15:00.000Z",  "publishedBy": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a"}

Create a routing ruleset

POST/v1/tenants/{tenantSlug}/lms/routing-rulesets

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

Scope intake.write

Creates the routing ruleset for a source connection: which campaign each incoming record joins. Each source connection has one routing ruleset; creating a second returns 409.

A rule matches when all of its conditions hold. Conditions compare the routing.<name> values produced by the field mapping: use <name> as field, with EQUALS (one value) or IN (a list). The matching rule with the highest priority wins; if two matching rules share that priority the record waits in NEEDS_ROUTING. When nothing matches, the record goes to the connection's defaultCampaignId, or waits in NEEDS_ROUTING if there is none.

A routing ruleset has one editable draft and a history of immutable published versions. Editing the draft changes nothing for incoming leads; they keep using the last published version until you publish again. The new draft has revision 1. The response is the routing draft: id, name, sourceConnectionId, rules, revision, status (ACTIVE or ARCHIVED), tenantId, createdAt and updatedAt.

Request body (application/json)

  • namestringrequired

    Name of the routing ruleset, as shown in the LMS.

    1–120 characters

  • rulesarray of objectoptional

    Rules, checked in priority order; the first match wins.

    up to 500 items · default []

  • sourceConnectionIdstring (uuid)required

    ID of the source connection.

Responses

The new routing draft.

Headers

  • Location URL of the new routing ruleset.
  • idstring (uuid)required

    ID of the routing draft.

  • tenantIdstring (uuid)required

    ID of the workspace.

  • namestringrequired

    Name of the routing draft, as shown in the LMS.

  • revisionintegerrequired

    Revision number, increased on every change. Send it back as expectedRevision when you update.

    at least 0

  • sourceConnectionIdstring (uuid)required

    ID of the source connection.

  • statusenumrequired

    ARCHIVED drafts are kept for history.

    One ofACTIVEARCHIVED

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • updatedAtstring (date-time)required

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

  • rulesarray of objectrequired

    Rules, checked in priority order; the first match wins.

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 intake.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundThe record 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"curl -X POST "$BASE/lms/routing-rulesets" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "name": "IndiaMART by state",    "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",    "rules": [      {        "id": "a7b8c9d0-e1f2-4a3b-8c4d-5e6f7a8b9c0d",        "priority": 100,        "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",        "all": [          {            "field": "state",            "operator": "EQUALS",            "value": "Maharashtra"          }        ]      },      {        "id": "b8c9d0e1-f2a3-4b4c-9d5e-6f7a8b9c0d1e",        "priority": 50,        "campaignId": "3d4e5f6a-7b8c-4d9e-8f0a-2b3c4d5e6f7a",        "all": [          {            "field": "state",            "operator": "IN",            "value": [              "Gujarat",              "Goa"            ]          }        ]      }    ]  }'
Example response (201 Created) (201 Created)
{  "id": "f4a5b6c7-d8e9-4f0a-9b1c-2d3e4f5a6b7c",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "name": "IndiaMART by state",  "revision": 1,  "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",  "status": "ACTIVE",  "rules": [    {      "id": "a7b8c9d0-e1f2-4a3b-8c4d-5e6f7a8b9c0d",      "priority": 100,      "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",      "all": [        {          "field": "state",          "operator": "EQUALS",          "value": "Maharashtra"        }      ]    }  ],  "createdAt": "2026-11-20T06:35:00.000Z",  "updatedAt": "2026-11-20T06:35:00.000Z"}

Get a routing ruleset

GET/v1/tenants/{tenantSlug}/lms/routing-rulesets/{rulesetId}

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

Scope intake.read

Returns the current draft of a source connection's routing ruleset. The response is the routing draft: id, name, sourceConnectionId, rules, revision, status (ACTIVE or ARCHIVED), tenantId, createdAt and updatedAt. Use revision as expectedRevision when you update or publish it.

Path parameters

  • rulesetIdstring (uuid)required

    Ruleset ID.

Responses

The routing draft.

  • idstring (uuid)required

    ID of the routing draft.

  • tenantIdstring (uuid)required

    ID of the workspace.

  • namestringrequired

    Name of the routing draft, as shown in the LMS.

  • revisionintegerrequired

    Revision number, increased on every change. Send it back as expectedRevision when you update.

    at least 0

  • sourceConnectionIdstring (uuid)required

    ID of the source connection.

  • statusenumrequired

    ARCHIVED drafts are kept for history.

    One ofACTIVEARCHIVED

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • updatedAtstring (date-time)required

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

  • rulesarray of objectrequired

    Rules, checked in priority order; the first match wins.

Errors

  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the intake.read scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundThe record 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"ROUTING_RULESET_ID="f4a5b6c7-d8e9-4f0a-9b1c-2d3e4f5a6b7c"curl "$BASE/lms/routing-rulesets/$ROUTING_RULESET_ID" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "id": "f4a5b6c7-d8e9-4f0a-9b1c-2d3e4f5a6b7c",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "name": "IndiaMART by state",  "revision": 2,  "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",  "status": "ACTIVE",  "rules": [    {      "id": "a7b8c9d0-e1f2-4a3b-8c4d-5e6f7a8b9c0d",      "priority": 100,      "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",      "all": [        {          "field": "state",          "operator": "EQUALS",          "value": "Maharashtra"        }      ]    }  ],  "createdAt": "2026-11-20T06:35:00.000Z",  "updatedAt": "2026-12-01T10:05:00.000Z"}

Update a routing ruleset draft

PATCH/v1/tenants/{tenantSlug}/lms/routing-rulesets/{rulesetId}

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

Scope intake.write

Renames the draft or replaces its whole rules list; send at least one of the two. Each save increases revision. Send the draft's current revision as expectedRevision. If someone changed the draft since you read it, the request fails with 409 (STALE_REVISION) and nothing is saved: read it again and retry. A routing ruleset has one editable draft and a history of immutable published versions. Editing the draft changes nothing for incoming leads; they keep using the last published version until you publish again. The response is the routing draft: id, name, sourceConnectionId, rules, revision, status (ACTIVE or ARCHIVED), tenantId, createdAt and updatedAt.

Path parameters

  • rulesetIdstring (uuid)required

    Ruleset ID.

Request body (application/json)

  • expectedRevisionintegerrequired

    The revision from your last read. If the record changed since, the request fails with 409 and nothing is saved.

    One of two concurrency tokens. Conventions

  • namestringoptional

    Name of the routing ruleset, as shown in the LMS.

    1–120 characters

  • rulesarray of objectoptional

    Rules, checked in priority order; the first match wins.

    up to 500 items

Responses

The updated routing draft.

  • idstring (uuid)required

    ID of the routing draft.

  • tenantIdstring (uuid)required

    ID of the workspace.

  • namestringrequired

    Name of the routing draft, as shown in the LMS.

  • revisionintegerrequired

    Revision number, increased on every change. Send it back as expectedRevision when you update.

    at least 0

  • sourceConnectionIdstring (uuid)required

    ID of the source connection.

  • statusenumrequired

    ARCHIVED drafts are kept for history.

    One ofACTIVEARCHIVED

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • updatedAtstring (date-time)required

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

  • rulesarray of objectrequired

    Rules, checked in priority order; the first match wins.

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 intake.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundThe record 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"ROUTING_RULESET_ID="f4a5b6c7-d8e9-4f0a-9b1c-2d3e4f5a6b7c"curl -X PATCH "$BASE/lms/routing-rulesets/$ROUTING_RULESET_ID" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "expectedRevision": 4,    "name": "Asha Verma",    "rules": [      {        "id": "c1b9f521-fa8d-4032-968e-c348b2bded15",        "priority": 3,        "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",        "all": [          {            "field": "fullName",            "operator": "EQUALS",            "value": null          }        ]      }    ]  }'
Example response (200 OK) (200 OK)
{  "id": "f4a5b6c7-d8e9-4f0a-9b1c-2d3e4f5a6b7c",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "name": "IndiaMART by state",  "revision": 3,  "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",  "status": "ACTIVE",  "rules": [    {      "id": "a7b8c9d0-e1f2-4a3b-8c4d-5e6f7a8b9c0d",      "priority": 100,      "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",      "all": [        {          "field": "state",          "operator": "EQUALS",          "value": "Maharashtra"        }      ]    }  ],  "createdAt": "2026-11-20T06:35:00.000Z",  "updatedAt": "2026-12-01T10:05:00.000Z"}

Publish a routing ruleset

POST/v1/tenants/{tenantSlug}/lms/routing-rulesets/{rulesetId}/publish

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

Scope intake.write

Freezes the current draft, together with the connection's current default campaign, as the next numbered version; records received from now on are routed with it. Every target campaign must be active, in an active process and enabled for lead management, otherwise the request fails with 409 (CAMPAIGN_INELIGIBLE). Send the draft's current revision as expectedRevision. If someone changed the draft since you read it, the request fails with 409 (STALE_REVISION) and nothing is saved: read it again and retry. The response is the published version: id, routingRulesetId, version, rules, defaultCampaignId, publishedAt, publishedBy and tenantId.

Path parameters

  • rulesetIdstring (uuid)required

    Ruleset ID.

Request body (application/json)

  • expectedRevisionintegerrequired

    The revision from your last read. If the record changed since, the request fails with 409 and nothing is saved.

    One of two concurrency tokens. Conventions

Responses

The published routing version.

  • idstring (uuid)required

    ID of the routing version.

  • tenantIdstring (uuid)required

    ID of the workspace.

  • routingRulesetIdstring (uuid)required

    ID of the routing draft this was published from.

  • versionintegerrequired

    Version number, from 1.

  • rulesarray of objectrequired

    Rules, checked in priority order; the first match wins.

  • defaultCampaignIdstring (uuid) or nullrequired

    Campaign for leads no rule matches; null leaves them in Needs routing.

  • publishedAtstring (date-time)required

    When it was published (ISO 8601).

  • publishedBystring (uuid)required

    User ID of the member who published it.

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 intake.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundThe record 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"ROUTING_RULESET_ID="f4a5b6c7-d8e9-4f0a-9b1c-2d3e4f5a6b7c"curl -X POST "$BASE/lms/routing-rulesets/$ROUTING_RULESET_ID/publish" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "expectedRevision": 2  }'
Example response (201 Created) (201 Created)
{  "id": "d6e7f8a9-b0c1-4d2e-9f3a-4b5c6d7e8f90",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "routingRulesetId": "f4a5b6c7-d8e9-4f0a-9b1c-2d3e4f5a6b7c",  "version": 2,  "rules": [    {      "id": "a7b8c9d0-e1f2-4a3b-8c4d-5e6f7a8b9c0d",      "priority": 100,      "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",      "all": [        {          "field": "state",          "operator": "EQUALS",          "value": "Maharashtra"        }      ]    }  ],  "defaultCampaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",  "publishedAt": "2026-12-01T10:20:00.000Z",  "publishedBy": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a"}

Get source health

GET/v1/tenants/{tenantSlug}/lms/source-health

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

Scope intake.readPaging Not paged

Returns delivery and processing counters for each source connection: records received, accepted, duplicates, rejected, waiting for mapping or routing, and the last success and failure. Filter to one connection with sourceConnectionId.

Query parameters

  • sourceConnectionIdstring (uuid)optional

    ID of the source connection.

Responses

Health per source connection.

An array, not paged. Each item:

  • acceptedCountintegerrequired

    Number of accepted records.

    at least 0

  • checkpointPresentbooleanrequired

    Whether LMS has saved a polling position for this source.

  • connectionStatusstringrequired

    Whether the connection is ACTIVE, PAUSED or ARCHIVED.

  • connectorFailedCountintegerrequired

    Number of connector failed records.

    at least 0

  • connectorReceiptCountintegerrequired

    Number of connector receipt records.

    at least 0

  • duplicateCountintegerrequired

    Number of duplicate records.

    at least 0

  • failedCountintegerrequired

    Number of failed records.

    at least 0

  • healthStatusstringrequired

    Overall health: HEALTHY, DEGRADED or FAILING.

  • lastFailureCodestring or nullrequired

    Code of the most recent failure; null if none.

  • lastFailureSummarystring or nullrequired

    Plain-language summary of the most recent failure; null if none.

  • lastIntakeModestring or nullrequired

    How the most recent lead arrived: pushed by the sender or polled by LMS.

  • lastReceivedAtstring (date-time) or nullrequired

    When it was last received (ISO 8601); null if not yet.

  • lastSucceededAtstring (date-time) or nullrequired

    When it was last succeeded (ISO 8601); null if not yet.

  • needsMappingCountintegerrequired

    Number of needs mapping records.

    at least 0

  • needsRoutingCountintegerrequired

    Number of needs routing records.

    at least 0

  • pollRunCountintegerrequired

    Number of poll run records.

    at least 0

  • rawReceiptCountintegerrequired

    Number of raw receipt records.

    at least 0

  • rejectedCountintegerrequired

    Number of rejected records.

    at least 0

  • sourceConnectionIdstring (uuid)required

    ID of the source connection.

  • sourceConnectionNamestringrequired

    Name of the source connection, as shown in the LMS.

  • sourceDefinitionKeystringrequired

    Source type key, for example meta_lead_ads (see List source types).

  • statusstringrequired

    Current status of the source health.

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 intake.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 "$BASE/lms/source-health" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
[  {    "acceptedCount": 35,    "checkpointPresent": false,    "connectionStatus": "ACTIVE",    "connectorFailedCount": 0,    "connectorReceiptCount": 11,    "duplicateCount": 0,    "failedCount": 0,    "healthStatus": "HEALTHY",    "lastFailureCode": null,    "lastFailureSummary": null,    "lastIntakeMode": "WEBHOOK",    "lastReceivedAt": "2026-12-01T10:00:00.000Z",    "lastSucceededAt": "2026-12-01T10:00:00.000Z",    "needsMappingCount": 0,    "needsRoutingCount": 0,    "pollRunCount": 19,    "rawReceiptCount": 26,    "rejectedCount": 0,    "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",    "sourceConnectionName": "IndiaMART · Pune",    "sourceDefinitionKey": "indiamart",    "status": "ACTIVE"  }]

Search source health

GET/v1/tenants/{tenantSlug}/lms/source-health/directory

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

Scope intake.readPaging page number (page, pageSize)

Same counters as Get source health, with the source type's display name, sorted by connection name and paged by page number (50 per page; follow hasNextPage). q matches the connection or source type name. Archived connections are excluded unless includeArchived=1. hasSources is false only when the workspace has no sources at all, which helps you tell an empty search from an empty workspace.

Query parameters

  • includeArchivedenumoptional

    Include archived records (they are left out by default).

    One of01

    default "0"

    Lowercase values, unlike most enums here. Conventions

  • qstringoptional

    Free-text search; matches names and other visible text, case-insensitively.

    up to 200 characters · pattern ^[^\u0000-\u001f\u007f]*$

  • pageintegeroptional

    Page number, starting at 1.

    1–2147483647 · default 1

Responses

One page of source health.

  • hasNextPagebooleanrequired

    Whether it has next page.

  • hasSourcesbooleanrequired

    Whether it has sources.

  • itemsarray of objectrequired

    The records in this response, in the documented order.

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 intake.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 "$BASE/lms/source-health/directory" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "hasNextPage": false,  "hasSources": false,  "items": [    {      "acceptedCount": 35,      "checkpointPresent": false,      "connectionStatus": "ACTIVE",      "connectorFailedCount": 0,      "connectorReceiptCount": 11,      "duplicateCount": 0,      "failedCount": 0,      "healthStatus": "HEALTHY",      "lastFailureCode": null,      "lastFailureSummary": null,      "lastIntakeMode": "WEBHOOK",      "lastReceivedAt": "2026-12-01T10:00:00.000Z",      "lastSucceededAt": "2026-12-01T10:00:00.000Z",      "needsMappingCount": 0,      "needsRoutingCount": 0,      "pollRunCount": 19,      "rawReceiptCount": 26,      "rejectedCount": 0,      "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",      "sourceConnectionName": "IndiaMART · Pune",      "sourceDefinitionKey": "indiamart",      "status": "ACTIVE",      "sourceDefinitionName": "IndiaMART"    }  ]}

List records that need attention

GET/v1/tenants/{tenantSlug}/lms/source-records

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

Scope intake.readPaging cursor (items, nextCursor)

Lists source records stuck in one processingState (NEEDS_MAPPING, NEEDS_ROUTING, INVALID or PROCESSING_FAILED), optionally for one source connection. Paged with an opaque cursor: pass nextCursor back as cursor until it is null. Each item has id, providerRecordId, sourceConnectionId, processingState, currentRevisionSequence, firstReceivedAt, lastReceivedAt, providerSubmittedAt, createdAt and updatedAt. Fix the mapping or routing and Replay the record, or Route it by hand.

Query parameters

  • processingStateenumrequired

    Which stopped records to list: NEEDS_MAPPING, NEEDS_ROUTING, INVALID or PROCESSING_FAILED.

    One ofNEEDS_MAPPINGNEEDS_ROUTINGINVALIDPROCESSING_FAILED

  • sourceConnectionIdstring (uuid)optional

    Only records from this source.

  • 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 records: items and nextCursor.

  • 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 intake.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/source-records" \  --data-urlencode "limit=50" \  --data-urlencode "processingState=NEEDS_MAPPING" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "items": [    {      "id": "4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a",      "providerRecordId": "IM-2611-48213",      "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",      "processingState": "NEEDS_ROUTING",      "currentRevisionSequence": 1,      "firstReceivedAt": "2026-11-28T09:14:52.000Z",      "lastReceivedAt": "2026-11-28T09:14:52.000Z",      "providerSubmittedAt": "2026-11-28T09:14:40.000Z",      "createdAt": "2026-11-28T09:14:52.000Z",      "updatedAt": "2026-11-28T09:14:53.000Z"    }  ],  "nextCursor": null}

Get a source record

GET/v1/tenants/{tenantSlug}/lms/source-records/{sourceRecordId}

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

Scope intake.read

Returns one record as received from the provider, with its revisions (the extracted fields of each delivery), every routing decision, every replay attempt, the delivery it arrived in, and the lead it produced, if any.

Path parameters

  • sourceRecordIdstring (uuid)required

    Source record ID.

Responses

The source record.

  • connectionNamestringrequired

    Source name.

  • leadIdstring (uuid) or nullrequired

    Lead created or updated from it; null if none yet.

  • lineageobject or nullrequired

    Where the record came in.

  • processingStatestringrequired

    Where it is in intake: RECEIVED, VALIDATED, MAPPED, ROUTED, MATERIALIZED_AS_LEAD, or a stop: NEEDS_MAPPING, NEEDS_ROUTING, INVALID, PROCESSING_FAILED.

  • providerRecordIdstringrequired

    The record's ID in the sending system.

  • sourceConnectionIdstring (uuid)required

    Source ID.

  • sourceDefinitionKeystringrequired

    Source type key, for example meta_lead_ads.

  • sourceRecordIdstring (uuid)required

    Source record ID.

  • revisionsarray of objectrequired

    Every version of the record received, oldest first.

  • routingDecisionsarray of objectrequired

    Every routing decision, oldest first.

  • replayAttemptsarray of objectrequired

    Replays of the record, oldest first.

Errors

  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the intake.read scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundSOURCE_RECORD_NOT_FOUNDThe source record 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"SOURCE_RECORD_ID="4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a"curl "$BASE/lms/source-records/$SOURCE_RECORD_ID" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "connectionName": "IndiaMART · Pune",  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "lineage": {    "ingestionBatchId": "6568d3ec-a17f-4d0e-8de4-33212bc81a61",    "rawReceiptId": "fd65c878-a81a-4e06-bac3-f671202f2a65",    "sourceDeliveryId": "c3658fff-94bd-458a-8883-d006587142dd"  },  "processingState": "NEEDS_ROUTING",  "providerRecordId": "IM-2611-48213",  "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",  "sourceDefinitionKey": "indiamart",  "sourceRecordId": "4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a",  "revisions": [    {      "id": "278c4b82-de9b-4806-8a05-fab72e8ecfc5",      "revisionSequence": 1,      "validationResult": "VALID",      "platformReceivedAt": "2026-11-28T09:14:52.000Z",      "providerSubmittedAt": "2026-11-28T09:14:40.000Z",      "mappingVersionId": "26edeb30-6639-4e9a-9a09-24a528dacf49",      "providerSchemaVersion": "2024-06",      "extractedFields": {        "SENDER_NAME": "Asha Verma"      }    }  ],  "routingDecisions": [    {      "id": "b41736d5-1f9a-4bf2-91ba-2216f040e85d",      "decisionOrigin": "AUTOMATIC",      "decisionResult": "ROUTED",      "reasonCode": "MAPPING_FIXED",      "occurredAt": "2026-12-01T09:45:22.000Z",      "routingVersionId": "99ab92f4-1600-4496-b9fd-c021178f0bd9",      "selectedCampaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f"    }  ],  "replayAttempts": [    {      "id": "bb28a5ad-054d-4592-b0c9-dec23dac6b45",      "outcome": "COMPLETED",      "reason": "Customer asked to be called next week.",      "requestedAt": "2026-12-01T10:00:00.000Z",      "resultingLeadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10"    }  ]}

Replay a source record

POST/v1/tenants/{tenantSlug}/lms/source-records/{sourceRecordId}/replay

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

Scope intake.write

Processes a record again. versionSelection: CURRENT uses the latest published mapping and routing (typical after a fix); ORIGINAL uses the versions it was first processed with. revisionId picks a specific delivery of the record; by default the latest is used. reason is an upper-case code you choose (for example MAPPING_FIXED) that is stored with the decision. The response reports what happened: MATERIALIZED (a lead was created and lead.created is published), DUPLICATE (the record already produced a lead), or NEEDS_MAPPING / NEEDS_ROUTING with a reasonCode when it still cannot be processed.

Path parameters

  • sourceRecordIdstring (uuid)required

    Source record 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_:-]*$

  • revisionIdstring (uuid)optional

    ID of the revision.

  • versionSelectionenumrequired

    Replay the ORIGINAL payload or the CURRENT corrected revision.

    One ofORIGINALCURRENT

Responses

What happened to the record.

  • leadIdstring (uuid) or nullrequired

    ID of the lead; null if none.

  • reasonCodestring or nullrequired

    Machine-readable reason. Branch on this, not on the summary.

  • sourceRecordIdstring (uuid)required

    ID of the source record.

  • sourceRecordRevisionIdstring (uuid)required

    ID of the source record revision.

  • statusenumrequired

    Current status of the source.

    One ofMATERIALIZEDDUPLICATENEEDS_MAPPINGNEEDS_ROUTING

  • validationIssuesarray of any JSONrequired

    Problems found when the record was validated, if any.

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 intake.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundSOURCE_RECORD_NOT_FOUNDThe source record 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"SOURCE_RECORD_ID="4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a"curl -X POST "$BASE/lms/source-records/$SOURCE_RECORD_ID/replay" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "reason": "MAPPING_FIXED",    "versionSelection": "CURRENT"  }'
Example response (200 OK) (200 OK)
{  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "reasonCode": null,  "sourceRecordId": "4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a",  "sourceRecordRevisionId": "f6a7b8c9-d0e1-4f2a-9b3c-4d5e6f7a8b9c",  "status": "MATERIALIZED",  "validationIssues": []}

Route a source record by hand

POST/v1/tenants/{tenantSlug}/lms/source-records/{sourceRecordId}/route

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

Scope intake.write

Sends a record, typically one waiting in NEEDS_ROUTING, to the campaign you choose, using the published mapping it was received with. The decision is recorded as manual. reason is an upper-case code you choose (for example MAPPING_FIXED) that is stored with the decision. The response reports what happened: MATERIALIZED (a lead was created and lead.created is published), DUPLICATE (the record already produced a lead), or NEEDS_MAPPING / NEEDS_ROUTING with a reasonCode when it still cannot be processed.

Path parameters

  • sourceRecordIdstring (uuid)required

    Source record 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_:-]*$

  • revisionIdstring (uuid)optional

    ID of the revision.

Responses

What happened to the record.

  • leadIdstring (uuid) or nullrequired

    ID of the lead; null if none.

  • reasonCodestring or nullrequired

    Machine-readable reason. Branch on this, not on the summary.

  • sourceRecordIdstring (uuid)required

    ID of the source record.

  • sourceRecordRevisionIdstring (uuid)required

    ID of the source record revision.

  • statusenumrequired

    Current status of the source.

    One ofMATERIALIZEDDUPLICATENEEDS_MAPPINGNEEDS_ROUTING

  • validationIssuesarray of any JSONrequired

    Problems found when the record was validated, if any.

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 intake.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundSOURCE_RECORD_NOT_FOUNDThe source record 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"SOURCE_RECORD_ID="4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a"curl -X POST "$BASE/lms/source-records/$SOURCE_RECORD_ID/route" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",    "reason": "MANUAL_ROUTE"  }'
Example response (200 OK) (200 OK)
{  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "reasonCode": null,  "sourceRecordId": "4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a",  "sourceRecordRevisionId": "f6a7b8c9-d0e1-4f2a-9b3c-4d5e6f7a8b9c",  "status": "MATERIALIZED",  "validationIssues": []}

List intake exceptions

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

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

Scope intake.readPaging cursor in the X-Next-Cursor header

Lists everything that went wrong on the way in, newest first: records waiting for mapping or routing, permanently rejected deliveries and deliveries that need reconciliation. category=retryable returns what a replay can fix; category=correction returns what needs a change at the source. Filter by source connection, batch or source record. At most 50 per page: when there are more, the response carries an X-Next-Cursor header; pass it back as cursor.

Query parameters

  • batchIdstring (uuid)optional

    ID of the batch.

  • sourceConnectionIdstring (uuid)optional

    ID of the source connection.

  • sourceRecordIdstring (uuid)optional

    ID of the source record.

  • categoryenumoptional

    Category, from the values below.

    One ofretryablecorrection

    Lowercase values, unlike most enums here. Conventions

  • limitintegeroptional

    Maximum number of records to return in one page.

    1–100 · default 25

  • cursorstring (base64url)optional

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

    up to 256 characters · pattern ^[A-Za-z0-9_-]*$

Responses

One page of exceptions.

Headers

  • X-Next-Cursor Cursor for the next page. Absent on the last page.

An array, not paged. Each item:

  • attemptCountintegerrequired

    Number of attempt records.

    at least 0

  • batchIdstring (uuid)optional

    ID of the batch.

  • categorystringrequired

    Category, from the values below.

  • kindenumrequired

    Kind of lead exception.

    One ofSOURCE_RECORDPERMANENT_REJECTIONDELIVERY_RECONCILIATION

  • occurredAtstring (date-time)required

    When it happened (ISO 8601).

  • providerRecordIdstring or nullrequired

    ID of the provider record; null if none.

  • reasonCodestring or nullrequired

    Machine-readable reason. Branch on this, not on the summary.

  • receiptReceivedAtstring (date-time)required

    When it was receipt received (ISO 8601).

  • retryablebooleanrequired

    Whether replaying the record may succeed without changing it.

  • safeSummarystring or nullrequired

    Plain-language summary with personal data removed.

  • sourceConnectionIdstring (uuid)required

    ID of the source connection.

  • sourceConnectionNamestringrequired

    Name of the source connection, as shown in the LMS.

  • sourceRecordIdstring (uuid) or nullrequired

    ID of the source record; null if none.

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 intake.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/exceptions" \  --data-urlencode "limit=25" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
[  {    "attemptCount": 2,    "batchId": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",    "category": "NEEDS_ROUTING",    "kind": "SOURCE_RECORD",    "occurredAt": "2026-12-01T09:45:22.000Z",    "providerRecordId": "IM-2611-48213",    "reasonCode": "MAPPING_FIXED",    "receiptReceivedAt": "2026-12-01T10:00:00.000Z",    "retryable": false,    "safeSummary": "No routing rule matched the state Goa.",    "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",    "sourceConnectionName": "IndiaMART · Pune",    "sourceRecordId": "4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a"  }]

List delivery batches

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

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

Scope intake.readPaging Not paged

Lists delivery batches, newest first: webhook deliveries, poll runs and file imports, with counts of records received, accepted, duplicated, rejected and waiting for mapping or routing. Filter by sourceConnectionId or a single batchId. At most 50 batches are returned.

Query parameters

  • batchIdstring (uuid)optional

    ID of the batch.

  • sourceConnectionIdstring (uuid)optional

    ID of the source connection.

  • limitintegeroptional

    Maximum number of records to return in one page.

    1–100 · default 25

Responses

Recent batches.

An array, not paged. Each item:

  • fileNameany JSONrequired

    File name, as uploaded.

  • acceptedCountintegerrequired

    Number of accepted records.

    at least 0

  • attemptCountintegerrequired

    Number of attempt records.

    at least 0

  • batchIdstring (uuid)required

    ID of the batch.

  • completedAtstring (date-time) or nullrequired

    When it was completed (ISO 8601); null if not yet.

  • duplicateCountintegerrequired

    Number of duplicate records.

    at least 0

  • failedCountintegerrequired

    Number of failed records.

    at least 0

  • intakeModestringrequired

    How leads arrive: pushed by the sender or polled by LMS.

  • lastFailureCodestring or nullrequired

    Code of the most recent failure; null if none.

  • lastFailureSummarystring or nullrequired

    Plain-language summary of the most recent failure; null if none.

  • needsMappingCountintegerrequired

    Number of needs mapping records.

    at least 0

  • needsRoutingCountintegerrequired

    Number of needs routing records.

    at least 0

  • receivedCountintegerrequired

    Number of received records.

    at least 0

  • rejectedCountintegerrequired

    Number of rejected records.

    at least 0

  • sourceConnectionIdstring (uuid)required

    ID of the source connection.

  • sourceConnectionNamestringrequired

    Name of the source connection, as shown in the LMS.

  • startedAtstring (date-time)required

    When it was started (ISO 8601).

  • statusstringrequired

    Current status of the ingestion batch.

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 intake.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/batches" \  --data-urlencode "limit=25" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
[  {    "fileName": "leads-november.csv",    "acceptedCount": 35,    "attemptCount": 2,    "batchId": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",    "completedAt": "2026-12-01T09:45:22.000Z",    "duplicateCount": 0,    "failedCount": 0,    "intakeMode": "WEBHOOK",    "lastFailureCode": null,    "lastFailureSummary": null,    "needsMappingCount": 0,    "needsRoutingCount": 0,    "receivedCount": 39,    "rejectedCount": 0,    "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",    "sourceConnectionName": "IndiaMART · Pune",    "startedAt": "2026-12-01T09:42:10.000Z",    "status": "ACTIVE"  }]

Get a delivery batch

GET/v1/tenants/{tenantSlug}/lms/batches/{batchId}

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

Scope intake.read

Returns one batch with the same counters as List delivery batches, plus attempts (each processing attempt with attemptNumber, outcome, failureCode, safeErrorSummary, durationMs and completedAt, newest first) and sourceRecordIds (up to 50 records that arrived in it).

Path parameters

  • batchIdstring (uuid)required

    Batch ID.

Responses

The batch with its attempts and records.

  • fileNameany JSONrequired

    File name, as uploaded.

  • acceptedCountintegerrequired

    Number of accepted records.

    at least 0

  • attemptCountintegerrequired

    Number of attempt records.

    at least 0

  • batchIdstring (uuid)required

    ID of the batch.

  • completedAtstring (date-time) or nullrequired

    When it was completed (ISO 8601); null if not yet.

  • duplicateCountintegerrequired

    Number of duplicate records.

    at least 0

  • failedCountintegerrequired

    Number of failed records.

    at least 0

  • intakeModestringrequired

    How leads arrive: pushed by the sender or polled by LMS.

  • lastFailureCodestring or nullrequired

    Code of the most recent failure; null if none.

  • lastFailureSummarystring or nullrequired

    Plain-language summary of the most recent failure; null if none.

  • needsMappingCountintegerrequired

    Number of needs mapping records.

    at least 0

  • needsRoutingCountintegerrequired

    Number of needs routing records.

    at least 0

  • receivedCountintegerrequired

    Number of received records.

    at least 0

  • rejectedCountintegerrequired

    Number of rejected records.

    at least 0

  • sourceConnectionIdstring (uuid)required

    ID of the source connection.

  • sourceConnectionNamestringrequired

    Name of the source connection, as shown in the LMS.

  • startedAtstring (date-time)required

    When it was started (ISO 8601).

  • statusstringrequired

    Current status of the ingestion batch.

  • attemptsarray of objectrequired

    Processing attempts, newest first.

  • sourceRecordIdsarray of string (uuid)required

    Source records the batch produced.

Errors

  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the intake.read scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundBATCH_NOT_FOUNDThe batch 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"BATCH_ID="b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e"curl "$BASE/lms/batches/$BATCH_ID" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "fileName": null,  "acceptedCount": 11,  "attemptCount": 1,  "batchId": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",  "completedAt": "2026-11-28T09:15:04.000Z",  "duplicateCount": 0,  "failedCount": 0,  "intakeMode": "WEBHOOK",  "lastFailureCode": null,  "lastFailureSummary": null,  "needsMappingCount": 0,  "needsRoutingCount": 1,  "receivedCount": 12,  "rejectedCount": 0,  "sourceConnectionId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",  "sourceConnectionName": "IndiaMART · Pune",  "startedAt": "2026-11-28T09:14:52.000Z",  "status": "COMPLETED",  "attempts": [    {      "attemptNumber": 1,      "outcome": "COMPLETED",      "failureCode": null,      "safeErrorSummary": null,      "durationMs": 1200,      "completedAt": "2026-11-28T09:15:04.000Z"    }  ],  "sourceRecordIds": [    "4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a"  ]}

Preview a spreadsheet import

POST/v1/tenants/{tenantSlug}/lms/imports/preview

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

Scope intake.write

Reads a CSV or Excel (.xlsx) file and shows what importing it into a campaign would do, without saving anything. Send the file as base64 in file.content (up to 2 MB and 500 rows; larger bodies return 413).

Columns are matched to lead fields automatically; override the match with mapping, from a field key (fullName, companyName, phone, email, productInterest, inquirySummary, city, state, country or a customer-form field) to a zero-based column index. For workbooks, sheetName picks the sheet.

The response lists each row with its errors and whether it duplicates an existing lead, plus a reviewToken to pass to Import a spreadsheet. The campaign must be active and enabled for lead management (409 otherwise).

Request body (application/json)

  • fileobjectrequired

    The spreadsheet (.xlsx or .csv).

  • campaignIdstring (uuid)required

    ID of the campaign.

  • sheetNamestringoptional

    Name of the worksheet.

    up to 200 characters

  • mappingmap of integeroptional

    Lead field → column index.

Responses

What the import would do.

  • fileNamestringrequired

    Uploaded file name.

  • campaignIdstring (uuid)required

    Campaign the leads go into.

  • campaignNamestringrequired

    Campaign name.

  • sheetNamestringrequired

    Sheet read from the workbook.

  • sheetNamesarray of stringrequired

    All sheets in the workbook.

  • columnsarray of stringrequired

    Column headings found in the sheet.

  • mappingmap of numberrequired

    Lead field → column index used for the import.

  • targetsarray of objectrequired

    Lead fields a column can be mapped to.

  • rowsarray of objectrequired

    First rows as they would be imported.

  • rowCountnumberrequired

    Rows in the sheet.

  • validCountnumberrequired

    Rows that would be imported.

  • invalidCountnumberrequired

    Rows that would be refused.

  • duplicateCountnumberrequired

    Rows that match existing leads.

  • reviewTokenstringrequired

    Send it with Import a spreadsheet to import exactly this preview.

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 intake.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundThe record 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.
  • 413 Content Too LargeREQUEST_BODY_TOO_LARGEThe upload is too large.

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 POST "$BASE/lms/imports/preview" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",    "file": {      "fileName": "pune-rooftop-leads.csv",      "content": "bmFtZSxwaG9uZSxwcm9kdWN0CkFzaGEgVmVybWEsKzkxOTgxMjM0NTY3OCxSb29mdG9wIHNvbGFyIDUga1cKUm9oaXQgS3Vsa2FybmksKzkxOTgyMzQ1Njc4OSxSb29mdG9wIHNvbGFyIDMga1cK"    },    "mapping": {      "fullName": 0,      "phone": 1,      "productInterest": 2    }  }'
Example response (200 OK) (200 OK)
{  "fileName": "leads-november.csv",  "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",  "campaignName": "Pune rooftop launch",  "sheetName": "Leads",  "sheetNames": [    "Leads"  ],  "columns": [    "Full name"  ],  "mapping": {    "roofType": 1  },  "targets": [    {      "key": "roof_type",      "label": "Work",      "required": false,      "hint": "Looks like a phone number"    }  ],  "rows": [    {      "rowNumber": 1,      "fullName": "Asha Verma",      "companyName": "Verma Traders",      "phone": "+919812345678",      "productInterest": "Rooftop solar, 5 kW",      "errors": [        "Phone number is missing."      ],      "duplicate": false    }  ],  "rowCount": 22,  "validCount": 13,  "invalidCount": 0,  "duplicateCount": 0,  "reviewToken": "rvw_5f2c9a1e7b"}

Import a spreadsheet

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

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

Scope intake.write

Creates leads from a previewed file. Send the same file, campaignId, sheetName and mapping you previewed, plus the preview's reviewToken. All rows are imported in one transaction: if any row is invalid, nothing is imported.

  • If the file or the campaign's customer form changed since the preview, the request fails with 409 (IMPORT_REVIEW_CHANGED): preview again.
  • Rows that match an existing lead are recorded on it as repeat enquiries (lead.repeat_enquiry) instead of creating a lead; new leads publish lead.created.
  • Sending the same request again is safe: it returns the original batch with alreadyImported: true.

Request body (application/json)

  • fileobjectrequired

    The spreadsheet (.xlsx or .csv).

  • campaignIdstring (uuid)required

    ID of the campaign.

  • sheetNamestringoptional

    Name of the worksheet.

    up to 200 characters

  • mappingmap of integeroptional

    Lead field → column index.

  • reviewTokenstringrequired

    Token from the preview; it ties the import to exactly what you reviewed.

    pattern ^[a-f0-9]{64}$

Responses

The import result.

  • batchIdstring (uuid)required

    ID of the batch.

  • fileNamestringrequired

    File name, as uploaded.

  • campaignIdstring (uuid)required

    ID of the campaign.

  • createdCountnumberrequired

    Number of created records.

  • duplicateCountnumberrequired

    Number of duplicate records.

  • alreadyImportedbooleanrequired

    true when this exact preview was imported before; nothing was imported twice.

  • leadsarray of objectrequired

    Leads created, by sheet row.

  • repeatEnquiryCountintegeroptional

    Number of repeat enquiry records.

    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 intake.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundThe record 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.
  • 413 Content Too LargeREQUEST_BODY_TOO_LARGEThe upload is too large.

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 POST "$BASE/lms/imports" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",    "file": {      "fileName": "pune-rooftop-leads.csv",      "content": "bmFtZSxwaG9uZSxwcm9kdWN0CkFzaGEgVmVybWEsKzkxOTgxMjM0NTY3OCxSb29mdG9wIHNvbGFyIDUga1cKUm9oaXQgS3Vsa2FybmksKzkxOTgyMzQ1Njc4OSxSb29mdG9wIHNvbGFyIDMga1cK"    },    "mapping": {      "fullName": 0,      "phone": 1,      "productInterest": 2    },    "reviewToken": "9f2c4e6a8b0d1f3e5a7c9b1d3f5e7a9c0b2d4f6e8a0c2e4f6a8b0d2f4e6a8c0b"  }'
Example response (200 OK) (200 OK)
{  "batchId": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",  "fileName": "pune-rooftop-leads.csv",  "campaignId": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",  "createdCount": 2,  "duplicateCount": 0,  "alreadyImported": false,  "leads": [    {      "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",      "rowNumber": 2,      "fullName": "Asha Verma",      "companyName": ""    },    {      "leadId": "1c7d8b63-5a1f-4d2b-8e54-4a3b8d2f0c21",      "rowNumber": 3,      "fullName": "Rohit Kulkarni",      "companyName": ""    }  ],  "repeatEnquiryCount": 0}
    Lead intake API · IoTIndia developers