Lead intake
Set up where leads come from: sources, field mappings, routing, imports and intake problems.
Set up a source
Choose a source type.
Create the connection.
Create and publish its field mapping.
Create and publish the routing that picks a campaign.
Turn the connection on and watch its health.
On this page
Source types and connections
Field mappings
Routing
Health and held records
Deliveries and imports
List source types
GET/v1/tenants/{tenantSlug}/lms/source-definitions
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:
availabilityWhether this source type can be connected in your workspace.
channelCapabilitiesChannels the source can deliver leads from.
connectionMechanismHow LMS receives leads: push from the sender, or polling.
credentialMechanismHow the source authenticates, for example an OAuth app or a signing secret.
displayNameName shown in the LMS.
keyStable machine key. Unlike the label, it never changes.
maximumContractVersionNewest payload version LMS accepts from it.
minimumContractVersionOldest payload version LMS accepts from it.
providerSystem behind the source, for example
metaorpartner_api.statusCurrent status of the lead source definition.
Errors
PARTNER_OPERATION_FORBIDDENThe key lacks theintake.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.
List source connections
GET/v1/tenants/{tenantSlug}/lms/source-connections
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:
configurationSettings specific to this kind of source.
createdAtWhen it was created (ISO 8601).
defaultCampaignIdID of the default campaign;
nullif none.externalAccountIdID of the external account;
nullif none.externalAccountNameName of the external account, as shown in the LMS.
idID of the lead source connection.
nameName of the lead source connection, as shown in the LMS.
secretConfiguredWhether a secret is stored for it.
sourceDefinitionKeySource type key, for example
meta_lead_ads(see List source types).statusCurrent status of the lead source connection.
tenantIdID of the workspace.
updatedAtWhen it last changed (ISO 8601). Send it back as
expectedUpdatedAtwhen you update.
Errors
PARTNER_OPERATION_FORBIDDENThe key lacks theintake.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.
Create a source connection
POST/v1/tenants/{tenantSlug}/lms/source-connections
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.
configurationholds non-secret provider settings. A key that looks like a credential (token,password,secret,apiKey,accessToken) is rejected with400.secretReferenceattaches a credential your LMS administrator has stored in the platform's secret manager; it must be a secret-manager ARN and is never returned.defaultCampaignIdis 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)
configurationSettings specific to this kind of source.
defaultCampaignIdID of the default campaign;
nullif none.externalAccountIdID of the external account;
nullif none.externalAccountNameName of the external account, as shown in the LMS.
nameName of the source connection, as shown in the LMS.
secretReferenceReference to a stored secret; the secret itself is never returned.
sourceDefinitionKeySource type key, for example
meta_lead_ads(see List source types).
Responses
The new source connection, in DRAFT.
LocationURL of the new source connection.
configurationSettings specific to this kind of source.
createdAtWhen it was created (ISO 8601).
defaultCampaignIdID of the default campaign;
nullif none.externalAccountIdID of the external account;
nullif none.externalAccountNameName of the external account, as shown in the LMS.
idID of the lead source connection.
nameName of the lead source connection, as shown in the LMS.
secretConfiguredWhether a secret is stored for it.
sourceDefinitionKeySource type key, for example
meta_lead_ads(see List source types).statusCurrent status of the lead source connection.
tenantIdID of the workspace.
updatedAtWhen it last changed (ISO 8601). Send it back as
expectedUpdatedAtwhen you update.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theintake.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.- The record does not exist or the key cannot see it.
SOURCE_CONNECTION_NAME_CONFLICTAnother source connection already has this name.
Get a source connection
GET/v1/tenants/{tenantSlug}/lms/source-connections/{connectionId}
Returns one source connection: its source type, status, default campaign and non-secret configuration.
Path parameters
connectionIdSource connection ID.
Responses
The source connection.
configurationSettings specific to this kind of source.
createdAtWhen it was created (ISO 8601).
defaultCampaignIdID of the default campaign;
nullif none.externalAccountIdID of the external account;
nullif none.externalAccountNameName of the external account, as shown in the LMS.
idID of the lead source connection.
nameName of the lead source connection, as shown in the LMS.
secretConfiguredWhether a secret is stored for it.
sourceDefinitionKeySource type key, for example
meta_lead_ads(see List source types).statusCurrent status of the lead source connection.
tenantIdID of the workspace.
updatedAtWhen it last changed (ISO 8601). Send it back as
expectedUpdatedAtwhen you update.
Errors
PARTNER_OPERATION_FORBIDDENThe key lacks theintake.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.SOURCE_CONNECTION_NOT_FOUNDThe source connection does not exist or the key cannot see it.
Update a source connection
PATCH/v1/tenants/{tenantSlug}/lms/source-connections/{connectionId}
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
connectionIdSource connection ID.
Request body (application/json)
configurationSettings specific to this kind of source.
defaultCampaignIdID of the default campaign;
nullif none.externalAccountIdID of the external account;
nullif none.externalAccountNameName of the external account, as shown in the LMS.
nameName of the source connection, as shown in the LMS.
secretReferenceReference to a stored secret; the secret itself is never returned.
statusCurrent status of the source connection.
Responses
The updated source connection.
configurationSettings specific to this kind of source.
createdAtWhen it was created (ISO 8601).
defaultCampaignIdID of the default campaign;
nullif none.externalAccountIdID of the external account;
nullif none.externalAccountNameName of the external account, as shown in the LMS.
idID of the lead source connection.
nameName of the lead source connection, as shown in the LMS.
secretConfiguredWhether a secret is stored for it.
sourceDefinitionKeySource type key, for example
meta_lead_ads(see List source types).statusCurrent status of the lead source connection.
tenantIdID of the workspace.
updatedAtWhen it last changed (ISO 8601). Send it back as
expectedUpdatedAtwhen you update.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theintake.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.SOURCE_CONNECTION_NOT_FOUNDThe source connection does not exist or the key cannot see it.SOURCE_CONNECTION_NAME_CONFLICTAnother source connection already has this name.
Create a field mapping
POST/v1/tenants/{tenantSlug}/lms/mappings
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)
nameName of the mapping draft, as shown in the LMS.
rulesRules, checked in
priorityorder; the first match wins.sourceConnectionIdID of the source connection.
Responses
The new mapping draft.
LocationURL of the new mapping.
idID of the mapping draft.
tenantIdID of the workspace.
nameName of the mapping draft, as shown in the LMS.
revisionRevision number, increased on every change. Send it back as
expectedRevisionwhen you update.sourceConnectionIdID of the source connection.
statusARCHIVEDdrafts are kept for history.createdAtWhen it was created (ISO 8601).
updatedAtWhen it last changed (ISO 8601). Send it back as
expectedUpdatedAtwhen you update.rulesRules, checked in
priorityorder; the first match wins.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theintake.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.- The record does not exist or the key cannot see it.
- The change conflicts with the record's current state or a workflow rule;
error.codenames it.
Get a field mapping
GET/v1/tenants/{tenantSlug}/lms/mappings/{mappingId}
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
mappingIdField mapping ID.
Responses
The mapping draft.
idID of the mapping draft.
tenantIdID of the workspace.
nameName of the mapping draft, as shown in the LMS.
revisionRevision number, increased on every change. Send it back as
expectedRevisionwhen you update.sourceConnectionIdID of the source connection.
statusARCHIVEDdrafts are kept for history.createdAtWhen it was created (ISO 8601).
updatedAtWhen it last changed (ISO 8601). Send it back as
expectedUpdatedAtwhen you update.rulesRules, checked in
priorityorder; the first match wins.
Errors
PARTNER_OPERATION_FORBIDDENThe key lacks theintake.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.MAPPING_NOT_FOUNDThe field mapping does not exist or the key cannot see it.
Update a field mapping draft
PATCH/v1/tenants/{tenantSlug}/lms/mappings/{mappingId}
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
mappingIdField mapping ID.
Request body (application/json)
expectedRevisionThe
revisionfrom your last read. If the record changed since, the request fails with409and nothing is saved.nameName of the mapping draft, as shown in the LMS.
rulesRules, checked in
priorityorder; the first match wins.
Responses
The updated mapping draft.
idID of the mapping draft.
tenantIdID of the workspace.
nameName of the mapping draft, as shown in the LMS.
revisionRevision number, increased on every change. Send it back as
expectedRevisionwhen you update.sourceConnectionIdID of the source connection.
statusARCHIVEDdrafts are kept for history.createdAtWhen it was created (ISO 8601).
updatedAtWhen it last changed (ISO 8601). Send it back as
expectedUpdatedAtwhen you update.rulesRules, checked in
priorityorder; the first match wins.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theintake.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.MAPPING_NOT_FOUNDThe field mapping does not exist or the key cannot see it.STALE_REVISIONThe record changed after your read (expectedRevision); read it again and resend.
Publish a field mapping
POST/v1/tenants/{tenantSlug}/lms/mappings/{mappingId}/publish
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
mappingIdField mapping ID.
Request body (application/json)
expectedRevisionThe
revisionfrom your last read. If the record changed since, the request fails with409and nothing is saved.
Responses
The published mapping version.
idID of the mapping version.
tenantIdID of the workspace.
mappingDefinitionIdID of the mapping draft this was published from.
versionVersion number, from 1.
rulesRules, checked in
priorityorder; the first match wins.publishedAtWhen it was published (ISO 8601).
publishedByUser ID of the member who published it.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theintake.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.MAPPING_NOT_FOUNDThe field mapping does not exist or the key cannot see it.STALE_REVISIONThe record changed after your read (expectedRevision); read it again and resend.
Create a routing ruleset
POST/v1/tenants/{tenantSlug}/lms/routing-rulesets
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)
nameName of the routing ruleset, as shown in the LMS.
rulesRules, checked in
priorityorder; the first match wins.sourceConnectionIdID of the source connection.
Responses
The new routing draft.
LocationURL of the new routing ruleset.
idID of the routing draft.
tenantIdID of the workspace.
nameName of the routing draft, as shown in the LMS.
revisionRevision number, increased on every change. Send it back as
expectedRevisionwhen you update.sourceConnectionIdID of the source connection.
statusARCHIVEDdrafts are kept for history.createdAtWhen it was created (ISO 8601).
updatedAtWhen it last changed (ISO 8601). Send it back as
expectedUpdatedAtwhen you update.rulesRules, checked in
priorityorder; the first match wins.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theintake.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.- The record does not exist or the key cannot see it.
- The change conflicts with the record's current state or a workflow rule;
error.codenames it.
Get a routing ruleset
GET/v1/tenants/{tenantSlug}/lms/routing-rulesets/{rulesetId}
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
rulesetIdRuleset ID.
Responses
The routing draft.
idID of the routing draft.
tenantIdID of the workspace.
nameName of the routing draft, as shown in the LMS.
revisionRevision number, increased on every change. Send it back as
expectedRevisionwhen you update.sourceConnectionIdID of the source connection.
statusARCHIVEDdrafts are kept for history.createdAtWhen it was created (ISO 8601).
updatedAtWhen it last changed (ISO 8601). Send it back as
expectedUpdatedAtwhen you update.rulesRules, checked in
priorityorder; the first match wins.
Errors
PARTNER_OPERATION_FORBIDDENThe key lacks theintake.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.- The record does not exist or the key cannot see it.
Update a routing ruleset draft
PATCH/v1/tenants/{tenantSlug}/lms/routing-rulesets/{rulesetId}
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
rulesetIdRuleset ID.
Request body (application/json)
expectedRevisionThe
revisionfrom your last read. If the record changed since, the request fails with409and nothing is saved.nameName of the routing ruleset, as shown in the LMS.
rulesRules, checked in
priorityorder; the first match wins.
Responses
The updated routing draft.
idID of the routing draft.
tenantIdID of the workspace.
nameName of the routing draft, as shown in the LMS.
revisionRevision number, increased on every change. Send it back as
expectedRevisionwhen you update.sourceConnectionIdID of the source connection.
statusARCHIVEDdrafts are kept for history.createdAtWhen it was created (ISO 8601).
updatedAtWhen it last changed (ISO 8601). Send it back as
expectedUpdatedAtwhen you update.rulesRules, checked in
priorityorder; the first match wins.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theintake.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.- The record does not exist or the key cannot see it.
STALE_REVISIONThe record changed after your read (expectedRevision); read it again and resend.
Publish a routing ruleset
POST/v1/tenants/{tenantSlug}/lms/routing-rulesets/{rulesetId}/publish
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
rulesetIdRuleset ID.
Request body (application/json)
expectedRevisionThe
revisionfrom your last read. If the record changed since, the request fails with409and nothing is saved.
Responses
The published routing version.
idID of the routing version.
tenantIdID of the workspace.
routingRulesetIdID of the routing draft this was published from.
versionVersion number, from 1.
rulesRules, checked in
priorityorder; the first match wins.defaultCampaignIdCampaign for leads no rule matches;
nullleaves them in Needs routing.publishedAtWhen it was published (ISO 8601).
publishedByUser ID of the member who published it.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theintake.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.- The record does not exist or the key cannot see it.
STALE_REVISIONThe record changed after your read (expectedRevision); read it again and resend.
Get source health
GET/v1/tenants/{tenantSlug}/lms/source-health
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
sourceConnectionIdID of the source connection.
Responses
Health per source connection.
An array, not paged. Each item:
acceptedCountNumber of accepted records.
checkpointPresentWhether LMS has saved a polling position for this source.
connectionStatusWhether the connection is
ACTIVE,PAUSEDorARCHIVED.connectorFailedCountNumber of connector failed records.
connectorReceiptCountNumber of connector receipt records.
duplicateCountNumber of duplicate records.
failedCountNumber of failed records.
healthStatusOverall health:
HEALTHY,DEGRADEDorFAILING.lastFailureCodeCode of the most recent failure;
nullif none.lastFailureSummaryPlain-language summary of the most recent failure;
nullif none.lastIntakeModeHow the most recent lead arrived: pushed by the sender or polled by LMS.
lastReceivedAtWhen it was last received (ISO 8601);
nullif not yet.lastSucceededAtWhen it was last succeeded (ISO 8601);
nullif not yet.needsMappingCountNumber of needs mapping records.
needsRoutingCountNumber of needs routing records.
pollRunCountNumber of poll run records.
rawReceiptCountNumber of raw receipt records.
rejectedCountNumber of rejected records.
sourceConnectionIdID of the source connection.
sourceConnectionNameName of the source connection, as shown in the LMS.
sourceDefinitionKeySource type key, for example
meta_lead_ads(see List source types).statusCurrent status of the source health.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theintake.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.
Search source health
GET/v1/tenants/{tenantSlug}/lms/source-health/directory
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
includeArchivedInclude archived records (they are left out by default).
qFree-text search; matches names and other visible text, case-insensitively.
pagePage number, starting at 1.
Responses
One page of source health.
hasNextPageWhether it has next page.
hasSourcesWhether it has sources.
itemsThe records in this response, in the documented order.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theintake.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.
List records that need attention
GET/v1/tenants/{tenantSlug}/lms/source-records
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
processingStateWhich stopped records to list:
NEEDS_MAPPING,NEEDS_ROUTING,INVALIDorPROCESSING_FAILED.sourceConnectionIdOnly records from this source.
cursorOpaque cursor from the previous page's
nextCursor. Leave it out to start at the first page.limitMaximum number of records to return in one page.
Responses
One page of records: items and nextCursor.
itemsThe records in this response, in the documented order.
nextCursorPass as
cursorto fetch the next page;nullon the last page.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theintake.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.
Get a source record
GET/v1/tenants/{tenantSlug}/lms/source-records/{sourceRecordId}
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
sourceRecordIdSource record ID.
Responses
The source record.
connectionNameSource name.
leadIdLead created or updated from it;
nullif none yet.lineageWhere the record came in.
processingStateWhere it is in intake:
RECEIVED,VALIDATED,MAPPED,ROUTED,MATERIALIZED_AS_LEAD, or a stop:NEEDS_MAPPING,NEEDS_ROUTING,INVALID,PROCESSING_FAILED.providerRecordIdThe record's ID in the sending system.
sourceConnectionIdSource ID.
sourceDefinitionKeySource type key, for example
meta_lead_ads.sourceRecordIdSource record ID.
revisionsEvery version of the record received, oldest first.
routingDecisionsEvery routing decision, oldest first.
replayAttemptsReplays of the record, oldest first.
Errors
PARTNER_OPERATION_FORBIDDENThe key lacks theintake.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.SOURCE_RECORD_NOT_FOUNDThe source record does not exist or the key cannot see it.
Replay a source record
POST/v1/tenants/{tenantSlug}/lms/source-records/{sourceRecordId}/replay
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
sourceRecordIdSource record ID.
Request body (application/json)
reasonYour reason code, in upper case (for example
CRM_SYNC). Kept in the lead's history.revisionIdID of the revision.
versionSelectionReplay the
ORIGINALpayload or theCURRENTcorrected revision.
Responses
What happened to the record.
leadIdID of the lead;
nullif none.reasonCodeMachine-readable reason. Branch on this, not on the summary.
sourceRecordIdID of the source record.
sourceRecordRevisionIdID of the source record revision.
statusCurrent status of the source.
validationIssuesProblems found when the record was validated, if any.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theintake.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.SOURCE_RECORD_NOT_FOUNDThe source record does not exist or the key cannot see it.- The change conflicts with the record's current state or a workflow rule;
error.codenames it.
Route a source record by hand
POST/v1/tenants/{tenantSlug}/lms/source-records/{sourceRecordId}/route
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
sourceRecordIdSource record ID.
Request body (application/json)
campaignIdID of the campaign.
reasonYour reason code, in upper case (for example
CRM_SYNC). Kept in the lead's history.revisionIdID of the revision.
Responses
What happened to the record.
leadIdID of the lead;
nullif none.reasonCodeMachine-readable reason. Branch on this, not on the summary.
sourceRecordIdID of the source record.
sourceRecordRevisionIdID of the source record revision.
statusCurrent status of the source.
validationIssuesProblems found when the record was validated, if any.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theintake.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.SOURCE_RECORD_NOT_FOUNDThe source record does not exist or the key cannot see it.- The change conflicts with the record's current state or a workflow rule;
error.codenames it.
List intake exceptions
GET/v1/tenants/{tenantSlug}/lms/exceptions
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
batchIdID of the batch.
sourceConnectionIdID of the source connection.
sourceRecordIdID of the source record.
categoryCategory, from the values below.
limitMaximum number of records to return in one page.
cursorOpaque cursor from the previous page's
nextCursor. Leave it out to start at the first page.
Responses
One page of exceptions.
X-Next-CursorCursor for the next page. Absent on the last page.
An array, not paged. Each item:
attemptCountNumber of attempt records.
batchIdID of the batch.
categoryCategory, from the values below.
kindKind of lead exception.
occurredAtWhen it happened (ISO 8601).
providerRecordIdID of the provider record;
nullif none.reasonCodeMachine-readable reason. Branch on this, not on the summary.
receiptReceivedAtWhen it was receipt received (ISO 8601).
retryableWhether replaying the record may succeed without changing it.
safeSummaryPlain-language summary with personal data removed.
sourceConnectionIdID of the source connection.
sourceConnectionNameName of the source connection, as shown in the LMS.
sourceRecordIdID of the source record;
nullif none.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theintake.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.
List delivery batches
GET/v1/tenants/{tenantSlug}/lms/batches
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
batchIdID of the batch.
sourceConnectionIdID of the source connection.
limitMaximum number of records to return in one page.
Responses
Recent batches.
An array, not paged. Each item:
fileNameFile name, as uploaded.
acceptedCountNumber of accepted records.
attemptCountNumber of attempt records.
batchIdID of the batch.
completedAtWhen it was completed (ISO 8601);
nullif not yet.duplicateCountNumber of duplicate records.
failedCountNumber of failed records.
intakeModeHow leads arrive: pushed by the sender or polled by LMS.
lastFailureCodeCode of the most recent failure;
nullif none.lastFailureSummaryPlain-language summary of the most recent failure;
nullif none.needsMappingCountNumber of needs mapping records.
needsRoutingCountNumber of needs routing records.
receivedCountNumber of received records.
rejectedCountNumber of rejected records.
sourceConnectionIdID of the source connection.
sourceConnectionNameName of the source connection, as shown in the LMS.
startedAtWhen it was started (ISO 8601).
statusCurrent status of the ingestion batch.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theintake.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.
Get a delivery batch
GET/v1/tenants/{tenantSlug}/lms/batches/{batchId}
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
batchIdBatch ID.
Responses
The batch with its attempts and records.
fileNameFile name, as uploaded.
acceptedCountNumber of accepted records.
attemptCountNumber of attempt records.
batchIdID of the batch.
completedAtWhen it was completed (ISO 8601);
nullif not yet.duplicateCountNumber of duplicate records.
failedCountNumber of failed records.
intakeModeHow leads arrive: pushed by the sender or polled by LMS.
lastFailureCodeCode of the most recent failure;
nullif none.lastFailureSummaryPlain-language summary of the most recent failure;
nullif none.needsMappingCountNumber of needs mapping records.
needsRoutingCountNumber of needs routing records.
receivedCountNumber of received records.
rejectedCountNumber of rejected records.
sourceConnectionIdID of the source connection.
sourceConnectionNameName of the source connection, as shown in the LMS.
startedAtWhen it was started (ISO 8601).
statusCurrent status of the ingestion batch.
attemptsProcessing attempts, newest first.
sourceRecordIdsSource records the batch produced.
Errors
PARTNER_OPERATION_FORBIDDENThe key lacks theintake.readscope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.BATCH_NOT_FOUNDThe batch does not exist or the key cannot see it.
Preview a spreadsheet import
POST/v1/tenants/{tenantSlug}/lms/imports/preview
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)
fileThe spreadsheet (
.xlsxor.csv).campaignIdID of the campaign.
sheetNameName of the worksheet.
mappingLead field → column index.
Responses
What the import would do.
fileNameUploaded file name.
campaignIdCampaign the leads go into.
campaignNameCampaign name.
sheetNameSheet read from the workbook.
sheetNamesAll sheets in the workbook.
columnsColumn headings found in the sheet.
mappingLead field → column index used for the import.
targetsLead fields a column can be mapped to.
rowsFirst rows as they would be imported.
rowCountRows in the sheet.
validCountRows that would be imported.
invalidCountRows that would be refused.
duplicateCountRows that match existing leads.
reviewTokenSend it with Import a spreadsheet to import exactly this preview.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theintake.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.- The record does not exist or the key cannot see it.
- The change conflicts with the record's current state or a workflow rule;
error.codenames it. REQUEST_BODY_TOO_LARGEThe upload is too large.
Import a spreadsheet
POST/v1/tenants/{tenantSlug}/lms/imports
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 publishlead.created. - Sending the same request again is safe: it returns the original batch with
alreadyImported: true.
Request body (application/json)
fileThe spreadsheet (
.xlsxor.csv).campaignIdID of the campaign.
sheetNameName of the worksheet.
mappingLead field → column index.
reviewTokenToken from the preview; it ties the import to exactly what you reviewed.
Responses
The import result.
batchIdID of the batch.
fileNameFile name, as uploaded.
campaignIdID of the campaign.
createdCountNumber of created records.
duplicateCountNumber of duplicate records.
alreadyImportedtruewhen this exact preview was imported before; nothing was imported twice.leadsLeads created, by sheet row.
repeatEnquiryCountNumber of repeat enquiry records.
Errors
VALIDATION_ERRORA parameter, header or body field is invalid; compare the request with the fields above (Validation errors).PARTNER_OPERATION_FORBIDDENThe key lacks theintake.writescope.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.- The record does not exist or the key cannot see it.
- The change conflicts with the record's current state or a workflow rule;
error.codenames it. REQUEST_BODY_TOO_LARGEThe upload is too large.