Coaching

Get coaching sessions.

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.

<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 Coaching under the Coaching 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.

get/coaching/sessions/stream

Request

  • Base URL
    https://api.samsara.com
  • Auth
    HTTP bearer

Query parameters

driverIdsstring[]

Optional string of comma separated driver IDs. If driver ID is present, sessions for the specified driver(s) will be returned.

coachIdsstring[]

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.

sessionStatusesstring[]

Optional string of comma separated statuses. Valid values: “upcoming”, “completed”, “deleted”.

includeCoachableEventsboolean

Optional boolean to control whether behaviors will include coachableEvents in the response. Defaults to false.

startTimestring date-time required

Required RFC 3339 timestamp that indicates when to begin receiving data. Value is compared against updatedAtTime

endTimestring date-time

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

afterstring

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.

includeExternalIdsboolean

Optional boolean indicating whether to return external IDs on supported entities

Response

OK response.

Example response

{
  "data": [
    {
      "assignedCoachId": "45646",
      "behaviors": [
        {
          "coachableBehaviorType": "forwardCollisionWarning",
          "coachableEvents": [
            {
              "id": "f5271458-21f9-4a9f-a290-780c6d8840ff",
              "linkage": {
                "sourceId": "f5271458-21f9-4a9f-a290-780c6d8840ff",
                "sourceType": "safetyEvent"
              }
            }
          ],
          "id": "f5271458-21f9-4a9f-a290-780c6d8840ff",
          "lastCoachedTime": "2019-06-13T19:08:25Z",
          "note": "Need to wear seatbelt even for short trips.",
          "updatedAtTime": "2019-06-13T19:08:25Z"
        }
      ],
      "coachingType": "unshared",
      "completedAtTime": "2019-06-13T19:08:25Z",
      "completedCoachId": "45646",
      "driver": {
        "driverId": "0987"
      },
      "dueAtTime": "2019-06-13T19:08:25Z",
      "id": "f5271458-21f9-4a9f-a290-780c6d8840ff",
      "sessionNote": "Need to wear seatbelt even for short trips.",
      "sessionStatus": "completed",
      "updatedAtTime": "2019-06-13T19:08:25Z"
    }
  ],
  "pagination": {
    "endCursor": "MjkY",
    "hasNextPage": true
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.