Update a route

Update a route. Note this implementation of patch uses the JSON merge patch proposed standard. This means that any fields included in the patch request will overwrite fields which exist on the target resource. For arrays, this means any array included in the request will replace the array that exists at the specified path, it will not add to the existing array.

The legacy version of this endpoint (which uses PUT instead of PATCH) 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.

Path Params
string
required

ID of the route. This can either be the Samsara-specified ID, or an external ID. External IDs are customer specified key-value pairs created in the POST or PATCH requests of this resource. To specify an external ID as part of a path parameter, use the following format: key:value. For example, payrollId:ABFS18600

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

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

List of stops along the route. If a valid id of a stop is provided, that stop will be updated. If no id is provided for a passed in stop, that stop will be created. If id value are passed in for some stops and not for others, those with id value specified will be retained and updated in the original route, those without id value specified in the body will be created, and those without id value specified that already existed on the route will be deleted. For each new 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, if a new first job is being added.

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