Creates a short-lived auth token a driver can use to login.
Rate limit: 100 requests/min (learn more about rate limits here).
To use this endpoint, select Write Driver Auth Token under the Drivers 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 POST \
--url https://api.samsara.com/fleet/drivers/auth-token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "dp[gZc1wAigz4uGa0Hh",
"driverId": 1234,
"externalId": "payrollId:ABFS18600",
"username": "johndoe"
}
'{
"data": {
"expirationTime": 1710000000000,
"token": "ZmFrZVRva2VuXzMyQnl0ZXNMb25nRm9yVGVzdA"
}
}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.
Request body for creating a driver auth token. One of id, externalId, or username is required.
Required. Random 12+ character string, used with the auth token to help secure the client from intercepted tokens.
12"dp[gZc1wAigz4uGa0Hh"
Optional. Samsara ID of the driver. One of id, externalId, or username is required.
1234
Optional. External ID of the driver, in the format key:value (e.g., payrollId:ABFS18600). One of id, externalId, or username is required.
"payrollId:ABFS18600"
Optional. Username of the driver. This is the login identifier configured when the driver is created. One of id, externalId, or username is required.
"johndoe"
OK response.
Response object for create driver auth token
Show child attributes
curl --request POST \
--url https://api.samsara.com/fleet/drivers/auth-token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "dp[gZc1wAigz4uGa0Hh",
"driverId": 1234,
"externalId": "payrollId:ABFS18600",
"username": "johndoe"
}
'{
"data": {
"expirationTime": 1710000000000,
"token": "ZmFrZVRva2VuXzMyQnl0ZXNMb25nRm9yVGVzdA"
}
}