Overview
A custom route is a saved cycling route with a name, a page on cyclemate.club and, when you give it a start time, a group ride riders can RSVP to. Our apps create routes through this API, and so can yours, on behalf of a signed-in rider with Login with Cyclemate. Every route belongs to a rider. Your app reads, edits and deletes only the routes it created; the rider’s other routes do not exist for it. Once a route exists, pass itsid as event_id to POST /multi-modal/v2/ to get directions that follow it.
How a route is given
Send one of:stops: two to 25 points in one city. We plan the safest cycling route between them. The simplest way to create a route, and the only way to create a dynamic one.legs: your own line, one GeoJSON LineString per leg, each ending at a named stop. Stored as given and matched to the road network.geometry: one GeoJSON LineString, a one-leg route.
Dynamic and fixed routes
A dynamic route is re-planned between its stops as roads change, so riders always get the current safest line. A fixed route keeps the line you drew. A route made fromstops defaults to dynamic; one made from legs or geometry is fixed.
After a write
Creating or editing a route’s line starts work in the background: a fixed route is matched to the road network, a dynamic one is planned. Until that lands the route answersroute_status: "pending" and is already viewable and rideable; ready means its turn-by-turn steps and safety summary are stored. It usually takes a few seconds.