Update Route
Update an existing route record in Samsara by its ID.
Operation
Section titled “Operation”updateRoute
Resource
Section titled “Resource”route
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Route ID | string | Yes | - | The ID of the route to update |
Update Fields
Section titled “Update Fields”| Field | Type | Description |
|---|---|---|
| Name | string | The name of the route |
| Notes | string | Notes about the route |
| Driver ID | string | The ID of the driver assigned to the route |
| Vehicle ID | string | The ID of the vehicle assigned to the route |
| Stops (JSON) | json | Array of route stops (overwrites all existing stops) |
| Route Starting Condition | options | Condition that marks the route as started |
| Route Completion Condition | options | Condition that marks the route as completed |
| External IDs (JSON) | json | External IDs as a JSON object |
Response
Section titled “Response”Success
Section titled “Success”Returns the updated route record:
{ "id": "route_123", "name": "Morning Delivery Route - Updated", "driverId": "driver_456", "vehicleId": "vehicle_789", "notes": "Updated notes", "stops": [], "settings": { "routeStartingCondition": "departFirstStop", "routeCompletionCondition": "departLastStop" }}{ "success": false, "error": "Route not found", "routeId": "invalid_id"}Error Handling
Section titled “Error Handling”- Missing API Token: Samsara credential is missing apiToken
- Route Not Found: Route with specified ID does not exist
- Invalid Stops Format: Stops JSON is malformed
- Validation Error: Invalid field values provided