Skip to main content

Ownership

Pipeline stages, segments, segmentation and allocation rules.

List pipeline stages

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

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

Scope ownership.readPaging Not paged

Lists the pipeline stages of a process in display order, including inactive ones. Each stage maps to a fixed semanticCategory (NEW, OPEN, CONTACTED, QUALIFIED, CONVERTED, LOST, DISQUALIFIED) that reports and events use, so stage names can differ between processes.

Query parameters

  • processIdstring (uuid)required

    ID of the process.

Responses

The process's stages.

An array, not paged. Each item:

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • displayOrderintegerrequired

    Position in lists; lower numbers come first.

    at least 0

  • idstring (uuid)required

    ID of the stage.

  • isActivebooleanrequired

    Whether it is active.

  • isInitialbooleanrequired

    Whether it is initial.

  • namestringrequired

    Name of the stage, as shown in the LMS.

  • processIdstring (uuid)required

    ID of the process.

  • semanticCategoryenumrequired
    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).
  • 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 ownership.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/stages" \  --data-urlencode "processId=3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
[  {    "createdAt": "2026-11-28T09:15:00.000Z",    "displayOrder": 3,    "id": "5d1f2e3a-9b8c-4d7e-a6f5-1c2b3a4d5e6f",    "isActive": true,    "isInitial": false,    "name": "Site survey booked",    "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",    "semanticCategory": "QUALIFIED",    "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",    "updatedAt": "2026-12-01T10:00:00.000Z"  }]

Create a pipeline stage

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

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

Scope ownership.write

Adds a stage to a process. A process has exactly one active initial stage, where new leads start. Stage names are unique among a process's active stages (409 STAGE_NAME_CONFLICT).

  • An ordinary stage: leave isInitial out (as in the example).
  • A new initial stage in place of the current one: send isInitial: true and replaceInitial: true. With isInitial alone the request fails with 409 INITIAL_STAGE_CONFLICT.

Request body (application/json)

  • displayOrderintegerrequired

    Position in lists; lower numbers come first.

    at least 0

  • isActivebooleanoptional

    Whether it is active.

    default true

  • isInitialbooleanoptional

    Whether it is initial.

    default false

  • namestringrequired

    Name of the stage, as shown in the LMS.

    1–120 characters

  • processIdstring (uuid)required

    ID of the process.

  • replaceInitialalways trueoptional

    Send true to make this the initial stage in place of the current one; otherwise a second initial stage is refused.

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

Responses

The new stage.

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • displayOrderintegerrequired

    Position in lists; lower numbers come first.

    at least 0

  • idstring (uuid)required

    ID of the stage.

  • isActivebooleanrequired

    Whether it is active.

  • isInitialbooleanrequired

    Whether it is initial.

  • namestringrequired

    Name of the stage, as shown in the LMS.

  • processIdstring (uuid)required

    ID of the process.

  • semanticCategoryenumrequired
    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).
  • 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 ownership.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 ConflictSTAGE_NAME_CONFLICTAnother stage already has this name.
  • 409 ConflictINITIAL_STAGE_CONFLICTThe process already has an initial stage; clear it or send replaceInitial.

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/stages" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",    "name": "Site survey booked",    "semanticCategory": "QUALIFIED",    "displayOrder": 3  }'
Example response (201 Created) (201 Created)
{  "createdAt": "2026-11-28T09:15:00.000Z",  "displayOrder": 3,  "id": "5d1f2e3a-9b8c-4d7e-a6f5-1c2b3a4d5e6f",  "isActive": true,  "isInitial": false,  "name": "Site survey booked",  "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",  "semanticCategory": "QUALIFIED",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "updatedAt": "2026-12-01T10:00:00.000Z"}

Update a pipeline stage

PATCH/v1/tenants/{tenantSlug}/lms/stages/{stageId}

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

Scope ownership.write

Renames, reorders, recategorises, activates or deactivates a stage. Send only the fields to change. To move the initial flag to this stage, send isInitial: true with replaceInitial: true (it must also be active); the previous initial stage loses the flag in the same change.

Path parameters

  • stageIdstring (uuid)required

    Stage ID.

Request body (application/json)

  • displayOrderintegeroptional

    Position in lists; lower numbers come first.

    at least 0

  • isActivebooleanoptional

    Whether it is active.

  • isInitialbooleanoptional

    Whether it is initial.

  • namestringoptional

    Name of the stage, as shown in the LMS.

    1–120 characters

  • replaceInitialalways trueoptional

    Send true to make this the initial stage in place of the current one; otherwise a second initial stage is refused.

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

Responses

