A router receives leads at a single URL and decides which flow and source should handle each one. It is useful when the same lead format arrives for many campaigns, or when a partner can only post every lead to one endpoint: LeadConduit picks the destination by looking at the lead itself.
A router has an inbound integration, which parses the incoming request, and an ordered
list of routes. Each route pairs a rule set with a flow and a source. When a lead arrives
at POST /routers/{router_id}/route, the rules of every route are evaluated against the
parsed lead and the last matching route wins. The lead is then submitted to that flow and
source exactly as if it had been sent to /flows/{flow_id}/sources/{source_id}/submit.
Add dry_run=true to the request to see which route would match without submitting
anything.
A router is a single lead-submission endpoint that's able to distribute lead submissions to any one of an account's various Flows, based on evaluation of rules.
The rules of every route are evaluated against the lead, and the last route that matches selects the Flow and Source.
Only one Router for a given integration module-id should exist in an account.
| id | string (ID) ^[0-9a-fA-F]{24}$ ID of this router |
| module_id | string (ModuleID) The unique identifier of the integration module |
Array of objects (Route) The routes to be evaluated by this router | |
| created_at | string <date-time> (Timestamp) |
| updated_at | string <date-time> (Timestamp) |
{- "id": "5fd4371e940df5a34a3888b2",
- "module_id": "leadconduit-salesforce.outbound.create_contact",
- "routes": [
- {
- "id": "1aacd0",
- "flow_id": "5fd4371e940df5a34a3888b2",
- "source_id": "5fd4371e940df5a34a3888b2",
- "rule_set": {
- "id": "1aacd0",
- "op": "and",
- "rules": [
- {
- "id": "1aacd0",
- "lhv": "string",
- "op": "is equal to",
- "rhv": "TX",
- "rule_set": { }
}
]
}
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}[- {
- "id": "5fd4371e940df5a34a3888b2",
- "module_id": "leadconduit-salesforce.outbound.create_contact",
- "routes": [
- {
- "id": "1aacd0",
- "flow_id": "5fd4371e940df5a34a3888b2",
- "source_id": "5fd4371e940df5a34a3888b2",
- "rule_set": {
- "id": "1aacd0",
- "op": "and",
- "rules": [
- {
- "id": "1aacd0",
- "lhv": "string",
- "op": "is equal to",
- "rhv": "TX",
- "rule_set": { }
}
]
}
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
]Create a new custom router, adding it to the list of all routers in the account.
Created
{- "module_id": "leadconduit-salesforce.outbound.create_contact",
- "routes": [
- {
- "rule_set": {
- "op": "and",
- "rules": [
- {
- "lhv": "string",
- "op": "is equal to",
- "rhv": "TX",
- "rule_set": { }
}
]
}
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}[- {
- "id": "5fd4371e940df5a34a3888b2",
- "module_id": "leadconduit-salesforce.outbound.create_contact",
- "routes": [
- {
- "id": "1aacd0",
- "flow_id": "5fd4371e940df5a34a3888b2",
- "source_id": "5fd4371e940df5a34a3888b2",
- "rule_set": {
- "id": "1aacd0",
- "op": "and",
- "rules": [
- {
- "id": "1aacd0",
- "lhv": "string",
- "op": "is equal to",
- "rhv": "TX",
- "rule_set": { }
}
]
}
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
]{- "id": "5fd4371e940df5a34a3888b2",
- "module_id": "leadconduit-salesforce.outbound.create_contact",
- "routes": [
- {
- "id": "1aacd0",
- "flow_id": "5fd4371e940df5a34a3888b2",
- "source_id": "5fd4371e940df5a34a3888b2",
- "rule_set": {
- "id": "1aacd0",
- "op": "and",
- "rules": [
- {
- "id": "1aacd0",
- "lhv": "string",
- "op": "is equal to",
- "rhv": "TX",
- "rule_set": { }
}
]
}
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Update an existing custom router. Standard routers cannot be updated.
Update an existing Router
OK
{- "module_id": "leadconduit-salesforce.outbound.create_contact",
- "routes": [
- {
- "rule_set": {
- "op": "and",
- "rules": [
- {
- "lhv": "string",
- "op": "is equal to",
- "rhv": "TX",
- "rule_set": { }
}
]
}
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}[- {
- "id": "5fd4371e940df5a34a3888b2",
- "module_id": "leadconduit-salesforce.outbound.create_contact",
- "routes": [
- {
- "id": "1aacd0",
- "flow_id": "5fd4371e940df5a34a3888b2",
- "source_id": "5fd4371e940df5a34a3888b2",
- "rule_set": {
- "id": "1aacd0",
- "op": "and",
- "rules": [
- {
- "id": "1aacd0",
- "lhv": "string",
- "op": "is equal to",
- "rhv": "TX",
- "rule_set": { }
}
]
}
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
]Submits a lead to a router instead of to a specific flow and source. The router's
inbound integration parses the request, the rules of each route are evaluated against
the lead, and the last matching route decides which flow and source receive it. From
there the lead is processed exactly as a submission to
/flows/{flow_id}/sources/{source_id}/submit, and the response is the same.
The body may be JSON, XML, or form encoded; set the Content-Type header accordingly.
No credentials are needed.
Add dry_run=true to find out which route would match without submitting the lead.
The lead data to route, as key-value pairs.
Returned only with dry_run=true. Reports the route that would handle the lead, or that none matched.
The lead was routed and processed. Check outcome: a lead rejected by the flow's
acceptance criteria or by a cap is also reported here, with outcome: "failure".
No router exists with this ID.
The request body is larger than the 10 MB limit.
The router_id is not a valid ID, or no route matched the lead.
{- "email": "user@example.com",
- "fname": "Example User"
}{- "message": "Route matched",
- "module_id": "leadconduit-default.inbound",
- "flow_id": "5fd4371e940df5a34a3888b2",
- "source_id": "5fd4371e940df5a34a3888b2"
}An alternative to POST /routers/{router_id}/route for senders that cannot issue a
request body. The lead fields are read from the query string. Behavior, including
dry_run=true, is otherwise identical to the POST form.
Returned only with dry_run=true. See the POST form.
The lead was routed and processed. See the POST form.
No router exists with this ID.
The router_id is not a valid ID, or no route matched the lead.
{- "outcome": "success",
- "reason": "lead.phone must have valid format",
- "lead": {
- "id": "5fd4371e940df5a34a3888b2"
}, - "price": 20
}