Samsara Incidents API
The Incidents API from Samsara — 1 operation(s) for incidents.
The Incidents API from Samsara — 1 operation(s) for incidents.
openapi: 3.0.1
info:
description: Gain greater visibility by connecting your fleets, equipment, sites, and people.
title: Samsara Incidents API
version: '2024-11-18'
servers:
- url: https://api.samsara.com/
- url: https://api.eu.samsara.com/
security:
- AccessTokenHeader: []
tags:
- name: Incidents
paths:
/alerts/incidents/stream:
get:
description: "Get Alert Incidents for specific Alert Configurations over a specified period of time.\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 **Read Alerts** under the Alerts 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 \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: getIncidents
parameters:
- description: Required RFC 3339 timestamp that indicates when to begin receiving data. This will be based on updatedAtTime.
in: query
name: startTime
required: true
schema:
type: string
- description: Required array of alert configuration ids to return incident data for.
explode: true
in: query
name: configurationIds
required: true
schema:
items:
type: string
maxItems: 50
minItems: 1
type: array
style: form
- description: Optional RFC 3339 timestamp to stop receiving data. Defaults to now if not provided. This will be based on updatedAtTime.
in: query
name: endTime
schema:
type: string
- description: ' 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.'
in: query
name: after
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/AlertsGetIncidentsResponseBody'
description: OK response.
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/AlertsGetIncidentsUnauthorizedErrorResponseBody'
description: Unauthorized response.
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/AlertsGetIncidentsNotFoundErrorResponseBody'
description: Not Found response.
'405':
content:
application/json:
schema:
$ref: '#/components/schemas/AlertsGetIncidentsMethodNotAllowedErrorResponseBody'
description: Method Not Allowed response.
'429':
content:
application/json:
schema:
$ref: '#/components/schemas/AlertsGetIncidentsTooManyRequestsErrorResponseBody'
description: Too Many Requests response.
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/AlertsGetIncidentsInternalServerErrorResponseBody'
description: Internal Server Error response.
'501':
content:
application/json:
schema:
$ref: '#/components/schemas/AlertsGetIncidentsNotImplementedErrorResponseBody'
description: Not Implemented response.
'502':
content:
application/json:
schema:
$ref: '#/components/schemas/AlertsGetIncidentsBadGatewayErrorResponseBody'
description: Bad Gateway response.
'503':
content:
application/json:
schema:
$ref: '#/components/schemas/AlertsGetIncidentsServiceUnavailableErrorResponseBody'
description: Service Unavailable response.
'504':
content:
application/json:
schema:
$ref: '#/components/schemas/AlertsGetIncidentsGatewayTimeoutErrorResponseBody'
description: Gateway Timeout response.
default:
content:
application/json:
schema:
$ref: '#/components/schemas/AlertsGetIncidentsBadRequestErrorResponseBody'
description: Bad Request response.
summary: Get Alert Incidents.
tags:
- Incidents
components:
schemas:
FormsPersonValueObjectResponseBody:
description: The value of a person form input field.
properties:
person:
$ref: '#/components/schemas/FormsPersonObjectResponseBody'
required:
- person
type: object
RouteStopDetailsObjectResponseBody:
properties:
driver:
$ref: '#/components/schemas/GoaDriverTinyResponseResponseBody'
operation:
description: 'The operation that was performed as part of this route update. Valid values: `stop arrived`, `stop departed`'
enum:
- stop arrived
- stop departed
example: stop arrived
type: string
route:
$ref: '#/components/schemas/WebhookRouteResponseObjectResponseBody'
routeStopDetails:
$ref: '#/components/schemas/MinimalRouteStopResponseBody'
time:
description: The timestamp of the route in RFC 3339 format.
example: '2020-01-27T07:06:25Z'
format: date-time
type: string
type:
description: 'The type of route update. The route tracking updates occur as a route is completed and stops transition from one state to another. Currently only Route Tracking updates are supported, but this will change in the future when additional types are added. Valid values: `route tracking`'
enum:
- route tracking
example: route tracking
type: string
vehicle:
$ref: '#/components/schemas/VehicleWithGatewayTinyResponseResponseBody'
required:
- route
- routeStopDetails
- time
- type
type: object
AlertsGetIncidentsResponseBody:
properties:
data:
description: List of workflow incidents.
items:
$ref: '#/components/schemas/GetWorkflowIncidentResponseObjectResponseBody'
type: array
pagination:
$ref: '#/components/schemas/GoaPaginationResponseResponseBody'
required:
- data
- pagination
type: object
WorkflowAddressEventWithGeofenceObjectResponseBody:
description: A minimal Address object representation used in AddressEventObject objects
properties:
externalIds:
additionalProperties:
type: string
description: A map of external ids
type: object
formattedAddress:
description: The full street address for this address/geofence, as it might be recognized by Google Maps.
example: 350 Rhode Island St, San Francisco, CA
type: string
geofence:
$ref: '#/components/schemas/WorkflowGeofenceResponseBody'
id:
description: Id of the address
example: '494123'
type: string
name:
description: Name of the address
example: 'Company Office #1'
type: string
required:
- formattedAddress
- id
- name
type: object
DriverDocumentSubmittedResponseBody:
description: Details specific to Driver Document Submitted.
properties:
document:
$ref: '#/components/schemas/documentResponseObjectResponseBody'
type: object
VehicleWithGatewayTinyResponseResponseBody:
description: ' A minified vehicle object. This object is only returned if the route is assigned to the vehicle.'
properties:
assetType:
description: 'The type of the asset. Valid values: `uncategorized`, `trailer`, `equipment`, `unpowered`, `vehicle`'
enum:
- uncategorized
- trailer
- equipment
- unpowered
- vehicle
example: vehicle
type: string
externalIds:
additionalProperties:
type: string
description: A map of external ids
type: object
gateway:
$ref: '#/components/schemas/GoaGatewayTinyResponseResponseBody'
id:
description: ID of the vehicle
example: '494123'
type: string
licensePlate:
description: The license plate of the vehicle.
example: 6SAM123
type: string
name:
description: Name of the vehicle
example: 'Fleet Truck #1'
type: string
vin:
description: The VIN of the vehicle.
example: 1GBJ6P1B2HV112765
type: string
type: object
FormsMediaRecordObjectResponseBody:
description: Forms media record object.
properties:
id:
description: ID of the media record.
example: 9814a1fa-f0c6-408b-bf85-51dc3bc71ac7
format: uuid
type: string
processingStatus:
description: 'Status of the media record. Valid values: `unknown`, `processing`, `finished`'
enum:
- unknown
- processing
- finished
example: processing
type: string
url:
description: URL containing a link to associated media content. Included if 'processingStatus' is 'finished'.
example: https://samsara-forms-submission-media-uploads.s3.us-west-2.amazonaws.com/123456
format: uri
type: string
urlExpiresAt:
description: Expiration time of the media record 'url'. UTC timestamp in RFC 3339 format.
example: '2019-06-13T19:08:25Z'
format: date-time
type: string
required:
- id
- processingStatus
type: object
DriverRecordedResponseBody:
description: Details specific to Driver Recorded.
properties:
driver:
$ref: '#/components/schemas/alertObjectDriverResponseBody'
vehicle:
$ref: '#/components/schemas/alertObjectVehicleResponseBody'
type: object
scannedDocumentValueObjectResponseBody:
properties:
id:
description: Id of the scanned document.
example: f5271458-21f9-4a9f-a290-780c6d8840ff
type: string
url:
description: Url of the scanned document.
example: https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456
type: string
type: object
PanicButtonResponseBody:
description: Details specific to Panic Button.
properties:
driver:
$ref: '#/components/schemas/alertObjectDriverResponseBody'
trailer:
$ref: '#/components/schemas/alertObjectTrailerResponseBody'
vehicle:
$ref: '#/components/schemas/alertObjectVehicleResponseBody'
type: object
IssueCreatedResponseBody:
description: Details specific to Issue Created.
properties:
issue:
$ref: '#/components/schemas/IssueResponseObjectResponseBody'
required:
- issue
type: object
DataInputValueResponseBody:
description: Details specific to Data Input Value.
properties:
machineInput:
$ref: '#/components/schemas/alertObjectMachineInputResponseBody'
type: object
FormsNumberValueObjectResponseBody:
description: The value of a number form input field.
properties:
value:
description: Number value.
example: 123.456
format: double
type: number
required:
- value
type: object
GoaVehicleTinyResponseResponseBody:
description: A minified vehicle object. This object is only returned if the route is assigned to the vehicle.
properties:
externalIds:
additionalProperties:
type: string
description: A map of external ids
type: object
id:
description: ID of the vehicle
example: '494123'
type: string
name:
description: Name of the vehicle
example: 'Fleet Truck #1'
type: string
type: object
GoaAttributeTinyResponseBody:
description: Attribute properties.
properties:
id:
description: Id of the attribute
example: '494123'
type: string
name:
description: Name of the attribute
example: Compliance/ELD
type: string
numberValues:
description: List of number values associated with the attribute
example:
- 867
- 5309
items:
example: 0.7405685598633346
format: double
type: number
type: array
stringValues:
description: List of string values associated with the attribute.
example:
- HQ
- Leased
items:
example: Tempora dolorum placeat.
type: string
type: array
type: object
EngineIdleDataResponseBody:
description: Details specific to Engine Idle.
properties:
driver:
$ref: '#/components/schemas/alertObjectDriverResponseBody'
vehicle:
$ref: '#/components/schemas/alertObjectVehicleResponseBody'
type: object
DashcamDisconnectedResponseBody:
description: Details specific to Dashcam Disconnected.
properties:
driver:
$ref: '#/components/schemas/alertObjectDriverResponseBody'
trailer:
$ref: '#/components/schemas/alertObjectTrailerResponseBody'
vehicle:
$ref: '#/components/schemas/alertObjectVehicleResponseBody'
type: object
FuelLevelPercentageResponseBody:
description: Details specific to Fuel Level Percentage.
properties:
driver:
$ref: '#/components/schemas/alertObjectDriverResponseBody'
trailer:
$ref: '#/components/schemas/alertObjectTrailerResponseBody'
vehicle:
$ref: '#/components/schemas/alertObjectVehicleResponseBody'
type: object
FormsTableValueObjectResponseBody:
description: The value of a table form input field.
properties:
columns:
description: List of table columns.
items:
$ref: '#/components/schemas/FormsTableColumnObjectResponseBody'
type: array
rows:
description: List of table rows.
items:
$ref: '#/components/schemas/FormsTableRowObjectResponseBody'
type: array
required:
- columns
- rows
type: object
VehicleDetectedResponseBody:
description: Details specific to Vehicle Detected.
properties:
cameraStream:
$ref: '#/components/schemas/alertObjectOnvifCameraStreamResponseBody'
type: object
VehicleFaultsResponseBody:
description: Details specific to Vehicle Faults.
properties:
driver:
$ref: '#/components/schemas/alertObjectDriverResponseBody'
trailer:
$ref: '#/components/schemas/alertObjectTrailerResponseBody'
vehicle:
$ref: '#/components/schemas/alertObjectVehicleResponseBody'
type: object
GoaDriverTinyResponseResponseBody:
description: A minified driver object. This object is only returned if the route is assigned to the driver.
properties:
externalIds:
additionalProperties:
type: string
description: A map of external ids
type: object
id:
description: ID of the driver
example: '45646'
type: string
name:
description: Name of the driver
example: Driver Bob
type: string
required:
- id
type: object
multipleChoiceValueObjectResponseBody:
properties:
selected:
description: Boolean representing if the choice has been selected.
example: false
type: boolean
value:
description: Description of the choice.
example: 'Yes'
type: string
type: object
AlertsGetIncidentsTooManyRequestsErrorResponseBody:
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
alertObjectWorkforceCameraDeviceResponseBody:
description: A camera device associated with the alert
properties:
id:
description: The ID of the camera device associated with the alert
example: '22222'
type: string
name:
description: The name of the camera device
example: Camera-123
type: string
sites:
description: The list of sites associated with the camera device.
items:
$ref: '#/components/schemas/alertObjectSitesResponseBody'
type: array
tags:
description: The list of [tags](https://kb.samsara.com/hc/en-us/articles/360026674631-Using-Tags-and-Tag-Nesting) associated with the camera device.
items:
$ref: '#/components/schemas/GoaTagTinyResponseResponseBody'
type: array
required:
- id
type: object
WorkflowIncidentConditionObjectResponseBody:
description: Object representing the granular details of the condition. These details will vary depending on the condition.
properties:
description:
description: Descriptive name of the condition.
example: Alert Type Description
type: string
details:
$ref: '#/components/schemas/WorkflowIncidentDetailsObjectResponseBody'
triggerId:
description: Unique identifier describing the type of condition being represented.
example: 1000
format: int64
type: integer
required:
- description
- details
- triggerId
type: object
DriverAppSignOutResponseBody:
description: Details specific to Driver App Sign Out.
properties:
driver:
$ref: '#/components/schemas/alertObjectDriverResponseBody'
type: object
GatewayDisconnectedResponseBody:
description: Details specific to Gateway Disconnected.
properties:
driver:
$ref: '#/components/schemas/alertObjectDriverResponseBody'
trailer:
$ref: '#/components/schemas/alertObjectTrailerResponseBody'
vehicle:
$ref: '#/components/schemas/alertObjectVehicleResponseBody'
type: object
DriverMessageReceivedResponseBody:
description: Details specific to Driver Message Received.
properties:
driver:
$ref: '#/components/schemas/alertObjectDriverResponseBody'
type: object
FormsScoreObjectResponseBody:
description: Forms score object.
properties:
maxPoints:
description: Total possible points of the form submission.
example: 80
format: double
type: number
scorePercent:
description: Percentage score of the form submission, calculated as scorePoints / maxPoints.
example: 75
format: double
type: number
scorePoints:
description: Score, in points, of the form submission.
example: 60
format: double
type: number
required:
- maxPoints
- scorePercent
- scorePoints
type: object
GoaRouteStopTinyResponseResponseBody:
description: A minified route stop object
properties:
externalIds:
additionalProperties:
type: string
description: A map of external ids
type: object
id:
description: Id of the route stop
example: '494123'
type: string
name:
description: Name of the route stop
example: 'Company Warehouse #1'
type: string
type: object
MinimalRouteStopResponseBody:
description: A single route stop for a route.
properties:
actualArrivalTime:
description: Actual arrival time, if it exists, for the route stop in RFC 3339 format.
example: '2006-01-02T15:04:05+07:00'
format: date-time
type: string
actualDepartureTime:
description: Actual departure time, if it exists, for the route stop in RFC 3339 format.
example: '2006-01-02T15:04:05+07:00'
format: date-time
type: string
enRouteTime:
description: The time the stop became en-route, in RFC 3339 format.
example: '2006-01-02T15:04:05+07:00'
format: date-time
type: string
eta:
description: Estimated time of arrival, if this stop is currently en-route, in RFC 3339 format.
example: '2006-01-02T15:04:05+07:00'
format: date-time
type: string
externalIds:
additionalProperties:
type: string
description: A map of external ids
type: object
id:
description: Unique identifier for the route stop.
example: '141414'
type: string
liveSharingUrl:
description: The shareable url of the stop's current status.
example: https://cloud.samsara.com/fleet/viewer/job/fleet_viewer_token
type: string
skippedTime:
description: Skipped time, if it exists, for the route stop in RFC 3339 format.
example: '2006-01-02T15:04:05+07:00'
format: date-time
type: string
state:
description: 'The current state of the route stop. Valid values: `unassigned`, `scheduled`, `en route`, `skipped`, `arrived`, `departed`'
enum:
- unassigned
- scheduled
- en route
- skipped
- arrived
- departed
example: scheduled
type: string
required:
- id
- state
type: object
JammingDetectedResponseBody:
description: Details specific to Jamming Detected.
properties:
driver:
$ref: '#/components/schemas/alertObjectDriverResponseBody'
trailer:
$ref: '#/components/schemas/alertObjectTrailerResponseBody'
vehicle:
$ref: '#/components/schemas/alertObjectVehicleResponseBody'
type: object
AmbientTemperatureResponseBody:
description: Details specific to Ambient Temperature.
properties:
sensor:
$ref: '#/components/schemas/alertObjectSensorResponseBody'
type: object
FormsPolymorphicUserObjectResponseBody:
description: User or driver object.
properties:
id:
description: ID of the polymorphic user.
example: '938172'
type: string
type:
description: 'The type of the polymorphic user. Valid values: `driver`, `user`'
enum:
- driver
- user
example: driver
type: string
required:
- id
- type
type: object
GoaPaginationResponseResponseBody:
description: Pagination parameters.
properties:
endCursor:
description: Cursor identifier representing the last element in the response. This value should be used in conjunction with a subsequent request's 'after' query parameter. This may be an empty string if there are no more pages left to view.
example: MjkY
type: string
hasNextPage:
description: True if there are more pages of results immediately available after this endCursor.
example: true
type: boolean
required:
- endCursor
- hasNextPage
type: object
DvirDefectsObject_v2022_09_13ResponseBody:
description: A description of a DVIR defect
properties:
comment:
description: Comment on the defect.
example: Air compressor not working
type: string
createdAtTime:
description: Time when the defect was created. UTC timestamp in RFC 3339 format.
example: '2020-01-27T07:06:25Z'
type: string
defectType:
description: The type of DVIR defect.
example: Air Compressor
type: string
id:
description: The ID of the defect.
example: '18'
type: string
isResolved:
description: Signifies if this defect is resolved.
example: false
type: boolean
mechanicNotes:
description: The mechanic notes on this defect.
example: Extremely large oddly shaped hole in passenger side window.
type: string
mechanicNotesUpdatedAtTime:
description: Time when mechanic notes were last updated. UTC timestamp in RFC 3339 format.
example: '2020-01-27T07:06:25Z'
type: string
resolvedAtTime:
description: Time when this defect was resolved. Will not be returned if the defect is unresolved. UTC timestamp in RFC 3339 format.
example: '2020-01-27T07:06:25Z'
type: string
resolvedBy:
$ref: '#/components/schemas/DvirResolvedByObjectResponseBody'
trailer:
$ref: '#/components/schemas/GoaTrailerTinyResponseResponseBody'
vehicle:
$ref: '#/components/schemas/VehicleWithGatewayTinyResponseResponseBody'
required:
- createdAtTime
- defectType
- id
- isResolved
type: object
FormsAssetObjectResponseBody:
description: Tracked or untracked (i.e. manually entered) asset object.
properties:
entryType:
description: 'The type of entry for the asset. Valid values: `tracked`, `untracked`'
enum:
- tracked
- untracked
example: tracked
type: string
id:
description: ID of a tracked asset. Included if 'entryType' is 'tracked'.
example: '281474982859091'
type: string
name:
description: Name of an untracked (i.e. manually entered) asset.
example: trailer 123
type: string
required:
- entryType
type: object
HosViolationDataResponseBody:
description: Details specific to Hos Violation.
properties:
driver:
$ref: '#/components/schemas/alertObjectDriverResponseBody'
type: object
TamperingDetectedResponseBody:
description: Details specific to Tampering Detected.
properties:
driver:
$ref: '#/components/schemas/alertObjectDriverResponseBody'
trailer:
$ref: '#/components/schemas/alertObjectTrailerResponseBody'
vehicle:
$ref: '#/components/schemas/alertObjectVehicleResponseBody'
type: object
EngineOffResponseBody:
description: Details specific to Engine Off.
properties:
driver:
$ref: '#/components/schemas/alertObjectDriverResponseBody'
trailer:
$ref: '#/components/schemas/alertObjectTrailerResponseBody'
vehicle:
$ref: '#/components/schemas/alertObjectVehicleResponseBody'
type: object
IssueSourceObjectResponseBody:
description: Contains information about where an issue came from.
properties:
id:
description: ID of the issue's source object. The format depends on the 'type'. Included if 'type' is not 'ad-hoc'.
example: 9814a1fa-f0c6-408b-bf85-51dc3bc71ac7
type: string
type:
description: 'The type of issue source. Valid values: `form`, `ad-hoc`'
enum:
- form
- ad-hoc
example: form
type: string
required:
- type
type: object
RoutesStopResponseObjectResponseBody:
properties:
actualArrivalTime:
description: Actual arrival time, if it exists, for the route stop in RFC 3339 format.
example: '2006-01-02T15:04:05+07:00'
format: date-time
type: string
actualDepartureTime:
description: Actual departure time, if it exists, for the route stop in RFC 3339 format.
example: '2006-01-02T15:04:05+07:00'
format: date-time
type: string
address:
$ref: '#/components/schemas/GoaAddressTinyResponseResponseBody'
documents:
description: List of documents associated with the stop.
items:
$ref: '#/components/schemas/GoaDocumentTinyResponseResponseBody'
type: array
enRouteTime:
description: The time the stop became en-route, in RFC 3339 format.
example: '2006-01-02T15:04:05+07:00'
format: date-time
type: string
eta:
description: Estimated time of arrival, if this stop is currently en-route, in RFC 3339 format.
example: '2006-01-02T15:04:05+07:00'
format: date-time
type: string
externalIds:
additionalProperties:
type: string
description: A map of external ids
type: object
id:
description: Id of the stop
example: '324231'
type: string
liveSharingUrl:
description: The shareable url of the stop's current status.
example: https://cloud.samsara.com/fleet/viewer/job/fleet_viewer_token
type: string
locationLiveSharingLinks:
description: List of shareable, non-expired 'By Location' Live Sharing Links.
items:
$ref: '#/components/schemas/LiveSharingLinkResponseObjectResponseBody'
type: array
name:
description: Name of the stop
example: 'Stop #1'
type: string
notes:
description: Notes for the stop
example: These are my notes
maxLength: 2000
type: string
ontimeWindowAfterArrivalMs:
description: Specifies the time window (in milliseconds) after a stop's scheduled arrival time during which the stop is considered 'on-time'.
example: 300000
format: int64
type: integer
ontimeWindowBeforeArrivalMs:
description: Specifies the time window (in milliseconds) before a stop's scheduled arrival time during which the stop is considered 'on-time'.
example: 300000
format: int64
type: integer
scheduledArrivalTime:
description: Scheduled arrival time, if it exists, for the stop in RFC 3339 format.
example: '2019-06-13T19:08:25Z'
format: date-time
type: string
scheduledDepartureTime:
description: Scheduled departure time, if it exists, for the stop in RFC 3339 format.
example: '2019-06-13T19:08:25Z'
format: date-time
type: string
singleUseLocation:
$ref: '#/components/schemas/RoutesSingleUseAddressObjectResponseBody'
skippedTime:
description: Skipped time, if it exists, for the route stop in RFC 3339 format.
example: '2006-01-02T15:04:05+07:00'
format: date-time
type: string
state:
description: 'The current state of the route stop. Valid values: `unassigned`, `scheduled`, `en route`, `skipped`, `arrived`, `departed`'
enum:
- unassigned
- scheduled
- en route
- skipped
- arrived
- departed
example: scheduled
type: string
required:
- id
- name
- state
# --- truncated at 32 KB (103 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/samsara/refs/heads/main/openapi/samsara-incidents-api-openapi.yml