[Beta] RouteStopDeparture Event Schema

[Beta] RouteStopDeparture Webhook Payload

This webhook works for routes assigned to either vehicles or drivers.

Example

{
    "eventId": "017db07f-6e95-470e-8cc0-a371f9deed2b",
    "eventTime": "1970-01-20T06:39:05.683Z",
    "eventType": "RouteStopDeparture",
    "orgId": 20936,
    "webhookId": "1411751028848270",
    "data": {
        "assignedAtTime": "2019-06-13T19:08:25Z",
        "assignedToRoute": "vehicle",
        "clocks": {
            "break": {
                "timeUntilBreakDurationMs": 28800000
            },
            "cycle": {
                "cycleRemainingDurationMs": 28800000,
                "cycleStartedAtTime": "2020-01-27T07:06:25Z",
                "cycleTomorrowDurationMs": 28800000
            },
            "drive": {
                "driveRemainingDurationMs": 28800000
            },
            "shift": {
                "shiftRemainingDurationMs": 28800000
            }
        },
        "currentDutyStatus": {
            "hosStatusType": "driving"
        },
        "driver": {
            "externalIds": {
                "payrollId": "ABFS18600"
            },
            "id": "45646",
            "name": "Driver Bob"
        },
        "operation": "stop arrived",
        "route": {
            "actualRouteEndTime": "2019-06-13T19:08:25Z",
            "actualRouteStartTime": "2019-06-13T19:08:25Z",
            "externalIds": {
                "myRouteId": "abc"
            },
            "id": "342341",
            "name": "Bid 123",
            "notes": "These are my notes",
            "scheduledRouteEndTime": "2019-06-13T19:08:25Z",
            "scheduledRouteStartTime": "2019-06-13T19:08:25Z",
            "settings": {
                "routeCompletionCondition": "arriveLastStop",
                "routeStartingCondition": "departFirstStop",
                "sequencingMethod": "scheduledArrivalTime"
            },
            "stops": [
                {
                    "actualArrivalTime": "2006-01-02T15:04:05+07:00",
                    "actualDepartureTime": "2006-01-02T15:04:05+07:00",
                    "actualDistanceMeters": 5450,
                    "address": {
                        "externalIds": {
                            "siteId": "54"
                        },
                        "id": "494123",
                        "name": "Company Office #1"
                    },
                    "appointmentWindows": [
                        {
                            "endTime": "2019-06-13T20:08:25Z",
                            "startTime": "2019-06-13T19:08:25Z"
                        }
                    ],
                    "documents": [
                        {
                            "id": "494123",
                            "name": "Fuel Receipt Wichita"
                        }
                    ],
                    "enRouteTime": "2006-01-02T15:04:05+07:00",
                    "eta": "2006-01-02T15:04:05+07:00",
                    "externalIds": {
                        "siteId": "54"
                    },
                    "forms": [
                        {
                            "id": "12345"
                        }
                    ],
                    "id": "324231",
                    "issues": [
                        {
                            "id": "32812"
                        }
                    ],
                    "liveSharingUrl": "https://cloud.samsara.com/fleet/viewer/job/fleet_viewer_token",
                    "locationLiveSharingLinks": [
                        {
                            "expiresAtTime": "2020-01-27T07:06:25Z",
                            "liveSharingUrl": "https://cloud.samsara.com/o/123456/fleet/viewer/address/gEAitEnnOwcv92cuPzcU",
                            "name": "Name"
                        }
                    ],
                    "name": "Stop #1",
                    "notes": "These are my notes",
                    "ontimeWindowAfterArrivalMs": 300000,
                    "ontimeWindowBeforeArrivalMs": 300000,
                    "plannedDistanceMeters": 5200,
                    "scheduledArrivalTime": "2019-06-13T19:08:25Z",
                    "scheduledDepartureTime": "2019-06-13T19:08:25Z",
                    "sequenceNumber": 10,
                    "singleUseLocation": {
                        "address": "1234 Main St, San Jose, CA",
                        "latitude": 123.456,
                        "longitude": 37.459,
                        "radiusMeters": 100
                    },
                    "skippedTime": "2006-01-02T15:04:05+07:00",
                    "state": "scheduled"
                }
            ]
        },
        "routeStopDetails": {
            "actualArrivalTime": "2006-01-02T15:04:05+07:00",
            "actualDepartureTime": "2006-01-02T15:04:05+07:00",
            "enRouteTime": "2006-01-02T15:04:05+07:00",
            "eta": "2006-01-02T15:04:05+07:00",
            "externalIds": {
                "siteId": "54"
            },
            "id": "141414",
            "liveSharingUrl": "https://cloud.samsara.com/fleet/viewer/job/fleet_viewer_token",
            "orders": [
                {
                    "id": "a50e8400-e29b-41d4-a716-446655440006"
                }
            ],
            "skippedTime": "2006-01-02T15:04:05+07:00",
            "state": "scheduled"
        },
        "time": "2020-01-27T07:06:25Z",
        "type": "route tracking",
        "vehicle": {
            "assetType": "vehicle",
            "externalIds": {
                "maintenanceId": "250020"
            },
            "gateway": {
                "model": "VG34",
                "serial": "GFRV-43N-VGX"
            },
            "id": "494123",
            "licensePlate": "6SAM123",
            "name": "Fleet Truck #1",
            "vin": "1GBJ6P1B2HV112765"
        }
    }
}

