Lead Routes

Set up the lead offer process & select drip campaigns to run when a lead comes in from certain sources

The following fields relate to the Lead Routes endpoint.

MyselfTeam RolloutNoneSpecific TeamZipcode
FieldLimitsRequired?Writeable?
team_id
NoYes

The ID of the team that will be selected for distributing lead offers to.

campaign_id
YesYes
lead_source_id
YesYes
contact_source_id
YesYes

The ID of the contact source. To obtain a list of contact sources, check out /contact-sources

distribution_target
YesYes

Select either a team or the current user to offer a lead to

Possible values:
team_selection_method
NoYes

Valid only if distribution_target is Team Rollout. Select a team by name or by the zipcode associated with the team.

Possible values:
filter
NoYes

An optional filter to further refine the lead route

Permissions

The user can only submit, update, and remove lead routes that they have created.

Notes for Submitting & Updating Records

  • If the Lead Route's distribution_target is equal to Myself, then team and team_selection_method will be automatically set to null
  • If the value of team_selection_method is equal to:
    • Specific Team: a team_id must be specified
    • Zipcode: team will be automatically set to null

Submit one Lead Route

To submit one lead route:

POST https://api-v2.liondesk.com//lead-routes headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }

The request object should have this form:{ "team_id": 3, "campaign_id": 6, "lead_source_id": 31, "contact_source_id": 10, "distribution_target": "Team Rollout", "team_selection_method": "Specific Team", "filter": "Buyer" }

Update one Lead Route

To update some attributes on one lead route:

PATCH https://api-v2.liondesk.com//lead-routes/10 headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }

data: {
team_id: "3",
campaign_id: "6"
}

Get One Lead Route

To get one lead route:

GET https://api-v2.liondesk.com//lead-routes/1 headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }

The response object will have this form:{ "id": 1, "team": { "id": 3, "name": "Schulist, Klein and Fay", "is_sharing_contacts": 1, "order_method": 1, "mins_until_next_alert": 0, "distribution_zipcodes": null }, "campaign": { "id": 9, "name": "Zillow Leads" }, "lead_source": { "id": 1, "name": "Zillow" }, "contact_source": { "id": 1, "name": "Friend/Family Referral" }, "distribution_target": "Team Rollout", "team_selection_method": "Specific Team", "filter": "Buyer" }

Find All Lead Routes

You find/search lead routes by issuing a GET request to the base endpoint:

GET https://api-v2.liondesk.com//lead-routes headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }

The response will contain an array of lead route objects, like so:

{ "total": 2, "limit": 10, "skip": 0, "data": [ { "id": 1, "team": { "id": 3, "name": "Schulist, Klein and Fay", "is_sharing_contacts": 1, "order_method": 1, "mins_until_next_alert": 0, "distribution_zipcodes": null }, "campaign": { "id": 9, "name": "Zillow Leads" }, "lead_source": { "id": 1, "name": "Zillow" }, "contact_source": { "id": 1, "name": "Friend/Family Referral" }, "distribution_target": "Team Rollout", "team_selection_method": "Specific Team", "filter": "Buyer" }, { "id": 3, "team": null, "campaign": { "id": 10, "name": "Trulia Campaign" }, "lead_source": { "id": 3, "name": "Trulia" }, "contact_source": { "id": 3, "name": "My Website" }, "distribution_target": "Team Rollout", "team_selection_method": "Zipcode", "filter": "Seller" } ] }

Filtering Lead Routes

The following filtering operators may be mixed and matched as desired.

Equality

You may query lead route fields directly by specifying equality parameters in the request URI:GET /lead-routes?distribution_target=Myself

You may wish to exclude results having some value with $ne:GET /lead-routes?distribution_target[$ne]=Team Rollout

Limiting and Pagination

$limit will return only the number of results you specify: GET /lead-routes?$limit=2

$skip will skip the specified number of results, useful for paginating:GET /lead-routes?distribution_target=Team Rollout&$limit=2&$skip=2

Inclusion / Exclusion

Find all records where the property values are ($in) some set:GET /lead-routes?lead_source_id[$in]=1If the column matches any of the given values, the resource shall be returned.

Similarly, you may exclude certain values with ($nin):GET /lead-routes?lead_source_id[$nin]=1

Remove

Lead Routes can be removed with a delete request.

DELETE https://api-v2.liondesk.com//lead-routes/92 headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }