Get all driver-vehicle assignments for the requested drivers or vehicles in the requested time range. To fetch driver-vehicle assignments out of the vehicle trips’ time ranges, assignmentType needs to be specified. Note: this endpoint replaces past endpoints to fetch assignments by driver or by vehicle. Visit this migration guide for more information.
Rate limit: 5 requests/sec (learn more about rate limits here).
To use this endpoint, select Read Assignments under the Assignments 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.
curl --request GET \
--url https://api.samsara.com/fleet/driver-vehicle-assignments \
--header 'Authorization: Bearer <token>'{
"data": [
{
"driver": {
"id": "45646",
"externalIds": {},
"name": "Driver Bob"
},
"isPassenger": true,
"startTime": "2019-06-13T19:08:25Z",
"vehicle": {
"externalIds": {},
"id": "494123",
"name": "Fleet Truck #1"
},
"assignedAtTime": "2019-06-13T19:08:25Z",
"assignmentType": "idCard",
"endTime": "2019-06-13T19:08:25Z",
"metadata": {
"sourceName": "ExternalSourceName"
}
}
],
"pagination": {
"endCursor": "MjkY",
"hasNextPage": true
}
}Documentation Index
Fetch the complete documentation index at: https://samsara-showcase.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Option to filter by drivers or vehicles. Valid values: drivers, vehicles
drivers, vehicles A start time in RFC 3339 format. Defaults to now if not provided. 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).
An end time in RFC 3339 format. Defaults to now if not provided. 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).
A filter on the data based on this comma-separated list of driver IDs and externalIds. Example: driverIds=1234,5678,payroll:4841
ID of the vehicle. 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, "maintenanceId:250020".
A filter on the data based on this comma-separated list of driver tag IDs. Example: tagIds=1234,5678
A filter on the data based on this comma-separated list of vehicle tag IDs. Example: tagIds=1234,5678
If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results.
Specifies which assignment type to filter by. Valid values: HOS, idCard, static, faceId, tachograph, safetyManual, RFID, trailer, external, qrCode, driverApp, voiceSignIn, smartAssign
HOS, idCard, static, faceId, tachograph, safetyManual, RFID, trailer, external, qrCode, driverApp, voiceSignIn, smartAssign curl --request GET \
--url https://api.samsara.com/fleet/driver-vehicle-assignments \
--header 'Authorization: Bearer <token>'{
"data": [
{
"driver": {
"id": "45646",
"externalIds": {},
"name": "Driver Bob"
},
"isPassenger": true,
"startTime": "2019-06-13T19:08:25Z",
"vehicle": {
"externalIds": {},
"id": "494123",
"name": "Fleet Truck #1"
},
"assignedAtTime": "2019-06-13T19:08:25Z",
"assignmentType": "idCard",
"endTime": "2019-06-13T19:08:25Z",
"metadata": {
"sourceName": "ExternalSourceName"
}
}
],
"pagination": {
"endCursor": "MjkY",
"hasNextPage": true
}
}