plot_trip
Creates a road trip on Stopful, or updates one plotted earlier, and returns an interactive map of it — adding, removing, reordering or renaming stops, changing nights, dates or party size, and redrawing the route. Renders a multi-stop driving route as an interactive map and returns a link to it, plus an inline map in clients that support one. Takes a list of stops in driving order, each with a place name, optional decimal lat/lon and number of nights; a stop without coordinates is geocoded from its name, and coordinates that fall far from where the name resolves are reported back in the result. Accepts an optional trip name, start date, party size, and a day-by-day itinerary that becomes a day view over the map. The map shows per-leg drive times and distances and an estimate of what the trip will cost before anything is booked, and is editable: the traveller can drag a pin to move a stop or drag the route to add one, and their changes are saved to the trip. Covers road trips and other multi-stop routes; a single destination or a route with no stops to draw has nothing to render. The result contains the map link, the trip as structured data, and the trip's id (see the id parameter for updating an existing trip).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Optional. Id of a trip returned by an earlier call, identifying which trip this call applies to. To change an existing trip, send its `id` together with the COMPLETE new `stops` and `days` — the call replaces the itinerary rather than merging into it, and there are no partial updates. The map link then stays the same, and edits the traveller made on the map survive: a re-sent stop keeps the position they dragged it to, and stops or waypoints they added on the map but absent from `stops` are kept, while a stop that was there before and is now omitted is removed. Without an `id` a separate new trip is created and none of those map edits carry over. Sending `id` with no `stops` is also accepted and changes nothing — it returns the trip exactly as saved. | |
| days | No | The day-by-day itinerary: one entry per calendar day of the trip, in order, each with a title and the day's activities. It renders as a tappable day view over the map, and selecting a day highlights that day's driving; the activities also become the trip's itinerary in the full Stopful planner, where the traveller can edit them. Send it when planning a trip, or when deliberately rewriting the itinerary — it REPLACES the saved one wholesale, there are no partial day updates. On a call that only changes the route of an existing trip, leaving `days` out keeps the saved itinerary untouched, which is usually what is wanted; the result echoes whatever is saved either way. | |
| name | No | Optional trip name (e.g. 'Lisbon → Pyrenees'). Defaults to first → last stop. | |
| stops | Yes | The route in driving order, 1 to 40 entries (the first is the origin). Required for a normal call — the only call that omits it is `id` on its own, which re-reads a saved trip unchanged. Each entry needs `name`; every other field is optional. | |
| guests | No | Optional party size. | |
| startDate | No | Optional trip start as ISO yyyy-mm-dd. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | The trip's id. Pass it back as the `id` argument to apply a later change to this same trip. | |
| url | Yes | Link that opens this trip on the map at stopful.com. | |
| days | No | The day-by-day itinerary. Activities may include ones the traveller added in the planner rather than through this tool. | |
| trip | Yes | The trip as rendered, after geocoding and (on a continuation) merging the traveller's own map edits. | |
| assumed | No | Stops placed from their name alone because no coordinates were given — approximate pins. | |
| notFound | No | Stops that were requested but could not be placed, so they are absent from the map and the route. | |
| warnings | No | Stops whose supplied coordinates are far from where their name resolves, with the distance and the resolved position. | |
| unchanged | No | True when the call only read the saved trip and changed nothing — an `id` sent with no `stops`. | |
| keptByTraveller | No | Stops left where the traveller placed them on the map, so the coordinates supplied in this call were not applied. |