Get all driver-vehicle assignments
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.
<b>Rate limit:</b> 5 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
To use this endpoint, select Read Assignments under the Assignments category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>
Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.
Request
- Base URLhttps://api.samsara.com
- AuthHTTP bearer
Query parameters
Option to filter by drivers or vehicles. Valid values: 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".
Filters assignments by the exact metadata source name supplied when the assignment was created. Requires filterBy=drivers. When set, driver and vehicle ID, tag, and assignment type filters are not supported. startTime and endTime are optional here: if omitted, matching assignments are returned regardless of when they occurred, rather than being limited to the recent window used by the other filters.
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
Response
OK response.
Example response
{
"data": [
{
"assignedAtTime": "2019-06-13T19:08:25Z",
"assignmentType": "idCard",
"driver": {
"id": "45646",
"name": "Driver Bob"
},
"endTime": "2019-06-13T19:08:25Z",
"isPassenger": true,
"metadata": {
"sourceName": "ExternalSourceName"
},
"startTime": "2019-06-13T19:08:25Z",
"vehicle": {
"id": "494123",
"name": "Fleet Truck #1"
}
}
],
"pagination": {
"endCursor": "MjkY",
"hasNextPage": true
}
}Changes
No recorded changes to this operation across all 1 revision of this API.