The updated stage.

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • displayOrderintegerrequired

    Position in lists; lower numbers come first.

    at least 0

  • idstring (uuid)required

    ID of the stage.

  • isActivebooleanrequired

    Whether it is active.

  • isInitialbooleanrequired

    Whether it is initial.

  • namestringrequired

    Name of the stage, as shown in the LMS.

  • processIdstring (uuid)required

    ID of the process.

  • semanticCategoryenumrequired
    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).
  • 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 ownership.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundSTAGE_NOT_FOUNDThe stage does not exist or the key cannot see it.
  • 409 ConflictSTAGE_NAME_CONFLICTAnother stage already has this name.
  • 409 ConflictINITIAL_STAGE_CONFLICTThe process already has an initial stage; clear it or send replaceInitial.

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"STAGE_ID="5d1f2e3a-9b8c-4d7e-a6f5-1c2b3a4d5e6f"curl -X PATCH "$BASE/lms/stages/$STAGE_ID" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "name": "Survey scheduled",    "displayOrder": 4  }'
Example response (200 OK) (200 OK)
{  "createdAt": "2026-11-28T09:15:00.000Z",  "displayOrder": 1,  "id": "5d1f2e3a-9b8c-4d7e-a6f5-1c2b3a4d5e6f",  "isActive": true,  "isInitial": false,  "name": "Qualified",  "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",  "semanticCategory": "NEW",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "updatedAt": "2026-12-01T10:00:00.000Z"}

List segments

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

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

Scope ownership.readPaging Not paged

Lists all segments, active and archived, in display order, optionally for one process. Segments label what kind of lead something is (for example *High-value residential*); segmentation rules assign them. For large workspaces use List segments (paged).

Query parameters

  • processIdstring (uuid)optional

    ID of the process.

Responses

All matching segments.

An array, not paged. Each item:

  • colorTokenenumrequired

    Colour used to show it in the LMS.

    One ofSLATEAMBERLIMEROSESKYVIOLET

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • descriptionstring or nullrequired

    Free-text description.

  • displayOrderintegerrequired

    Position in lists; lower numbers come first.

    at least 0

  • idstring (uuid)required

    ID of the lead segment.

  • namestringrequired

    Name of the lead segment, as shown in the LMS.

  • processIdstring (uuid)required

    ID of the process.

  • statusenumrequired

    Current status of the lead segment.

    One ofACTIVEARCHIVED

  • 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 ownership.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/segments" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
[  {    "colorToken": "AMBER",    "createdAt": "2026-11-28T09:15:00.000Z",    "description": "Homes with a monthly bill above ₹5,000.",    "displayOrder": 1,    "id": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e",    "name": "High-value residential",    "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",    "status": "ACTIVE",    "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",    "updatedAt": "2026-12-01T10:00:00.000Z"  }]

Create a segment

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

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

Scope ownership.write

Adds a segment to a process. colorToken defaults to SLATE and displayOrder to 0. Segment names are unique among a process's active segments (409). The segment is not used until a published segmentation ruleset refers to it or someone sets it on a lead.

Request body (application/json)

  • colorTokenenumoptional

    Colour used to show it in the LMS.

    One ofSLATEAMBERLIMEROSESKYVIOLET

  • descriptionstring or nulloptional

    Free-text description.

    up to 500 characters

  • displayOrderintegeroptional

    Position in lists; lower numbers come first.

    0–10000

  • namestringrequired

    Name of the segment, as shown in the LMS.

    1–120 characters

  • processIdstring (uuid)required

    ID of the process.

Responses

The new segment.

  • colorTokenenumrequired

    Colour used to show it in the LMS.

    One ofSLATEAMBERLIMEROSESKYVIOLET

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • descriptionstring or nullrequired

    Free-text description.

  • displayOrderintegerrequired

    Position in lists; lower numbers come first.

    at least 0

  • idstring (uuid)required

    ID of the lead segment.

  • namestringrequired

    Name of the lead segment, as shown in the LMS.

  • processIdstring (uuid)required

    ID of the process.

  • statusenumrequired

    Current status of the lead segment.

    One ofACTIVEARCHIVED

  • 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 ownership.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 409 ConflictSEGMENT_NAME_CONFLICTAnother segment 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/segments" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",    "name": "High-value residential",    "description": "Homes with a monthly bill above ₹5,000.",    "colorToken": "AMBER",    "displayOrder": 1  }'
Example response (201 Created) (201 Created)
{  "colorToken": "AMBER",  "createdAt": "2026-11-28T09:15:00.000Z",  "description": "Homes with a monthly bill above ₹5,000.",  "displayOrder": 1,  "id": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e",  "name": "High-value residential",  "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",  "status": "ACTIVE",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "updatedAt": "2026-12-01T10:00:00.000Z"}

List segments (paged)

GET/v1/tenants/{tenantSlug}/lms/segments/page

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

Scope ownership.readPaging cursor (items, nextCursor)

Lists segments in display order, filtered by process and status (ACTIVE or ARCHIVED). Paged with an opaque cursor: pass nextCursor back as cursor until it is null.

Query parameters

  • processIdstring (uuid)optional

    ID of the process.

  • statusenumoptional

    Current status of the segment.

    One ofACTIVEARCHIVED

  • cursorstringoptional

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

    1–1000 characters

  • limitintegeroptional

    Maximum number of records to return in one page.

    1–100 · default 50

Responses

One page of segments.

  • 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 ownership.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/segments/page" \  --data-urlencode "limit=50" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "items": [    {      "colorToken": "AMBER",      "createdAt": "2026-11-28T09:15:00.000Z",      "description": "Homes with a monthly bill above ₹5,000.",      "displayOrder": 1,      "id": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e",      "name": "High-value residential",      "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",      "status": "ACTIVE",      "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",      "updatedAt": "2026-12-01T10:00:00.000Z"    }  ],  "nextCursor": null}

