This endpoint is still on our legacy API.
Set an individual driver’s current duty status to ‘On Duty’ or ‘Off Duty’.
To ensure compliance with the ELD Mandate, only authenticated drivers can make direct duty status changes on their own logbook. Any system external to the Samsara Driver App using this endpoint to trigger duty status changes must ensure that such changes are only triggered directly by the driver in question and that the driver has been properly authenticated. This endpoint should not be used to algorithmically trigger duty status changes nor should it be used by personnel besides the driver to trigger duty status changes on the driver’s behalf. Carriers and their drivers are ultimately responsible for maintaining accurate logs and should confirm that their use of the endpoint is compliant with the ELD Mandate.
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.
To use this endpoint, select Write ELD Hours of Service (US) under the Compliance category when creating or editing an API token. Learn More.
curl --request POST \
--url https://api.samsara.com/v1/fleet/drivers/{driver_id}/hos/duty_status \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"duty_status": "ON_DUTY",
"location": "Loading dock",
"remark": "Beginning On Duty Shift",
"status_change_at_ms": 1580834793568,
"vehicle_id": 1234
}
'This response has no body data.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.
ID of the driver for whom the duty status is being set.
Duty status to set the driver to. The only supported values are 'ON_DUTY' and 'OFF_DUTY'.
"ON_DUTY"
Location to associate the duty status change with.
"Loading dock"
Remark to associate the duty status change with.
"Beginning On Duty Shift"
Timestamp that the duty status will begin at specified in milliseconds UNIX time. Defaults to the current time if left blank. This can only be set to up to 8 hours in the past.
1580834793568
Vehicle ID to associate the duty status change with.
1234
curl --request POST \
--url https://api.samsara.com/v1/fleet/drivers/{driver_id}/hos/duty_status \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"duty_status": "ON_DUTY",
"location": "Loading dock",
"remark": "Beginning On Duty Shift",
"status_change_at_ms": 1580834793568,
"vehicle_id": 1234
}
'This response has no body data.