Skip to content
IsochroneMapsOpen Studio

Lead Routing API

Send a lead’s address, ZIP code or coordinates with a saved map’s ID. Get back the territory, drive-time band or radius it falls in, and the rep you assigned to it.

curl -X POST https://isochronemaps.com/api/v1/route-lead \
  -H "Content-Type: application/json" \
  -d '{"mapId":"austin-demo","address":"1100 Congress Ave, Austin, TX"}'

Response

Send a request to see the JSON response.

The playground uses the public demo map austin-demo: three downtown ZIPs plus 5, 15 and 30-minute drive-time bands. Paste your own map ID from the studio’s Embed tab.

Request

POST https://isochronemaps.com/api/v1/route-lead
Content-Type: application/json
Authorization: Bearer wk_…        (optional: your workspace key)

{ "mapId": "austin-demo", "lat": 30.2672, "lng": -97.7431 }
{ "mapId": "austin-demo", "address": "1100 Congress Ave, Austin, TX" }
{ "mapId": "austin-demo", "zip": "78702" }

Response

{
  "matched": true,
  "matchedTerritory": "Austin Central",
  "kind": "isochrone",          // "zip" | "isochrone" | "radius" | null
  "driveMinutes": 5,            // the band's upper bound, for drive-time matches
  "radiusMiles": null,          // for radius matches
  "rep": "central-team",
  "zip": null,                  // the ZIP you sent, or the geocoded one
  "distanceMiles": 0.24,        // straight line to the nearest map centre or pin
  "point": { "lat": 30.2672, "lng": -97.7431 },
  "mapId": "austin-demo",
  "tookMs": 0.4
}

JavaScript

const res = await fetch("https://isochronemaps.com/api/v1/route-lead", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: `Bearer ${process.env.ISOCHRONEMAPS_KEY}` },
  body: JSON.stringify({ mapId: "YOUR_MAP_ID", address: lead.address }),
})
const { matched, matchedTerritory, rep } = await res.json()
if (matched) assignTo(rep)

Rule types

Matching is a deterministic ray-casting point-in-polygon test, so the same input always gets the same answer. Build the shapes on the territory map, drive time map or radius map.

Authentication and limits

Your workspace key is created in your browser the first time you save a map, and shown under “Workspace and API key” on the studio’s Embed tab. Send it as Authorization: Bearer wk_…. Without it, or for maps another workspace saved, the free limits apply.

PlanCalls per map per dayBurst
Free Studio10060 / min
Embed Pro1,000300 / min
Territory Team5,000300 / min
Routing API50,0001,200 / min

Errors

StatuserrorMeaning
400bad_requestNo lat/lng, address or 5-digit zip in the body.
404map_not_foundThe mapId does not exist.
422address_not_found / zip_unknownThe address could not be placed, or the ZIP has no Census ZCTA (PO-box-only ZIPs).
429rate_limited / daily_quotaToo many requests. Retry-After says when to try again.

CORS is open, so you can call the API from a browser form. Do not put your workspace key in public front-end code; call it from your server or a form-handler function instead. Plans and limits are on the pricing page.

Frequently asked questions

How fast is the lead-routing API?

Requests with coordinates or a ZIP are answered from memory, typically in a few milliseconds of server time; the response includes tookMs. Requests with a street address add a geocoding step, which is usually under a second and cached afterwards.

Do I need an API key?

No key is needed to test against any saved map, within the free limits. Send your workspace key as a Bearer token to apply your plan's limits to maps your workspace saved.

What happens when a lead is in two areas?

The API returns one match, chosen in a fixed order: an explicit ZIP listed in a ZIP territory first, then the smallest containing area (ZIP territories, then drive-time bands from shortest, then radius circles from smallest).

Can I route by drive time without saving a map?

Routing runs against saved maps so that the boundary is fixed and every lead is judged against the same shape. Draw the drive-time bands in the studio, save, and use the map ID.

Is the result accurate enough to assign leads automatically?

Results depend on input data: address geocoding from OpenStreetMap, Census ZCTA boundaries for ZIPs and estimated free-flow drive times. Validate a sample of routed leads before using it for anything with financial or legal weight.