Get Safety Events
GET/api/v1/analytics/safety-events
Per-bucket occurrence counts for four safety event groups (safety_stop, error, emergency_stop, manual_interaction) over a time window. An occurrence is a rising edge — one count each time the robot enters a tracked state, regardless of how long it stays there. When export=true the response is an XLSX file download instead of JSON.
Request
Query Parameters
Mandatory. Inclusive window start — ISO 8601 datetime or epoch milliseconds.
Mandatory. Inclusive window end — ISO 8601 datetime or epoch milliseconds.
Possible values: [2hour, day, 3day, 9day, 30day, auto]
Bucket size. auto derives the bin from the span: 1 d → 2-hour bins, 7 d → 1-day, 30 d → 3-day, 90 d → 9-day, 360 d → 30-day, other spans → ceil(days/12) snapped to the nearest level. Defaults to auto.
IANA timezone. When set, buckets are local calendar days (or 2-hour slots) aligned to the local midnight of start_timestamp, and multi-day buckets count from that day. When omitted, buckets are UTC-aligned.
Possible values: [true, false]
When true, returns an XLSX file download (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) with columns: date, safety_stop, error, emergency_stop, manual_interaction. When false or omitted, returns the standard JSON response.
Responses
- 200
- 400
- 500
JSON occurrence counts (default) or CSV file download (when export=true)
- application/json
- text/csv
- Schema
- Example (from schema)
Schema
- Array [
- ]
data objectrequired
window objectrequired
Possible values: [2hour, day, 3day, 9day, 30day]
bucket_ranges object[]required
series objectrequired
safety_stop objectrequired
error objectrequired
emergency_stop objectrequired
manual_interaction objectrequired
{
"success": true,
"message": "string",
"data": {
"window": {
"start_timestamp": "string",
"end_timestamp": "string",
"granularity": "2hour"
},
"buckets": [
"string"
],
"bucket_ranges": [
{
"start": "string",
"end": "string"
}
],
"series": {
"safety_stop": {
"total": 0,
"data": [
0
]
},
"error": {
"total": 0,
"data": [
0
]
},
"emergency_stop": {
"total": 0,
"data": [
0
]
},
"manual_interaction": {
"total": 0,
"data": [
0
]
}
}
},
"status": 0
}
- Schema
Schema
string
Invalid timestamps or timezone
- application/json
- Schema
- Example (from schema)
Schema
{
"success": true,
"message": "string",
"status": 0
}
Internal server error
- application/json
- Schema
- Example (from schema)
Schema
{
"success": true,
"message": "string",
"status": 0
}