Reference

Property NameDescription
assignedAtTime
string
An assigned at time in RFC 3339 format. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00).
assignedToRoute
string
Whether the route is currently assigned to a driver or vehicle. Valid values: vehicle, driver, unassigned.
clocks
object
Remaining durations and start times (where applicable) for various HOS rules. See this page for more information on HOS rules.
 break
 object
Remaining durations for the HOS rest break requirement.
  timeUntilBreakDurationMs
  integer
Time until the driver has a required break in milliseconds.
 cycle
 object
Remaining durations and start time for the HOS driving cycle.
  cycleRemainingDurationMs
  integer
Remaining on duty or driving time the driver has in the current cycle in milliseconds. For property-carrying drivers, this is the amount of time the driver can be on duty or driving before hitting the 60/70-hour limit in 7/8 days.
  cycleStartedAtTime
  string
UTC timestamp in RFC 3339 format.
  cycleTomorrowDurationMs
  integer
Remaining on duty or driving time the driver has available tomorrow in milliseconds. For property-carrying drivers this is calculated based on the 60/70-hour limit in 7/8 days rule.
 drive
 object
Remaining durations for the HOS driving shift limits.
  driveRemainingDurationMs
  integer
Remaining driving time the driver has in the current shift in milliseconds. For property-carrying drivers, this is the amount of time the driver can drive before hitting the 11-hour limit.
 shift
 object
Remaining durations and start time for the HOS on duty shift limits.
  shiftRemainingDurationMs
  integer
Remaining on duty or driving time the driver in the current shift in milliseconds. For property-carrying drivers, this is the amount of time the driver can be on duty or driving before hitting the 14-hour limit.
currentDutyStatus
object
The current HOS status type and time the driver started being in this status.
 hosStatusType
 string
The Hours of Service status type. If the driver app is disconnected, an empty string will be returned. To reconnect the app and return updated values, drivers should have the app open with good cell service. Valid values: offDuty, sleeperBed, driving, onDuty, yardMove, personalConveyance.
driver
object
A minified driver object. This object is always returned, regardless of route assignment.
 externalIds
 object
A map of external ids
 id
 string
ID of the driver
 name
 string
Name of the driver
operation
string
The operation that was performed as part of this route update. Valid values: stop arrived, stop departed.
route
object
 actualRouteEndTime
 string
Actual end time, if it exists, for the route in RFC 3339 format.
 actualRouteStartTime
 string
Actual start time, if it exists, for the route in RFC 3339 format.
 externalIds
 object
A map of external ids
 id
 string
ID of the route
 name
 string
Route name
 notes
 string
Notes for the route
 scheduledRouteEndTime
 string
Scheduled end time, if it exists, for the route in RFC 3339 format.
 scheduledRouteStartTime
 string
Scheduled start time, if it exists, for the route in RFC 3339 format.
 settings
 object
An optional dictionary, only necessary to override the defaults for route start and end conditions.
  routeCompletionCondition
  string
Defaults to 'arriveLastStop' which ends the route upon arriving at the final stop. The condition 'departLastStop'
ends the route upon departing the last stop. If 'arriveLastStop' is set, then the departure time of the final stop should not be set. Valid values: arriveLastStop, departLastStop.
  routeStartingCondition
  string
Defaults to 'departFirstStop' which starts the route upon departing the first stop in the route.
The condition 'arriveFirstStop' starts the route upon arriving at the first stop in the route. If 'departFirstStop' is set,
the arrival time of the first stop should not be set. Valid values: departFirstStop, arriveFirstStop.
  sequencingMethod
  string
Determines how stops are sequenced on the route. 'scheduledArrivalTime' sequences stops by their scheduled arrival times (default). 'manual' allows custom sequencing via stop.sequenceNumber. 'unknown' indicates the method is not specified. Valid values: unknown, scheduledArrivalTime, manual.
 stops
 object array
List of stops along the route
  actualArrivalTime
  string
Actual arrival time, if it exists, for the route stop in RFC 3339 format.
  actualDepartureTime
  string
Actual departure time, if it exists, for the route stop in RFC 3339 format.
  actualDistanceMeters
  integer
Actual GPS-measured distance traveled from the previous stop's departure to this stop's arrival, in meters. Null for the first stop, skipped stops, or if GPS data is unavailable.
  address
  object
A minified Address object
   externalIds
   object
A map of external ids
   id
   string
Id of the address
   name
   string
Name of the address
  appointmentWindows
  object array
