Skip to content

Create Route

Create a new route with stops and assignments in Samsara.

createRoute

route

ParameterTypeRequiredDefaultDescription
NamestringYes-The name of the route
Stops (JSON)jsonYes[]Array of route stops
FieldTypeDefaultDescription
Driver IDstring-The ID of the driver assigned to the route
Vehicle IDstring-The ID of the vehicle assigned to the route
Notesstring-Notes about the route
Route Starting ConditionoptionsarriveFirstStopCondition that marks the route as started
Route Completion ConditionoptionsarriveLastStopCondition that marks the route as completed
External IDs (JSON)json{}External IDs as a JSON object
ValueDescription
arriveFirstStopRoute starts when arriving at first stop
departFirstStopRoute starts when departing first stop
ValueDescription
arriveLastStopRoute completes when arriving at last stop
departLastStopRoute completes when departing last stop

Each stop in the stops array should have:

{
"scheduledArrivalTime": "2024-01-15T10:00:00Z",
"addressId": "address_123",
"notes": "Deliver to loading dock"
}

Or for single-use locations:

{
"scheduledArrivalTime": "2024-01-15T10:00:00Z",
"singleUseLocation": {
"latitude": 32.7767,
"longitude": -96.7970,
"address": "123 Main St, Dallas, TX"
}
}
{
"id": "route_123",
"name": "Morning Delivery Route",
"driverId": "driver_456",
"vehicleId": "vehicle_789",
"stops": [],
"settings": {
"routeStartingCondition": "arriveFirstStop",
"routeCompletionCondition": "arriveLastStop"
}
}
{
"success": false,
"error": "Invalid stops format",
"name": "Morning Delivery Route"
}
  • Missing API Token: Samsara credential is missing apiToken
  • Invalid Stops Format: Stops JSON is malformed
  • Invalid Address ID: Referenced address does not exist
  • Invalid Driver/Vehicle ID: Referenced driver or vehicle does not exist