Skip to main content

Lead submission

Push leads from your CRM or website into a Partner API source, with your own field names.

Submit a lead or create one?

  1. From another system, with its own field names: submit to a Partner API source. Its mapping and routing decide the campaign; you get a receipt.

    POSTSubmit a leadGETGet a submission receipt

  2. Directly into a campaign you choose, with LMS field names: create the lead.

    POSTCreate a lead

Find the source IDs a key may submit to in sourceIds of Describe the current credential; set a source up under Lead intake → Sources in LMS.

Submit a lead

POST/v1/integrations/sources/{sourceId}/leads

Scope intake.submit

Sends one lead to a Partner API source. LMS applies the source's published field mapping and routing, de-duplicates against existing leads and returns a receipt. Needs the intake.submit scope with this source selected on the key.

Send an Idempotency-Key. Retrying with the same key and body returns the original receipt; the same key with a different body returns 409 IDEMPOTENCY_CONFLICT. Records that cannot be mapped or routed yet are held (NEEDS_MAPPING, NEEDS_ROUTING, leadId: null) and replayed by an operator once the source is fixed. The saved receipt does not change after that replay; follow the lead through lead.created or the change feed.

Use this to push leads from another system with its own field names. To create a lead directly in a campaign you choose, with LMS field names, use Create a lead.

Path parameters

  • sourceIdstring (uuid)required

    Partner API source ID: one of the sourceIds that Describe the current credential returns. Sources are set up in LMS under Lead intake → Sources.

Headers

  • Idempotency-Keystringrequired

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

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

Request body (application/json)

  • externalRecordIdstringrequired

    Your system's ID for this record. Repeat submissions are matched on it.

    1–200 characters

  • fieldsmap of any JSON valuerequired

    Source fields, keyed by the field names you configured in the source's mapping. Values may be any JSON.

Responses

The submission's receipt (the original one on a retry). Look it up later with Get a submission receipt.

  • idstring (uuid)required

    Receipt ID. Look the receipt up again with it.

  • leadIdstring (uuid) or nullrequired

    The created or matched lead, if any.

  • sourceRecordIdstring (uuid)required

    The stored source record.

  • statusenumrequired

    Current status of the partner intake receipt.

    One ofMATERIALIZEDDUPLICATENEEDS_MAPPINGNEEDS_ROUTING

  • reasonCodestring or nullrequired

    Machine-readable detail, for example LEAD_CREATED, REPEAT_ENQUIRY or MAPPING_VERSION_NOT_FOUND.

Errors

  • 400 Bad RequestIDEMPOTENCY_KEY_REQUIREDThe Idempotency-Key header is missing.
  • 400 Bad RequestVALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).
  • 403 ForbiddenPARTNER_SCOPE_FORBIDDENThe key lacks the intake.submit scope.
  • 404 Not FoundSOURCE_NOT_FOUNDThe source does not exist or the key cannot see it.
  • 409 ConflictIDEMPOTENCY_CONFLICTThe Idempotency-Key was already used with a different body.
  • 409 ConflictSOURCE_INACTIVEThe source is paused; resume it, then resend with the same key.

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

Request
BASE="https://lms.iotindia.ai/v1/integrations"SOURCE_ID="1f2e3d4c-5b6a-4798-8a7b-6c5d4e3f2a1b"# One key per new request; reuse it unchanged on every retry.IDEMPOTENCY_KEY="${IDEMPOTENCY_KEY:-$(uuidgen)}"curl -X POST "$BASE/sources/$SOURCE_ID/leads" \  -H "Authorization: Bearer $LMS_API_KEY" \  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \  -H "Content-Type: application/json" \  -d '{    "externalRecordId": "crm-123",    "fields": {      "name": "Asha Verma",      "phone": "+919812345678",      "email": "asha@example.com",      "city": "Pune",      "product": "Rooftop solar, 5 kW"    }  }'
Example response
{  "id": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "sourceRecordId": "4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a",  "status": "MATERIALIZED",  "reasonCode": "LEAD_CREATED"}

Get a submission receipt

GET/v1/integrations/sources/{sourceId}/receipts/{receiptId}

Scope intake.submit

Returns the saved outcome of an earlier submission to this source. Receipts record the result at submission time; later routing or replay happens in the LMS intake workspace. Needs the intake.submit scope with this source selected.

Path parameters

  • sourceIdstring (uuid)required

    Partner API source ID.

  • receiptIdstring (uuid)required

    Receipt ID returned by the submission.

Responses

The receipt.

  • idstring (uuid)required

    Receipt ID. Look the receipt up again with it.

  • leadIdstring (uuid) or nullrequired

    The created or matched lead, if any.

  • sourceRecordIdstring (uuid)required

    The stored source record.

  • statusenumrequired

    Current status of the partner intake receipt.

    One ofMATERIALIZEDDUPLICATENEEDS_MAPPINGNEEDS_ROUTING

  • reasonCodestring or nullrequired

    Machine-readable detail, for example LEAD_CREATED, REPEAT_ENQUIRY or MAPPING_VERSION_NOT_FOUND.

Errors

  • 403 ForbiddenPARTNER_SCOPE_FORBIDDENThe key lacks the intake.submit scope.
  • 404 Not FoundSOURCE_NOT_FOUNDThe source does not exist or the key cannot see it.
  • 404 Not FoundRECEIPT_NOT_FOUNDThe receipt 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/integrations"SOURCE_ID="1f2e3d4c-5b6a-4798-8a7b-6c5d4e3f2a1b"RECEIPT_ID="b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e"curl "$BASE/sources/$SOURCE_ID/receipts/$RECEIPT_ID" \  -H "Authorization: Bearer $LMS_API_KEY"
Example response (200 OK) (200 OK)
{  "id": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",  "leadId": "0b6c7a52-4f0e-4c1a-9d43-3f2a7c1e9b10",  "sourceRecordId": "4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a",  "status": "MATERIALIZED",  "reasonCode": "LEAD_CREATED"}
    Lead submission API · IoTIndia developers