routing

Plans a chain of errands against a hard arrival time.

Returns 200 whether or not the chain fits: an infeasible chain is an answer, with the errand that costs the most named and the largest set that does fit planned out in full. The precedent is POST /v1/ev/plan, which answers feasible: false with a named cause rather than inventing a journey, and the reasoning is identical. A driver who cannot do all three things needs to be told which two they can.

post/v1/errands/plan

Request

  • Base URL: https://api.mapmap.ai
  • URL: https://api.mapmap.ai/v1/errands/plan
  • Auth: one of:
    • HTTP bearer
    • API key in query parameter api_key

Request body

arrive_bystring required

The hard arrival time, RFC 3339 with an offset.

costing_optionsunknown
depart_atstring nullable

When they set off, RFC 3339. Defaults to now, in the offset arrive_by carries.

max_detour_minutesnumber double nullable

How far off the direct route a candidate may sit, as a detour in minutes. Default [DEFAULT_MAX_DETOUR_MINUTES].

Response

The plan, feasible or honestly not: {feasible, departure, arrive_by, arrival, slack_s, plan: {stops[]: {errand, kind, category, place: {name, label, lat, lon, id}, arrive, depart, dwell_s, drive_s, distance_m, hours: {verdict, tag, source, message}}, final_leg, total_drive_s, total_dwell_s, total_duration_s, total_distance_m}, errands[], search, opening_hours, geometry_polyline6, usage, verification, attribution}. geometry_note replaces geometry_polyline6 when the follow-up route through the stops failed: the plan stands, only the drawn line is missing. hours_note appears when the window crosses the hour a clock change can fall on and a stop was reached after it: those stops read unknown whatever their tag says. When feasible is false the answer carries reason {code, message, over_by_s, blocking: {errand, adds_s}} and, where anything at all fits, achievable: the largest set of errands that does fit, planned in full, with dropped naming what had to go

object required

Changes

No recorded changes to this operation across all 1 revision of this API.