Look up segments by ID

GET/v1/tenants/{tenantSlug}/lms/segments/lookup

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

Scope ownership.readPaging Not paged

Returns the segments with the given IDs, active or archived, so you can label leads that reference them. Repeat the segmentId query parameter for each ID (?segmentId=…&segmentId=…, 1 to 100 IDs); duplicates are ignored and unknown IDs are left out. For long lists use the QUERY form of this operation.

Responses

The segments found.

An array, not paged. Each item:

  • colorTokenenumrequired

    Colour used to show it in the LMS.

    One ofSLATEAMBERLIMEROSESKYVIOLET

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • descriptionstring or nullrequired

    Free-text description.

  • displayOrderintegerrequired

    Position in lists; lower numbers come first.

    at least 0

  • idstring (uuid)required

    ID of the lead segment.

  • namestringrequired

    Name of the lead segment, as shown in the LMS.

  • processIdstring (uuid)required

    ID of the process.

  • statusenumrequired

    Current status of the lead segment.

    One ofACTIVEARCHIVED

  • 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 ownership.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/segments/lookup" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
[  {    "colorToken": "SLATE",    "createdAt": "2026-11-28T09:15:00.000Z",    "description": "Leads from the IndiaMART enquiry inbox.",    "displayOrder": 1,    "id": "59646b6a-4fde-40b8-bc48-828f2435aff9",    "name": "Asha Verma",    "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",    "status": "ACTIVE",    "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",    "updatedAt": "2026-12-01T10:00:00.000Z"  }]

Look up segments by ID (query)

QUERY/v1/tenants/{tenantSlug}/lms/segments/lookup

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

Scope ownership.readPaging Not paged

Same as Look up segments by ID, with the IDs sent as segmentIds in a JSON body using the HTTP QUERY method (safe and idempotent, like GET). Send Content-Type: application/json.

Request body (application/json)

  • segmentIdsarray of string (uuid)required

    IDs of the segment records.

    up to 100 items

Responses

The segments found.

An array, not paged. Each item:

  • colorTokenenumrequired

    Colour used to show it in the LMS.

    One ofSLATEAMBERLIMEROSESKYVIOLET

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • descriptionstring or nullrequired

    Free-text description.

  • displayOrderintegerrequired

    Position in lists; lower numbers come first.

    at least 0

  • idstring (uuid)required

    ID of the lead segment.

  • namestringrequired

    Name of the lead segment, as shown in the LMS.

  • processIdstring (uuid)required

    ID of the process.

  • statusenumrequired

    Current status of the lead segment.

    One ofACTIVEARCHIVED

  • 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 ownership.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/segments/lookup" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "segmentIds": [      "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e",      "6b7c8d9e-0f1a-4b2c-9d3e-4f5a6b7c8d9f"    ]  }'
