Samsara Training API
The Training API from Samsara — 1 operation(s) for training.
The Training API from Samsara — 1 operation(s) for training.
openapi: 3.0.1
info:
description: Gain greater visibility by connecting your fleets, equipment, sites, and people.
title: Samsara Training API
version: '2024-11-18'
servers:
- url: https://api.samsara.com/
- url: https://api.eu.samsara.com/
security:
- AccessTokenHeader: []
tags:
- name: Training
paths:
/preview/training-assignments:
delete:
description: "This endpoint supports batch deletion operations. The response does not indicate which specific deletions, if any, have failed. On a successful deletion or partial failure, a 204 No Content status is returned.\n\n <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href=\"https://developers.samsara.com/docs/rate-limits\" target=\"_blank\">here</a>).\n\nTo use this endpoint, select **Write Training Assignments** under the Closed Beta 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>\n\nEndpoints in this section are in Preview. These APIs are not functional and are instead for soliciting feedback from our API users on the intended design of this API. Additionally, it is not guaranteed that we will be releasing an endpoint included in this section to production. This means that developers should **NOT** rely on these APIs to build business critical applications\n\n- Samsara may change the structure of a preview API's interface without versioning or any notice to API users.\n\n- When an endpoint becomes generally available, it will be announced in the API [changelog](https://developers.samsara.com/changelog).\n \n\n **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."
operationId: deleteTrainingAssignments
parameters:
- description: 'String of comma separated assignments IDs. Max value for this value is 100 objects .Example: `ids=a4db8702-79d5-4396-a717-e301d52ecc11,c6490f6a-d84e-49b5-b0ad-b6baae304075`'
explode: false
in: query
name: ids
required: true
schema:
items:
type: string
type: array
style: form
responses:
'204':
content: {}
description: No Content response.
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsDeleteTrainingAssignmentsUnauthorizedErrorResponseBody'
description: Unauthorized response.
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsDeleteTrainingAssignmentsNotFoundErrorResponseBody'
description: Not Found response.
'405':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsDeleteTrainingAssignmentsMethodNotAllowedErrorResponseBody'
description: Method Not Allowed response.
'429':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsDeleteTrainingAssignmentsTooManyRequestsErrorResponseBody'
description: Too Many Requests response.
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsDeleteTrainingAssignmentsInternalServerErrorResponseBody'
description: Internal Server Error response.
'501':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsDeleteTrainingAssignmentsNotImplementedErrorResponseBody'
description: Not Implemented response.
'502':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsDeleteTrainingAssignmentsBadGatewayErrorResponseBody'
description: Bad Gateway response.
'503':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsDeleteTrainingAssignmentsServiceUnavailableErrorResponseBody'
description: Service Unavailable response.
'504':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsDeleteTrainingAssignmentsGatewayTimeoutErrorResponseBody'
description: Gateway Timeout response.
default:
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsDeleteTrainingAssignmentsBadRequestErrorResponseBody'
description: Bad Request response.
summary: '[preview] Delete Training Assignments.'
tags:
- Training
patch:
description: "**Preview:** This endpoint is in preview and is likely to change before being broadly available. Reach out to your Samsara Representative to have Training APIs enabled for your organization.\n\n <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href=\"https://developers.samsara.com/docs/rate-limits\" target=\"_blank\">here</a>).\n\nTo use this endpoint, select **Write Preview** under the 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>\n\nEndpoints in this section are in Preview. These APIs are not functional and are instead for soliciting feedback from our API users on the intended design of this API. Additionally, it is not guaranteed that we will be releasing an endpoint included in this section to production. This means that developers should **NOT** rely on these APIs to build business critical applications\n\n- Samsara may change the structure of a preview API's interface without versioning or any notice to API users.\n\n- When an endpoint becomes generally available, it will be announced in the API [changelog](https://developers.samsara.com/changelog).\n \n\n **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."
operationId: patchTrainingAssignments
parameters:
- description: 'String of comma separated assignments IDs. Max value for this value is 100 objects .Example: `ids=a4db8702-79d5-4396-a717-e301d52ecc11,c6490f6a-d84e-49b5-b0ad-b6baae304075`'
explode: false
in: query
name: ids
required: true
schema:
items:
type: string
type: array
style: form
- description: Due date of the training assignment in RFC 3339 format. Millisecond precision and timezones are supported.
in: query
name: dueAtTime
required: true
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsPatchTrainingAssignmentsResponseBody'
description: OK response.
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsPatchTrainingAssignmentsUnauthorizedErrorResponseBody'
description: Unauthorized response.
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsPatchTrainingAssignmentsNotFoundErrorResponseBody'
description: Not Found response.
'405':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsPatchTrainingAssignmentsMethodNotAllowedErrorResponseBody'
description: Method Not Allowed response.
'429':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsPatchTrainingAssignmentsTooManyRequestsErrorResponseBody'
description: Too Many Requests response.
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsPatchTrainingAssignmentsInternalServerErrorResponseBody'
description: Internal Server Error response.
'501':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsPatchTrainingAssignmentsNotImplementedErrorResponseBody'
description: Not Implemented response.
'502':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsPatchTrainingAssignmentsBadGatewayErrorResponseBody'
description: Bad Gateway response.
'503':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsPatchTrainingAssignmentsServiceUnavailableErrorResponseBody'
description: Service Unavailable response.
'504':
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsPatchTrainingAssignmentsGatewayTimeoutErrorResponseBody'
description: Gateway Timeout response.
default:
content:
application/json:
schema:
$ref: '#/components/schemas/TrainingAssignmentsPatchTrainingAssignmentsBadRequestErrorResponseBody'
description: Bad Request response.
summary: '[preview] Update Training Assignments.'
tags:
- Training
components:
schemas:
TrainingAssignmentsDeleteTrainingAssignmentsBadRequestErrorResponseBody:
description: Bad Request parameters
properties:
message:
description: Message of error
example: Invalid value for parameter.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingAssignmentsDeleteTrainingAssignmentsBadGatewayErrorResponseBody:
description: Bad Gateway
properties:
message:
description: Message of error
example: 'rpc error: code = Unknown desc = connection refused'
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingAssignmentsDeleteTrainingAssignmentsNotFoundErrorResponseBody:
description: Resource not found
properties:
message:
description: Message of error
example: Object not found.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingAssignmentsPatchTrainingAssignmentsResponseBody:
properties:
data:
description: List of updated training assignments.
items:
$ref: '#/components/schemas/TrainingAssignmentResponseObjectResponseBody'
type: array
required:
- data
type: object
TrainingAssignmentsDeleteTrainingAssignmentsUnauthorizedErrorResponseBody:
description: Unauthorized
properties:
message:
description: Message of error
example: Invalid token.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingAssignmentsDeleteTrainingAssignmentsTooManyRequestsErrorResponseBody:
description: Too many requests
properties:
message:
description: Message of error
example: Exceeded rate limit.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingAssignmentsDeleteTrainingAssignmentsInternalServerErrorResponseBody:
description: An internal server error occurred
properties:
message:
description: Message of error
example: Failed to execute GraphQL query.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingAssignmentsDeleteTrainingAssignmentsServiceUnavailableErrorResponseBody:
description: Service unavailable
properties:
message:
description: Message of error
example: context deadline exceeded
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingCourseObjectResponseBody:
description: Course that is associated with the training assignments.
properties:
id:
description: ID of the course.
example: 9814a1fa-f0c6-408b-bf85-51dc3bc71ac7
format: uuid
type: string
revisionId:
description: ID of the course's specific version.
example: 1214a1fa-f0c6-408b-bf85-51dc3bc71ac7
format: uuid
type: string
required:
- id
- revisionId
type: object
TrainingAssignmentsPatchTrainingAssignmentsInternalServerErrorResponseBody:
description: An internal server error occurred
properties:
message:
description: Message of error
example: Failed to execute GraphQL query.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingAssignmentsPatchTrainingAssignmentsGatewayTimeoutErrorResponseBody:
description: Gateway timeout
properties:
message:
description: Message of error
example: context deadline exceeded
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingAssignmentsPatchTrainingAssignmentsUnauthorizedErrorResponseBody:
description: Unauthorized
properties:
message:
description: Message of error
example: Invalid token.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingAssignmentsPatchTrainingAssignmentsNotFoundErrorResponseBody:
description: Resource not found
properties:
message:
description: Message of error
example: Object not found.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingAssignmentsPatchTrainingAssignmentsServiceUnavailableErrorResponseBody:
description: Service unavailable
properties:
message:
description: Message of error
example: context deadline exceeded
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingAssignmentsDeleteTrainingAssignmentsGatewayTimeoutErrorResponseBody:
description: Gateway timeout
properties:
message:
description: Message of error
example: context deadline exceeded
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingAssignmentsPatchTrainingAssignmentsBadRequestErrorResponseBody:
description: Bad Request parameters
properties:
message:
description: Message of error
example: Invalid value for parameter.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingAssignmentsDeleteTrainingAssignmentsMethodNotAllowedErrorResponseBody:
description: Method not allowed
properties:
message:
description: Message of error
example: DELETE not allowed on /endpoint.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingAssignmentResponseObjectResponseBody:
description: Training Assignment response object.
properties:
completedAtTime:
description: Time training assignment is completed. UTC timestamp in RFC 3339 format. Returned when a training assignment completion status is "complete".
example: '2019-06-13T19:08:25Z'
format: date-time
type: string
course:
$ref: '#/components/schemas/TrainingCourseObjectResponseBody'
createdAtTime:
description: Creation time of the training assignment. UTC timestamp in RFC 3339 format.
example: '2019-06-13T19:08:25Z'
format: date-time
type: string
createdById:
description: ID of the user who created the training assignment.
example: user-4392
type: string
deletedAtTime:
description: Time training assignment is deleted. UTC timestamp in RFC 3339 format.
example: '2019-06-13T19:08:25Z'
format: date-time
type: string
dueAtTime:
description: Time training assignment is due. UTC timestamp in RFC 3339 format. Returned when an assignment has a due date set by an admin.
example: '2019-06-13T19:08:25Z'
format: date-time
type: string
durationMinutes:
description: Time spent on the training assignment.
example: 2750596961262481000
format: int64
type: integer
id:
description: ID of the training assignment.
example: 9814a1fa-f0c6-408b-bf85-51dc3bc71ac7
type: string
isCompletedLate:
description: Indicates whether the training assignment was completed on time or not. Returned when a training assignment completion status is "complete" and has a dueAtTime set by an admin.
example: true
type: boolean
isOverdue:
description: Indicates whether the training assignment is past the due date. Returned when a training assignment completion status is 'inProgress' or 'notStarted' and has a dueAtTime set by an admin.
example: true
type: boolean
learner:
$ref: '#/components/schemas/TrainingLearnerObjectResponseBody'
scorePercent:
description: Quiz score associated with training assignment. Returned when a training assignment completion status is "complete".
example: 0.5695960957385368
format: double
type: number
startedAtTime:
description: Time training assignment is started. UTC timestamp in RFC 3339 format. Returned when a training assignment completion status is "complete" or "inProgress".
example: '2019-06-13T19:08:25Z'
format: date-time
type: string
status:
description: 'State for the Training Assignment. Always returned. Valid values: `notStarted`, `inProgress`, `completed`'
enum:
- notStarted
- inProgress
- completed
example: inProgress
type: string
updatedAtTime:
description: Time training assignment was updated by either a learner or an admin. UTC timestamp in RFC 3339 format.
example: '2019-06-13T19:08:25Z'
format: date-time
type: string
updatedById:
description: ID of the user who updated the training assignment, either an admin or a learner.
example: user-3112
type: string
required:
- course
- createdAtTime
- createdById
- durationMinutes
- id
- learner
- status
- updatedAtTime
- updatedById
type: object
TrainingAssignmentsPatchTrainingAssignmentsTooManyRequestsErrorResponseBody:
description: Too many requests
properties:
message:
description: Message of error
example: Exceeded rate limit.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingAssignmentsPatchTrainingAssignmentsNotImplementedErrorResponseBody:
description: Requested endpoint is not yet implemented
properties:
message:
description: Message of error
example: Not implemented.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingLearnerObjectResponseBody:
description: Learner that is associated with the training assignment. Only driver learners are supported currently.
properties:
id:
description: ID of the polymorphic user.
example: '938172'
type: string
type:
description: 'The type of the polymorphic user. Valid values: `driver`'
enum:
- driver
example: driver
type: string
required:
- id
- type
type: object
TrainingAssignmentsPatchTrainingAssignmentsMethodNotAllowedErrorResponseBody:
description: Method not allowed
properties:
message:
description: Message of error
example: DELETE not allowed on /endpoint.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingAssignmentsDeleteTrainingAssignmentsNotImplementedErrorResponseBody:
description: Requested endpoint is not yet implemented
properties:
message:
description: Message of error
example: Not implemented.
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
TrainingAssignmentsPatchTrainingAssignmentsBadGatewayErrorResponseBody:
description: Bad Gateway
properties:
message:
description: Message of error
example: 'rpc error: code = Unknown desc = connection refused'
type: string
requestId:
description: The request ID; used when reaching out to support for issues with requests.
example: 8916e1c1
type: string
required:
- message
- requestId
type: object
securitySchemes:
AccessTokenHeader:
type: http
scheme: bearer
x-original-swagger-version: '2.0'
x-readme:
explorer-enabled: true
proxy-enabled: true