Quickstart
This guide takes an empty organization to a published itinerary in four calls. Every request goes to https://internal.mountaya.com.
You need a publishable key (pk_…) with the resources scope, and the id of an organization member to attribute the writes to. If your organization enables session enforcement (require_session_token), also send a session token; see authentication for all three.
1
An itinerary picks its activity at creation and keeps it for life — every segment inherits it. Activities are identified by uuid, so read the catalog once and cache it.
Reads take the key alone. The next three calls write, so they each add X-User-Id.
2
POST /v1/itineraries takes a name, the activity id, and whether the itinerary is private. It answers 201 Created with the itinerary and its empty segments and waypoints arrays.
A name already taken inside the organization answers 409 Conflict, naming the itinerary that holds it at extensions.metadata.itinerary.
3
Segments carry the geometry. A segment in directions mode takes between 2 and 45 waypoints as a GeoJSON LineString, and the router snaps them to the trail network for the itinerary's activity.
Coordinates are [longitude, latitude] in WGS 84. Distance, duration, ascent, surface, and way type come back computed from the routed line — you never send them, and sending them changes nothing.
To draw a line the router should leave alone, send "mode": "linestring" and the geometry is stored as given.
4
Editing changes only the draft. Share links, embeds, and the tiles they render serve the last published snapshot, and an itinerary that has never been published resolves to nothing on any of them. Publishing freezes the current draft into the next publication.
The call takes no body and returns the itinerary with its status, published_at, and has_unpublished_changes reflecting the new publication. An itinerary with no segments is refused with a 400; one whose segments a collaborator still holds open is refused with a 409 naming that collaborator at extensions.metadata.holder.id, so you can say who to wait for rather than just that the publish failed. See conflicts.