Example response (200 OK) (200 OK)
[  {    "colorToken": "AMBER",    "createdAt": "2026-11-28T09:15:00.000Z",    "description": "Homes with a monthly bill above ₹5,000.",    "displayOrder": 1,    "id": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e",    "name": "High-value residential",    "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",    "status": "ACTIVE",    "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",    "updatedAt": "2026-12-01T10:00:00.000Z"  }]

Update a segment

PATCH/v1/tenants/{tenantSlug}/lms/segments/{segmentId}

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

Scope ownership.write

Changes a segment's name, description, colour or display order. Send only the fields to change. Archived segments cannot be changed (409).

Path parameters

  • segmentIdstring (uuid)required

    Segment ID.

Request body (application/json)

  • colorTokenenumoptional

    Colour used to show it in the LMS.

    One ofSLATEAMBERLIMEROSESKYVIOLET

  • descriptionstring or nulloptional

    Free-text description.

    up to 500 characters

  • displayOrderintegeroptional

    Position in lists; lower numbers come first.

    0–10000

  • namestringoptional

    Name of the segment, as shown in the LMS.

    1–120 characters

Responses

The updated segment.

  • colorTokenenumrequired

    Colour used to show it in the LMS.

    One ofSLATEAMBERLIMEROSESKYVIOLET

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • descriptionstring or nullrequired

    Free-text description.

  • displayOrderintegerrequired

    Position in lists; lower numbers come first.

    at least 0

  • idstring (uuid)required

    ID of the lead segment.

  • namestringrequired

    Name of the lead segment, as shown in the LMS.

  • processIdstring (uuid)required

    ID of the process.

  • statusenumrequired

    Current status of the lead segment.

    One ofACTIVEARCHIVED

  • 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 ownership.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundSEGMENT_NOT_FOUNDThe segment does not exist or the key cannot see it.
  • 409 ConflictSEGMENT_NAME_CONFLICTAnother segment 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"SEGMENT_ID="5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e"curl -X PATCH "$BASE/lms/segments/$SEGMENT_ID" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "colorToken": "SLATE",    "description": "Leads from the IndiaMART enquiry inbox.",    "displayOrder": 1,    "name": "Asha Verma"  }'
Example response (200 OK) (200 OK)
{  "colorToken": "SLATE",  "createdAt": "2026-11-28T09:15:00.000Z",  "description": "Leads from the IndiaMART enquiry inbox.",  "displayOrder": 1,  "id": "59646b6a-4fde-40b8-bc48-828f2435aff9",  "name": "Asha Verma",  "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",  "status": "ACTIVE",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "updatedAt": "2026-12-01T10:00:00.000Z"}

Archive a segment

POST/v1/tenants/{tenantSlug}/lms/segments/{segmentId}/archive

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

Scope ownership.write

Archives a segment so it can no longer be chosen. Leads already in it keep it. A segment that the current published segmentation version still uses cannot be archived: the request fails with 409 (SEGMENT_IN_USE) and lists the rulesets in details.rulesetIds. Archiving an archived segment returns it unchanged. No request body.

Path parameters

  • segmentIdstring (uuid)required

    Segment ID.

Responses

The archived segment.

  • colorTokenenumrequired

    Colour used to show it in the LMS.

    One ofSLATEAMBERLIMEROSESKYVIOLET

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • descriptionstring or nullrequired

    Free-text description.

  • displayOrderintegerrequired

    Position in lists; lower numbers come first.

    at least 0

  • idstring (uuid)required

    ID of the lead segment.

  • namestringrequired

    Name of the lead segment, as shown in the LMS.

  • processIdstring (uuid)required

    ID of the process.

  • statusenumrequired

    Current status of the lead segment.

    One ofACTIVEARCHIVED

  • 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 ownership.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 404 Not FoundSEGMENT_NOT_FOUNDThe segment 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"SEGMENT_ID="5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e"curl -X POST "$BASE/lms/segments/$SEGMENT_ID/archive" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "colorToken": "SLATE",  "createdAt": "2026-11-28T09:15:00.000Z",  "description": "Leads from the IndiaMART enquiry inbox.",  "displayOrder": 1,  "id": "59646b6a-4fde-40b8-bc48-828f2435aff9",  "name": "Asha Verma",  "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",  "status": "ACTIVE",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "updatedAt": "2026-12-01T10:00:00.000Z"}

List segmentation rulesets

GET/v1/tenants/{tenantSlug}/lms/segmentation-rulesets

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

Scope ownership.readPaging cursor (items, nextCursor)

Lists segmentation rulesets with their drafts, filtered by process and status. Paged with an opaque cursor: pass nextCursor back as cursor until it is null.

Query parameters

  • processIdstring (uuid)optional

    ID of the process.

  • statusenumoptional

    Current status of the segmentation ruleset.

    One ofACTIVEARCHIVED

  • cursorstringoptional

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

    1–1000 characters

  • limitintegeroptional

    Maximum number of records to return in one page.

    1–100 · default 50

Responses

One page of segmentation rulesets.

  • 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 ownership.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/segmentation-rulesets" \  --data-urlencode "limit=50" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "nextCursor": "eyJpZCI6IjBiNmM3YTUyIiwidCI6MTc5NjgxODQwMH0",  "items": [    {      "createdAt": "2026-11-28T09:15:00.000Z",      "currentVersion": 1,      "currentVersionId": "913d5179-ece5-43f2-a4a4-f21c7530e0dd",      "id": "632fe8fd-46c2-4822-bd9d-a3aae948b5e5",      "name": "Asha Verma",      "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",      "revision": 4,      "status": "ACTIVE",      "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",      "updatedAt": "2026-12-01T10:00:00.000Z",      "defaultSegmentId": "6b7c8d9e-0f1a-4b2c-9d3e-4f5a6b7c8d9f",      "rules": [        {          "all": null,          "id": null,          "priority": null,          "segmentId": null        }      ]    }  ]}

Create a segmentation ruleset

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

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

Scope ownership.write

Creates an empty segmentation ruleset for a process, at revision 0 with no published version. Each process has at most one active segmentation ruleset. It is an editable draft plus immutable published versions; leads evaluated after publication (new leads and Re-run ownership rules) use the latest published version, so editing the draft has no effect until you publish. A process that already has an active segmentation ruleset returns 409 (SEGMENTATION_RULESET_EXISTS).

Request body (application/json)

  • namestringrequired

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

    1–120 characters

  • processIdstring (uuid)required

    ID of the process.

Responses

The new, empty ruleset.

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • currentVersioninteger or nullrequired

    Number of the published version; null before the first publish.

  • currentVersionIdstring (uuid) or nullrequired

    ID of the current version; null if none.

  • idstring (uuid)required

    ID of the segmentation ruleset.

  • namestringrequired

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

  • processIdstring (uuid)required

    ID of the process.

  • revisionintegerrequired

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

    at least 0

  • statusenumrequired

    Current status of the segmentation ruleset.

    One ofACTIVEARCHIVED

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

  • defaultSegmentIdstring (uuid) or nullrequired

    ID of the default segment; null if none.

  • rulesarray of objectrequired

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

    up to 200 items

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 ownership.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 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/segmentation-rulesets" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",    "name": "Solar enquiries"  }'
Example response (201 Created) (201 Created)
{  "createdAt": "2026-11-28T09:15:00.000Z",  "currentVersion": 1,  "currentVersionId": "913d5179-ece5-43f2-a4a4-f21c7530e0dd",  "id": "632fe8fd-46c2-4822-bd9d-a3aae948b5e5",  "name": "Asha Verma",  "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",  "revision": 4,  "status": "ACTIVE",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "updatedAt": "2026-12-01T10:00:00.000Z",  "defaultSegmentId": "6b7c8d9e-0f1a-4b2c-9d3e-4f5a6b7c8d9f",  "rules": [    {      "all": [        {          "field": null,          "operator": null,          "value": null        }      ],      "id": "c1b9f521-fa8d-4032-968e-c348b2bded15",      "priority": 3,      "segmentId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e"    }  ]}

Get a segmentation ruleset

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

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

Scope ownership.read

Returns the ruleset's draft (rules, defaultSegmentId, revision) and, in currentVersionData, the version currently in force (null until the first publish). Use revision as expectedRevision when you update or publish it.

Path parameters

  • rulesetIdstring (uuid)required

    Ruleset ID.

Responses

The segmentation ruleset.

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • currentVersioninteger or nullrequired

    Number of the published version; null before the first publish.

  • currentVersionIdstring (uuid) or nullrequired

    ID of the current version; null if none.

  • idstring (uuid)required

    ID of the segmentation ruleset.

  • namestringrequired

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

  • processIdstring (uuid)required

    ID of the process.

  • revisionintegerrequired

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

    at least 0

  • statusenumrequired

    Current status of the segmentation ruleset.

    One ofACTIVEARCHIVED

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

  • defaultSegmentIdstring (uuid) or nullrequired

    ID of the default segment; null if none.

  • rulesarray of objectrequired

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

    up to 200 items

  • currentVersionDataobject or nullrequired

    The published version's content; null before the first publish.

Errors

  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the ownership.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"SEGMENTATION_RULESET_ID="1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e"curl "$BASE/lms/segmentation-rulesets/$SEGMENTATION_RULESET_ID" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "createdAt": "2026-11-28T09:15:00.000Z",  "currentVersion": 1,  "currentVersionId": "f7a8b9c0-d1e2-4f3a-8b4c-5d6e7f8a9b0c",  "currentVersionData": {    "defaultSegmentId": "6b7c8d9e-0f1a-4b2c-9d3e-4f5a6b7c8d9f",    "id": "f7a8b9c0-d1e2-4f3a-8b4c-5d6e7f8a9b0c",    "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",    "publishedAt": "2026-12-01T10:00:00.000Z",    "publishedBy": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",    "rules": [      {        "id": "c3d4e5f6-a7b8-4c9d-8e0f-1a2b3c4d5e6f",        "priority": 10,        "segmentId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e",        "all": [          {            "field": "lead.productInterest",            "operator": "CONTAINS",            "value": "solar"          },          {            "field": "attributes.monthlyBill",            "operator": "GREATER_THAN_OR_EQUAL",            "value": 5000          }        ]      }    ],    "rulesetId": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",    "version": 1  },  "defaultSegmentId": "6b7c8d9e-0f1a-4b2c-9d3e-4f5a6b7c8d9f",  "id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",  "name": "Solar enquiries",  "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",  "revision": 1,  "rules": [    {      "id": "c3d4e5f6-a7b8-4c9d-8e0f-1a2b3c4d5e6f",      "priority": 10,      "segmentId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e",      "all": [        {          "field": "lead.productInterest",          "operator": "CONTAINS",          "value": "solar"        },        {          "field": "attributes.monthlyBill",          "operator": "GREATER_THAN_OR_EQUAL",          "value": 5000        }      ]    }  ],  "status": "ACTIVE",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "updatedAt": "2026-12-01T10:00:00.000Z"}

Save a segmentation ruleset draft

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

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

Scope ownership.write

Replaces the whole draft: name, rules and defaultSegmentId are all required.

Rules are tried in ascending priority (lowest number first) and the first rule whose conditions all match sets the segment; leads that match nothing get defaultSegmentId (or no segment when it is null). Priorities and rule IDs must be unique; a rule with an empty all list matches every lead. Conditions compare lead fields (lead.*, acquisition.*, campaign.id) or custom attributes (attributes.<name>). Every referenced segment must be active and belong to the ruleset's process (409 otherwise).

Send contractVersion: 2 to compare lead.priority by rank (1 = low to 4 = urgent).

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. Archived rulesets cannot be changed (409).

Path parameters

  • rulesetIdstring (uuid)required

    Ruleset ID.

Request body (application/json)

Responses

The saved draft.

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • currentVersioninteger or nullrequired

    Number of the published version; null before the first publish.

  • currentVersionIdstring (uuid) or nullrequired

    ID of the current version; null if none.

  • idstring (uuid)required

    ID of the segmentation ruleset.

  • namestringrequired

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

  • processIdstring (uuid)required

    ID of the process.

  • revisionintegerrequired

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

    at least 0

  • statusenumrequired

    Current status of the segmentation ruleset.

    One ofACTIVEARCHIVED

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

  • defaultSegmentIdstring (uuid) or nullrequired

    ID of the default segment; null if none.

  • rulesarray of objectrequired

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

    up to 200 items

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 ownership.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"SEGMENTATION_RULESET_ID="1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e"curl -X PATCH \  "$BASE/lms/segmentation-rulesets/$SEGMENTATION_RULESET_ID" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "expectedRevision": 0,    "name": "Solar enquiries",    "defaultSegmentId": "6b7c8d9e-0f1a-4b2c-9d3e-4f5a6b7c8d9f",    "rules": [      {        "id": "c3d4e5f6-a7b8-4c9d-8e0f-1a2b3c4d5e6f",        "priority": 10,        "segmentId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e",        "all": [          {            "field": "lead.productInterest",            "operator": "CONTAINS",            "value": "solar"          },          {            "field": "attributes.monthlyBill",            "operator": "GREATER_THAN_OR_EQUAL",            "value": 5000          }        ]      }    ]  }'
Example response (200 OK) (200 OK)
{  "createdAt": "2026-11-28T09:15:00.000Z",  "currentVersion": 1,  "currentVersionId": "913d5179-ece5-43f2-a4a4-f21c7530e0dd",  "id": "632fe8fd-46c2-4822-bd9d-a3aae948b5e5",  "name": "Asha Verma",  "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",  "revision": 4,  "status": "ACTIVE",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "updatedAt": "2026-12-01T10:00:00.000Z",  "defaultSegmentId": "6b7c8d9e-0f1a-4b2c-9d3e-4f5a6b7c8d9f",  "rules": [    {      "all": [        {          "field": null,          "operator": null,          "value": null        }      ],      "id": "c1b9f521-fa8d-4032-968e-c348b2bded15",      "priority": 3,      "segmentId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e"    }  ]}

Publish a segmentation ruleset

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

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

Scope ownership.write

Freezes the current draft as the next numbered version, which is then used for every lead segmented from now on. Existing leads keep their segment until they are re-evaluated. The referenced segments are checked again (409 if any is no longer active). 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.

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.

    at least 0

    One of two concurrency tokens. Conventions

Responses

The published version.

  • defaultSegmentIdstring (uuid) or nullrequired

    ID of the default segment; null if none.

  • idstring (uuid)required

    ID of the segmentation version.

  • processIdstring (uuid)required

    ID of the process.

  • publishedAtstring (date-time)required

    When it was published (ISO 8601).

  • publishedBystring (uuid) or nullrequired

    User ID of the member who published it.

  • rulesarray of objectrequired

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

    up to 200 items

  • rulesetIdstring (uuid)required

    ID of the ruleset.

  • versionintegerrequired

    Version number.

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 ownership.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"SEGMENTATION_RULESET_ID="1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e"curl -X POST \  "$BASE/lms/segmentation-rulesets/$SEGMENTATION_RULESET_ID/publish" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "expectedRevision": 1  }'
Example response (201 Created) (201 Created)
{  "defaultSegmentId": "6b7c8d9e-0f1a-4b2c-9d3e-4f5a6b7c8d9f",  "id": "aa09eb6b-fc06-44e6-a00b-847cc662c031",  "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",  "publishedAt": "2026-12-01T10:00:00.000Z",  "publishedBy": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",  "rules": [    {      "all": [        {          "field": null,          "operator": null,          "value": null        }      ],      "id": "c1b9f521-fa8d-4032-968e-c348b2bded15",      "priority": 3,      "segmentId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e"    }  ],  "rulesetId": "5677087e-3f84-4e84-b69d-c55f02cc3379",  "version": 1}

List allocation rulesets

GET/v1/tenants/{tenantSlug}/lms/allocation-rulesets

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

Scope ownership.readPaging cursor (items, nextCursor)

Lists allocation rulesets with their drafts, filtered by process and status. Paged with an opaque cursor: pass nextCursor back as cursor until it is null.

Query parameters

  • processIdstring (uuid)optional

    ID of the process.

  • statusenumoptional

    Current status of the allocation ruleset.

    One ofACTIVEARCHIVED

  • cursorstringoptional

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

    1–1000 characters

  • limitintegeroptional

    Maximum number of records to return in one page.

    1–100 · default 50

Responses

One page of allocation rulesets.

  • 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 ownership.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/allocation-rulesets" \  --data-urlencode "limit=50" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "nextCursor": "eyJpZCI6IjBiNmM3YTUyIiwidCI6MTc5NjgxODQwMH0",  "items": [    {      "createdAt": "2026-11-28T09:15:00.000Z",      "currentVersion": 1,      "currentVersionId": "913d5179-ece5-43f2-a4a4-f21c7530e0dd",      "id": "5001af8d-e50b-4132-807c-ebda6668e0c5",      "name": "Asha Verma",      "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",      "revision": 4,      "status": "ACTIVE",      "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",      "updatedAt": "2026-12-01T10:00:00.000Z",      "fallbackTeamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",      "rules": [        {          "all": null,          "id": null,          "priority": null,          "strategy": null,          "teamId": null,          "userId": null        }      ]    }  ]}

Create an allocation ruleset

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

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

Scope ownership.write

Creates an empty allocation ruleset for a process, at revision 0 with no published version. Each process has at most one active allocation ruleset. It is an editable draft plus immutable published versions; leads evaluated after publication (new leads and Re-run ownership rules) use the latest published version, so editing the draft has no effect until you publish. A process that already has an active allocation ruleset returns 409 (ALLOCATION_RULESET_EXISTS).

Request body (application/json)

  • namestringrequired

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

    1–120 characters

  • processIdstring (uuid)required

    ID of the process.

Responses

The new, empty ruleset.

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • currentVersioninteger or nullrequired

    Number of the published version; null before the first publish.

  • currentVersionIdstring (uuid) or nullrequired

    ID of the current version; null if none.

  • idstring (uuid)required

    ID of the allocation ruleset.

  • namestringrequired

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

  • processIdstring (uuid)required

    ID of the process.

  • revisionintegerrequired

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

    at least 0

  • statusenumrequired

    Current status of the allocation ruleset.

    One ofACTIVEARCHIVED

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

  • fallbackTeamIdstring (uuid) or nullrequired

    ID of the fallback team; null if none.

  • rulesarray of objectrequired

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

    up to 200 items

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 ownership.write scope.
  • 403 ForbiddenPERMISSION_DENIEDThe key's acting member lacks the permission or data access.
  • 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/allocation-rulesets" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",    "name": "Solar allocation"  }'
Example response (201 Created) (201 Created)
{  "createdAt": "2026-11-28T09:15:00.000Z",  "currentVersion": 1,  "currentVersionId": "913d5179-ece5-43f2-a4a4-f21c7530e0dd",  "id": "5001af8d-e50b-4132-807c-ebda6668e0c5",  "name": "Asha Verma",  "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",  "revision": 4,  "status": "ACTIVE",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "updatedAt": "2026-12-01T10:00:00.000Z",  "fallbackTeamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",  "rules": [    {      "all": [        {          "field": null,          "operator": null,          "value": null        }      ],      "id": "c1b9f521-fa8d-4032-968e-c348b2bded15",      "priority": 3,      "strategy": "FIXED_AGENT",      "teamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",      "userId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a"    }  ]}

Get an allocation ruleset

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

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

Scope ownership.read

Returns the ruleset's draft (rules, fallbackTeamId, revision) and, in currentVersionData, the version currently in force (null until the first publish). Use revision as expectedRevision when you update or publish it.

Path parameters

  • rulesetIdstring (uuid)required

    Ruleset ID.

Responses

The allocation ruleset.

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • currentVersioninteger or nullrequired

    Number of the published version; null before the first publish.

  • currentVersionIdstring (uuid) or nullrequired

    ID of the current version; null if none.

  • idstring (uuid)required

    ID of the allocation ruleset.

  • namestringrequired

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

  • processIdstring (uuid)required

    ID of the process.

  • revisionintegerrequired

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

    at least 0

  • statusenumrequired

    Current status of the allocation ruleset.

    One ofACTIVEARCHIVED

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

  • fallbackTeamIdstring (uuid) or nullrequired

    ID of the fallback team; null if none.

  • rulesarray of objectrequired

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

    up to 200 items

  • currentVersionDataobject or nullrequired

    The published version's content; null before the first publish.

Errors

  • 403 ForbiddenPARTNER_OPERATION_FORBIDDENThe key lacks the ownership.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"ALLOCATION_RULESET_ID="9c0d1e2f-3a4b-4c5d-9e6f-7a8b9c0d1e2f"curl "$BASE/lms/allocation-rulesets/$ALLOCATION_RULESET_ID" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "createdAt": "2026-11-28T09:15:00.000Z",  "currentVersion": 1,  "currentVersionId": "913d5179-ece5-43f2-a4a4-f21c7530e0dd",  "id": "5001af8d-e50b-4132-807c-ebda6668e0c5",  "name": "Asha Verma",  "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",  "revision": 4,  "status": "ACTIVE",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "updatedAt": "2026-12-01T10:00:00.000Z",  "fallbackTeamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",  "rules": [    {      "all": [        {          "field": null,          "operator": null,          "value": null        }      ],      "id": "c1b9f521-fa8d-4032-968e-c348b2bded15",      "priority": 3,      "strategy": "FIXED_AGENT",      "teamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",      "userId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a"    }  ],  "currentVersionData": {    "fallbackTeamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",    "id": "9f7ccf0c-a728-4ac6-a711-d7f985441219",    "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",    "publishedAt": "2026-12-01T10:00:00.000Z",    "publishedBy": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",    "rules": [      {        "all": null,        "id": null,        "priority": null,        "strategy": null,        "teamId": null,        "userId": null      }    ],    "rulesetId": "5677087e-3f84-4e84-b69d-c55f02cc3379",    "version": 1  }}

