Lead routing
Read and change your lead routes, try a lead, route the waiting leads and mark people away through the Fondaro API.
These routes let an API key read and change how new leads are routed. Routes are checked top to bottom and the first one that takes the lead and has someone who can get it wins; a route that ends with nobody falls through to the next, then to Smart routing, then to Unassigned. The concepts, the fields of a route and its conditions are in Lead routing; this page lists the /v1 routes.
Reading needs crm:read; changing needs crm:write. Everything here is for organization admins and needs an active plan, except Mark a person away, which any key with crm:write and an active plan may use for its own person. A member's key gets 403 on the admin routes. Writes accept an Idempotency-Key header where noted.
Lead routing is also available to AI clients through Fondaro MCP, with the same rules.
Get lead routing
GET /v1/lead-routing
The routes in order, who gets each route's leads and how, Smart routing on or off, the problems found, who is away, and how many leads each route took.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
days | Query | integer | No | 1 to 90. How many days the per-route counts cover. Default 30 |
position is 0 for the route checked first. summary is the route's conditions in plain words. Each problem is { ruleId, code, sentence }; the codes are listed in Lead routing.
Try a lead
POST /v1/lead-routing/preview
Which route would take a lead, who would get it and why, without assigning anything. Needs crm:read.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
leadId | Body | integer | No | An existing lead |
facts | Body | object | No | A described lead: source, origin, leadType, language (BCP 47), country (two letters), tagIds, growthAreaId, hasPhone, hasEmail, arrivedAt. With leadId they override the lead's own |
Add a route
POST /v1/lead-routing/rules
Adds a route and returns it. Needs crm:write. Accepts an Idempotency-Key header.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
name | Body | string or null | No | Up to 80 characters |
conditions | Body | object or null | No | An AND/OR group of conditions. Null takes every lead |
strategy | Body | string | No | round_robin (default), weighted or smart |
userIds | Body | string or array | No | The people who get the leads |
teamIds | Body | string or array | No | Teams read live when a lead arrives |
weights | Body | object | No | weighted only: percent per user id, adding up to 100 |
paused | Body | boolean | No | A paused route is skipped |
schedule | Body | object or null | No | Office hours: { zone, days: [{ day, from, to }] }, day 1 (Monday) to 7 |
dailyCap | Body | integer or null | No | 1 to 1000. Most leads one person gets a day from this route |
reassignAfterMinutes | Body | integer or null | No | 5 to 10080. Hand the lead on when nobody touched it in this long |
position | Body | integer | No | Where in the order, 0 is first. Default: last, just above Smart routing |
The response is the route, in the shape shown under Get lead routing.
Change a route
PATCH /v1/lead-routing/rules/{ruleId}
Takes any of the fields above. Fields you leave out stay as they are; sending userIds or teamIds replaces the pool. Returns the route. Needs crm:write.
Delete a route
DELETE /v1/lead-routing/rules/{ruleId}
Leads the route would have taken go to the next route. Needs crm:write.
Reorder the routes
PUT /v1/lead-routing/rules/order
Give every route id in the new order, first is checked first. Smart routing always stays last and is not listed. Returns { "routes": [...] }. Needs crm:write.
Switch Smart routing on or off
PUT /v1/lead-routing/smart
On, leads no route takes go to your whole team; off, they wait in Unassigned. Needs crm:write.
Route the waiting leads
POST /v1/lead-routing/route-unassigned
Sends the leads waiting in Unassigned through your routes now: up to 500, oldest first. A lead someone assigns meanwhile is left alone. Takes no body. Needs crm:write.
Mark a person away
PUT /v1/lead-routing/away
Routing skips the person until the date. An admin may set anyone; anyone else may set only themself (leave userId out). Needs crm:write.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
userId | Body | string | No | Whose away date. Default: the key's person |
until | Body | string or null | Yes | ISO date or time they are back. null means back now |