Get Robot State Distribution
GET/api/v1/analytics/robot-state-distribution
Time spent in each of the seven robot states over a window, as overall totals and per-bucket durations. Uses the same carry-forward state measurement as /robot-state-timeline, then slices each state interval across bucket boundaries so every bucket holds the milliseconds spent in each state.
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.
Responses
- 200
- 400
- 500
Successful response with per-state totals and per-bucket durations (ms)
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
- Array [
- ]
- Array [
- ]
data objectrequired
window objectrequired
Possible values: [2hour, day, 3day, 9day, 30day]
states object[]required
bucket_ranges object[]required
series objectrequired
property name* number[]
number
{
"success": true,
"message": "string",
"data": {
"window": {
"start": "string",
"end": "string",
"elapsed_ms": 0,
"tracked_ms": 0,
"coverage_pct": 0,
"granularity": "2hour"
},
"states": [
{
"key": "string",
"val": 0,
"duration_ms": 0,
"percentage": 0
}
],
"buckets": [
"string"
],
"bucket_ranges": [
{
"start": "string",
"end": "string"
}
],
"series": {}
},
"status": 0
}
Invalid or missing timestamps
- 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
}