Save an allocation ruleset draft

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

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

Scope ownership.write

Replaces the whole draft: name, rules and fallbackTeamId are all required.

Rules are tried in ascending priority (lowest number first) and the first rule whose conditions all match decides the owner:

  • FIXED_AGENT assigns userId in teamId (a userId is required).
  • TEAM_QUEUE puts the lead in the team's queue (userId must be null).
  • ROUND_ROBIN rotates through the team's members (userId must be null).

Leads that match nothing go to the fallbackTeamId queue, or stay unassigned when it is null. Conditions compare segment.id, campaign.id, source.connectionId, source.definitionKey, lead fields or custom attributes (attributes.<name>). Referenced teams and members must be active (409 otherwise). Leads with a manual assignment lock are never reassigned by rules.

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. Archived rulesets cannot be changed (409).

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.

    at least 0

    One of two concurrency tokens. Conventions

  • fallbackTeamIdstring (uuid) or nullrequired

    ID of the fallback team; null if none.

  • namestringrequired

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

    1–120 characters

  • rulesarray of objectrequired

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

    up to 200 items

Responses

The saved draft.

  • createdAtstring (date-time)required

    When it was created (ISO 8601).

  • currentVersioninteger or nullrequired

    Number of the published version; null before the first publish.

  • currentVersionIdstring (uuid) or nullrequired

    ID of the current version; null if none.

  • idstring (uuid)required

    ID of the allocation ruleset.

  • namestringrequired

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

  • processIdstring (uuid)required

    ID of the process.

  • revisionintegerrequired

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

    at least 0

  • statusenumrequired

    Current status of the allocation ruleset.

    One ofACTIVEARCHIVED

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

  • fallbackTeamIdstring (uuid) or nullrequired

    ID of the fallback team; null if none.

  • rulesarray of objectrequired

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

    up to 200 items

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 ownership.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"ALLOCATION_RULESET_ID="9c0d1e2f-3a4b-4c5d-9e6f-7a8b9c0d1e2f"curl -X PATCH "$BASE/lms/allocation-rulesets/$ALLOCATION_RULESET_ID" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "expectedRevision": 0,    "name": "Solar allocation",    "fallbackTeamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",    "rules": [      {        "id": "d4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f7a",        "priority": 10,        "strategy": "FIXED_AGENT",        "teamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",        "userId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",        "all": [          {            "field": "segment.id",            "operator": "EQUALS",            "value": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e"          }        ]      },      {        "id": "e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a8b",        "priority": 20,        "strategy": "ROUND_ROBIN",        "teamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",        "userId": null,        "all": [          {            "field": "lead.city",            "operator": "IN",            "value": [              "Pune",              "Pimpri-Chinchwad"            ]          }        ]      }    ]  }'
Example response (200 OK) (200 OK)
{  "createdAt": "2026-11-28T09:15:00.000Z",  "currentVersion": 1,  "currentVersionId": "913d5179-ece5-43f2-a4a4-f21c7530e0dd",  "id": "5001af8d-e50b-4132-807c-ebda6668e0c5",  "name": "Asha Verma",  "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",  "revision": 4,  "status": "ACTIVE",  "tenantId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",  "updatedAt": "2026-12-01T10:00:00.000Z",  "fallbackTeamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",  "rules": [    {      "all": [        {          "field": null,          "operator": null,          "value": null        }      ],      "id": "c1b9f521-fa8d-4032-968e-c348b2bded15",      "priority": 3,      "strategy": "FIXED_AGENT",      "teamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",      "userId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a"    }  ]}

