Itineraries
Two queries read the itineraries you already have: itinerary returns one in full, and exportItinerary prepares it as a route file. To create or edit an itinerary, use the Map Studio API.
Every sample on this page reuses this setup. It mints a session token with your secret key, so run it on your server.
This token is minted without user_id, so it reads your itineraries as last published. To read drafts, mint it with a member's user_id, as authentication shows.
Read one itinerary with its segments and waypoints. Replace the id with one of yours: search finds it by name.
Segments come in order, with distances in meters and durations in seconds. Select a segment's geometry to draw it, and groups for named legs such as "Day 1".
Prepare an itinerary as a route file. The query answers a short-lived download link, not the file itself.
Fetch url before expiresAt to download the file. format takes GPX, KML, KMZ, GEOJSON, CSV, FIT, or TCX.