Skip to main content
POST
/
kpis
/
objects
/
aggregate
curl --request POST \
  --url https://api.inorbit.ai/kpis/objects/aggregate \
  --header 'Content-Type: application/json' \
  --header 'x-auth-inorbit-app-key: <api-key>' \
  --data '
{
  "objectType": "mission",
  "startTime": 1717200000000,
  "endTime": 1719800000000,
  "limit": 100,
  "offset": 0,
  "groupBy": [
    "robotData.collection.location"
  ],
  "aggregations": [
    {
      "operator": "COUNT",
      "field": "id",
      "alias": "totalMissions"
    },
    {
      "operator": "SUM",
      "field": "data.duration",
      "alias": "totalDuration"
    }
  ]
}
'
{
  "data": [
    {
      "entityId": "r-001",
      "totalMissions": 42
    },
    {
      "entityId": "r-002",
      "totalMissions": 15
    }
  ],
  "hasMore": false
}

Authorizations

x-auth-inorbit-app-key
string
header
required

InOrbit appKey authenticates API requests using a token.

You can obtain your appKey in the Authentication docs.

Body

application/json
objectType
string
required

KPI object type (e.g., mission, incident)

startTime
integer<int64>
required

Start timestamp in milliseconds

endTime
integer<int64>
required

End timestamp in milliseconds

limit
integer
required

Maximum number of records to return

Required range: 1 <= x <= 1000
offset
integer
required

Number of records to skip

Required range: x >= 0
aggregations
object[]
required

List of aggregations

intervalMinutes
integer

Interval for time aggregations

filters
object[]

Optional filters to apply on fields

groupBy
string[]

Fields to group results by. To group by tags in a given collection with COLLECTION_ID use "robotData.collection.${COLLECTION_ID}"

secondAggregation
object
secondAggregationGroupBy
string[]

Fields to group results by for the second aggregation. Only valid when secondAggregation is specified.

Response

Aggregation results

data
object[]

Objects containing groupBy fields and aggregation results

hasMore
boolean

Whether more records match the criteria