Publish an allocation ruleset

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

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

Scope ownership.write

Freezes the current draft as the next numbered version, which is then used for every lead allocated from now on. Existing leads keep their owner until they are re-evaluated. Referenced teams and members are checked again (409 if any is no longer eligible). 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.

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.

    at least 0

    One of two concurrency tokens. Conventions

Responses

The published version.

  • fallbackTeamIdstring (uuid) or nullrequired

    ID of the fallback team; null if none.

  • idstring (uuid)required

    ID of the allocation version.

  • processIdstring (uuid)required

    ID of the process.

  • publishedAtstring (date-time)required

    When it was published (ISO 8601).

  • publishedBystring (uuid) or nullrequired

    User ID of the member who published it.

  • rulesarray of objectrequired

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

    up to 200 items

  • rulesetIdstring (uuid)required

    ID of the ruleset.

  • versionintegerrequired

    Version number.

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 ownership.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"ALLOCATION_RULESET_ID="9c0d1e2f-3a4b-4c5d-9e6f-7a8b9c0d1e2f"curl -X POST \  "$BASE/lms/allocation-rulesets/$ALLOCATION_RULESET_ID/publish" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "expectedRevision": 1  }'
Example response (201 Created) (201 Created)
{  "fallbackTeamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",  "id": "a8b9c0d1-e2f3-4a4b-9c5d-6e7f8a9b0c1d",  "processId": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c7d",  "publishedAt": "2026-12-01T10:00:00.000Z",  "publishedBy": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",  "rules": [    {      "id": "d4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f7a",      "priority": 10,      "strategy": "FIXED_AGENT",      "teamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",      "userId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",      "all": [        {          "field": "segment.id",          "operator": "EQUALS",          "value": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8e"        }      ]    },    {      "id": "e5f6a7b8-c9d0-4e1f-8a2b-3c4d5e6f7a8b",      "priority": 20,      "strategy": "ROUND_ROBIN",      "teamId": "4b5c6d7e-8f90-4a1b-8c2d-3e4f5a6b7c8d",      "userId": null,      "all": [        {          "field": "lead.city",          "operator": "IN",          "value": [            "Pune",            "Pimpri-Chinchwad"          ]        }      ]    }  ],  "rulesetId": "9c0d1e2f-3a4b-4c5d-9e6f-7a8b9c0d1e2f",  "version": 2}
    Ownership API · IoTIndia developers