This endpoint will return coaching sessions for your organization based on the time parameters passed in. Results are paginated by sessions. If you include an endTime, the endpoint will return data up until that point. If you don’t include an endTime, you can continue to poll the API real-time with the pagination cursor that gets returned on every call.
Rate limit: 5 requests/sec (learn more about rate limits here).
To use this endpoint, select Read Coaching under the Coaching 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/coaching/sessions/stream \
--header 'Authorization: Bearer <token>'{
"data": [
{
"behaviors": [
{
"coachableBehaviorType": "forwardCollisionWarning",
"id": "f5271458-21f9-4a9f-a290-780c6d8840ff",
"lastCoachedTime": "2019-06-13T19:08:25Z",
"updatedAtTime": "2019-06-13T19:08:25Z",
"coachableEvents": [
{
"id": "f5271458-21f9-4a9f-a290-780c6d8840ff"
}
],
"note": "Need to wear seatbelt even for short trips."
}
],
"coachingType": "unshared",
"driver": {
"driverId": "0987",
"externalIds": {}
},
"dueAtTime": "2019-06-13T19:08:25Z",
"id": "f5271458-21f9-4a9f-a290-780c6d8840ff",
"sessionStatus": "completed",
"updatedAtTime": "2019-06-13T19:08:25Z",
"assignedCoachId": "45646",
"completedAtTime": "2019-06-13T19:08:25Z",
"completedCoachId": "45646",
"sessionNote": "Need to wear seatbelt even for short trips."
}
],
"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.
Optional string of comma separated driver IDs. If driver ID is present, sessions for the specified driver(s) will be returned.
Optional string of comma separated user IDs. If coach ID is present, sessions for the specified coach(s) will be returned for either assignedCoach or completedCoach. If both driverId(s) and coachId(s) are present, sessions with specified driver(s) and coach(es) will be returned.
Optional string of comma separated statuses. Valid values: “upcoming”, “completed”, “deleted”.
Optional boolean to control whether behaviors will include coachableEvents in the response. Defaults to false.
Required RFC 3339 timestamp that indicates when to begin receiving data. Value is compared against updatedAtTime
Optional RFC 3339 timestamp. If not provided then the endpoint behaves as an unending feed of changes. If endTime is set the same as startTime, the most recent data point before that time will be returned per asset. Value is compared against updatedAtTime
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.
Optional boolean indicating whether to return external IDs on supported entities
curl --request GET \
--url https://api.samsara.com/coaching/sessions/stream \
--header 'Authorization: Bearer <token>'{
"data": [
{
"behaviors": [
{
"coachableBehaviorType": "forwardCollisionWarning",
"id": "f5271458-21f9-4a9f-a290-780c6d8840ff",
"lastCoachedTime": "2019-06-13T19:08:25Z",
"updatedAtTime": "2019-06-13T19:08:25Z",
"coachableEvents": [
{
"id": "f5271458-21f9-4a9f-a290-780c6d8840ff"
}
],
"note": "Need to wear seatbelt even for short trips."
}
],
"coachingType": "unshared",
"driver": {
"driverId": "0987",
"externalIds": {}
},
"dueAtTime": "2019-06-13T19:08:25Z",
"id": "f5271458-21f9-4a9f-a290-780c6d8840ff",
"sessionStatus": "completed",
"updatedAtTime": "2019-06-13T19:08:25Z",
"assignedCoachId": "45646",
"completedAtTime": "2019-06-13T19:08:25Z",
"completedCoachId": "45646",
"sessionNote": "Need to wear seatbelt even for short trips."
}
],
"pagination": {
"endCursor": "MjkY",
"hasNextPage": true
}
}