Appointment windows for the stop.
   endTime
   string
The end time of the appointment window for the stop in RFC 3339 format.
   startTime
   string
The start time of the appointment window for the stop in RFC 3339 format.
  documents
  object array
List of documents associated with the stop.
   id
   string
Id of the document
   name
   string
Name of the document
  enRouteTime
  string
The time the stop became en-route, in RFC 3339 format.
  eta
  string
Estimated time of arrival, if this stop is currently en-route, in RFC 3339 format.
  externalIds
  object
A map of external ids
  forms
  object array
List of forms associated with the stop.
   id
   string
The unique identifier of the resource.
  id
  string
Id of the stop
  issues
  object array
List of issues associated with the stop.
   id
   string
ID of the issue
  liveSharingUrl
  string
The shareable url of the stop's current status.
  locationLiveSharingLinks
  object array
List of shareable, non-expired 'By Location' Live Sharing Links.
   expiresAtTime
   string
Date that this link expires, in RFC 3339 format.
   liveSharingUrl
   string
The shareable URL of the vehicle's location.
   name
   string
Name of the Live Sharing Link.
  name
  string
Name of the stop
  notes
  string
Notes for the stop
  ontimeWindowAfterArrivalMs
  integer
Specifies the time window (in milliseconds) after a stop's scheduled arrival time during which the stop is considered 'on-time'.
  ontimeWindowBeforeArrivalMs
  integer
Specifies the time window (in milliseconds) before a stop's scheduled arrival time during which the stop is considered 'on-time'.
  plannedDistanceMeters
  integer
Planned driving distance from the previous stop in meters. Based on routing calculations at route creation time. Null for the first stop or if routing data is unavailable.
  scheduledArrivalTime
  string
Scheduled arrival time, if it exists, for the stop in RFC 3339 format.
  scheduledDepartureTime
  string
Scheduled departure time, if it exists, for the stop in RFC 3339 format.
  sequenceNumber
  integer
Manual sequence position of this stop. Only used when route.settings.sequencingMethod=manual.
  singleUseLocation
  object
This field is used to indicate stops along the route for which an address has not been persisted. This field is mutually exclusive with addressId.
   address
   string
Address of the stop.
   latitude
   number
The latitude of the location
   longitude
   number
The longitude of the location
   radiusMeters
   number
The radius in meters for the geofence around this location. Must be a positive value.
  skippedTime
  string
Skipped time, if it exists, for the route stop in RFC 3339 format.
  state
  string
The current state of the route stop. Valid values: unassigned, scheduled, en route, skipped, arrived, departed.
routeStopDetails
object
A route stop with order references.
 actualArrivalTime
 string
Actual arrival time, if it exists, for the route stop in RFC 3339 format.
 actualDepartureTime
 string
Actual departure time, if it exists, for the route stop in RFC 3339 format.
 enRouteTime
 string
The time the stop became en-route, in RFC 3339 format.
 eta
 string
Estimated time of arrival, if this stop is currently en-route, in RFC 3339 format.
 externalIds
 object
A map of external ids
 id
 string
Unique identifier for the route stop.
 liveSharingUrl
 string
The shareable url of the stop's current status.
 orders
 object array
Orders associated with the route stop.
  id
  string
The Samsara-generated UUID for the order.
 skippedTime
 string
Skipped time, if it exists, for the route stop in RFC 3339 format.
 state
 string
The current state of the route stop. Valid values: unassigned, scheduled, en route, skipped, arrived, departed.
time
string
The timestamp of the route in RFC 3339 format.
type
string
The type of route update. The route tracking updates occur as a route is completed and stops transition from one state to another. Currently only Route Tracking updates are supported, but this will change in the future when additional types are added. Valid values: route tracking.
vehicle
object
A minified vehicle object. This object is always returned, regardless of route assignment.
 assetType
 string
The type of the asset. Valid values: uncategorized, trailer, equipment, unpowered, vehicle.
 externalIds
 object
A map of external ids
 gateway
 object
A minified gateway object
  model
  string
The model of the gateway installed on the asset. Valid values: AG15, AG24, AG24EU, AG26, AG26EU, AG41, AG41EU, AG45, AG45EU, AG46, AG46EU, AG46P, AG46PEU, AG51, AG51EU, AG52, AG52EU, AG53, AG53EU, AT11, AT11X, AT12, AT12X, AT13, IG15, IG21, IG41, IG61, SG1, SG1B, SG1G, SG1G32, SG1x, VG32, VG33, VG34, VG34EU, VG34FN, VG34M, VG54ATT, VG54EU, VG54FN, VG54NA, VG54NAE, VG54NAH, VG55EU, VG55FN, VG55NA.
  serial
  string
The serial number of the gateway installed on the asset.
 id
 string
ID of the vehicle
 licensePlate
 string
The license plate of the vehicle.
 name
 string
Name of the vehicle
 vin
 string
The VIN of the vehicle.

Did this page help you?