Edit an itinerary's route
An itinerary's route is a chain of segments, each starting where the one before it ends. A segment is routed along trails or drawn as you give it. Waypoints mark places along the route, and groups give a run of segments one name.
Writes act as a member, so mint a session token that names one, as in the quickstart:
The examples below edit $ITINERARY_ID, an itinerary of yours with one segment.
Read the itinerary for each segment's id and position:
Every write to a segment, a waypoint or a group answers this same whole itinerary, so read the new positions from it.
POST a segment to add it. It joins the end of the chain, or lands before the segment that before_segment_id names. This one goes first, so the route starts in Les Houches:
The neighbours move to meet the new segment, and a routed neighbour is routed again. extensions.metadata.created.id names the segment created.
split cuts a segment at a fraction of its length. The first half keeps the segment's id, and the second half is created after it:
merge joins a segment with the one after it, and the result keeps the first one's id. It takes no body:
Keep the Idempotency-Key for a retry: a merge sent twice with a new key merges again.
convert turns a routed segment into a drawn line, or a drawn line into a route along the trails. The segment keeps its ends, so its neighbours do not move:
A group gives a run of consecutive segments one name and color, on the elevation profile and in the segment list. The segments themselves do not change. This one groups the first two:
A waypoint marks a place along the route: a hut, a water point, a cut-off. Its position orders it among the others:
PATCH a waypoint to add services or a cut-off, as the race course tutorial does.
Only the first or the last segment of a chain can be deleted, with DELETE on its path. Removing one in the middle would break the chain, so the API refuses it with a 409.