Create a route

Create a route. The legacy version of this endpoint can be found at samsara.com/api-legacy.

Rate limit: 100 requests/min (learn more about rate limits here).

To use this endpoint, select Write Routes under the Driver Workflow category when creating or editing an API token. Learn More.

Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team.

Body Params
string

ID of the driver. Can be either a unique Samsara ID or an external ID for the driver.

externalIds
object

A map of external ids

string
required

Name for the route

string
length ≤ 2000

Notes about the route.

boolean

This optional boolean parameter controls whether route schedule arrival and departure times are recalculated. When set to true, the system will automatically recompute the scheduledArrivalTime and scheduledDepartureTime for each stop along the route during route creation. This process overrides any manually provided values, with the exception of the first stop, which retains its user-defined schedule.

settings
object

An optional dictionary, only necessary to override the defaults for route start and end conditions.

stops
array of objects
required
length ≥ 2

List of stops along the route. For each stop, exactly one of addressId and singleUseLocation are required. Depending on the settings on your route, either a scheduledArrivalTime or scheduledDepartureTime must be specified for the first job.

stops*
tagIds
array of strings

An array of IDs of tags to associate with this route.

tagIds
string

ID of the vehicle. Can be either a unique Samsara ID or an external ID for the vehicle.

Responses

Language
Credentials
Bearer
URL
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json