Skip to main content

Get a day's visits in an order to drive them

GET/api/v1/calendar/route

The visits on one day that are scheduled or in progress, in a sensible order to drive them: out from the business's own postcode to the nearest visit, then the nearest to that, with the route then shortened where it doubles back. A technician gets their own visits. An owner or office member gets everyone's, or one person's with membership_id. Distances are straight lines between the middles of postcodes, so the order is a suggestion: it changes no visit's time, and booked_order says whether the visits are already booked in it. A visit whose property has no position is listed in unplaced_visit_ids. Positions come from open postcode data for Great Britain: show meta.attribution wherever you show them. More than 250 visits in the day answers 422 route_too_large; ask for one person's.

  • Needs an API key, and runs with the access of the member who made the key.
  • A connected AI assistant can use it too, as getDayRoute.

Parameters

In the query string

  • datestring (date)required

    The day, in the workspace's time zone.

  • membership_idstring (uuid)

    One person's visits. Owners and office members only; a technician always gets their own.

Responses

200The day's visits in an order to drive them, and what to show beside their positions.

  • dataobjectrequired

    Fields(6)
    • datestring (date)required

    • startobject or nullrequired

      Where the route sets out from, which is the postcode in the business's address. Null when the address has no postcode with a position; the route then starts at the visit booked earliest.

      Fields(3)
      • latitudenumber (double)required

        At least -90. At most 90.

      • longitudenumber (double)required

        At least -180. At most 180.

      • labelstringrequired

        The business's postcode.

    • stopsarray of objectrequired

      Each item(8)
      • positionintegerrequired

        Where it comes on the route, counting from 1.

        At least 1.

      • visit_idstring (uuid)required

      • customer_idstring (uuid)required

      • property_idstring (uuid)required

      • scheduled_start_atstring (date-time)required

      • latitudenumber (double)required

        At least -90. At most 90.

      • longitudenumber (double)required

        At least -180. At most 180.

      • metres_from_previousinteger or nullrequired

        Metres in a straight line from the stop before, or from `start` for the first. Null for the first stop when there is no `start`.

    • unplaced_visit_idsarray of string (uuid)required

      Visits on the day that are not on the route, because the property has no position yet or the visit has no property.

    • distance_metresintegerrequired

      The route's length in a straight line from stop to stop.

    • booked_orderbooleanrequired

      True when the stops, in this order, are also in the order their visits are booked.

  • metaobjectrequired

    Fields(2)
    • attributionstringrequired

    • attribution_urlstring (uri)required

A refusal answers in the one error shape every operation shares.

Example

A request our own tests send. The ids are made up: put your own in their place.

curl "https://app.tradesender.co.uk/api/v1/calendar/route?date=2026-10-14" \
  -H "Authorization: Bearer $TRADESENDER_KEY"