# Cumulocity Device statistics API

**Canonical:** https://apis.io/apis/cumulocity/cumulocity-device-statistics-api/  
**Provider:** Cumulocity — https://apis.io/providers/cumulocity/  
**Base URL:** mqtt://{tenant}.cumulocity.com:1883  
**Documentation:** https://cumulocity.com/docs/device-integration/mqtt/

Cumulocity Device statistics API is one of 62 APIs that [Cumulocity](https://apis.io/providers/cumulocity/) publishes on the [APIs.io](https://apis.io/) network, described by a machine-readable OpenAPI specification and an AsyncAPI event-driven specification. This API exposes 4 JSON Schema definitions. Tagged areas include Device statistics. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, a JSON-LD context, an AsyncAPI specification, and 4 JSON Schemas.

Device statistics are collected for each inventory object with at least one measurement, event or alarm. There are no additional checks if the inventory object is marked as device using the `c8y_IsDevice` fragment. When the first measurement, event or alarm is created for a specific inventory object, Cumulocity is always considering this as a device and starts counting. Device statistics are counted with daily and monthy rate. All requests are considered when counting device statistics, no matter which processing mode is used. The following requests are counted: * Alarm creation and update * Event creation and update * Measurement creation * Bulk measurement creation is counted as multiple requests * Bulk alarm status update is counted as multiple requests * MQTT and SmartREST requests with multiple rows are counted as multiple requests ### Frequently asked questions #### Are operations on device firmware counted? **No**, device configuration and firmware update operate on inventory objects, hence they are not counted. #### Are requests done by the UI applications, for example, when browsing device details, counted? **No**, viewing device details performs only GET requests which are not counted. #### Is the clear alarm operation done from the UI counted? **Yes**, a clear alarm operation in fact performs an alarm update operation and it will be counted as device request. #### Is there any operation performed on the device which is counted? **Yes**, retrieving device logs requires from the device to create an event and attach a binary with logs to it. Those are two separate requests and both are counted. #### When I have a device with children are the requests counted always to the root device or separately for each child? Separately for each child. #### Why do device statistics show significantly smaller request numbers than the total number of created and updated request from usage statistics? The important aspect here is the moment of recording values for the counters. For inbound data usage statistics we count every request that passed authorization, including invalid requests, as stated in usage statistics description. For device statistics it is different. We count requests after data is successfully stored in the database (or transient), which means the request was valid and there was no problem with persistence. In summary, if you observe that your usage statistics counters are significantly larger than your device statistics counters, there is a good chance that some devices or microservices in your tenant are constantly sending invalid requests. In such a situation, the client should check the state of theirs tenant.

## Operations (2)

| Method | Path | Summary |
|---|---|---|
| GET | `/tenant/statistics/device/{tenantId}/monthly/{date}` | Retrieve monthly device statistics |
| GET | `/tenant/statistics/device/{tenantId}/daily/{date}` | Retrieve daily device statistics |

## Machine-readable artifacts (18)

- **OpenAPI** — https://raw.githubusercontent.com/api-evangelist/cumulocity/refs/heads/main/openapi/cumulocity-device-statistics-api-openapi.yml
- **Documentation** — https://cumulocity.com/api/core/
- **Documentation** — https://cumulocity.com/docs/concepts/domain-model/
- **JSONSchema** — https://raw.githubusercontent.com/api-evangelist/cumulocity/refs/heads/main/json-schema/cumulocity-managed-object-schema.json
- **JSONLD** — https://raw.githubusercontent.com/api-evangelist/cumulocity/refs/heads/main/json-ld/cumulocity-context.jsonld
- **JSONSchema** — https://raw.githubusercontent.com/api-evangelist/cumulocity/refs/heads/main/json-schema/cumulocity-measurement-schema.json
- **JSONSchema** — https://raw.githubusercontent.com/api-evangelist/cumulocity/refs/heads/main/json-schema/cumulocity-event-schema.json
- **JSONSchema** — https://raw.githubusercontent.com/api-evangelist/cumulocity/refs/heads/main/json-schema/cumulocity-alarm-schema.json
- **Documentation** — https://cumulocity.com/docs/device-integration/device-integration-introduction/
- **Documentation** — https://cumulocity.com/docs/microservice-sdk/
- **Documentation** — https://cumulocity.com/docs/reference/notifications/
- **AsyncAPI** — https://raw.githubusercontent.com/api-evangelist/cumulocity/refs/heads/main/asyncapi/cumulocity-notification2-asyncapi.yml
- **Documentation** — https://cumulocity.com/api/datahub/
- **Documentation** — https://cumulocity.com/docs/datahub/datahub-overview/
- **Documentation** — https://cumulocity.com/api/dtm/
- **Documentation** — https://cumulocity.com/docs/digital-twin-manager/dtm-overview/
- **Documentation** — https://cumulocity.com/api/edge/
- **Documentation** — https://cumulocity.com/docs/edge/edge-overview/

## Other Cumulocity APIs (12)

- [Cumulocity MQTT and SmartREST API](https://apis.io/apis/cumulocity/cumulocity-mqtt-api/)
- [Cumulocity MQTT Service API](https://apis.io/apis/cumulocity/cumulocity-mqtt-service-api/)
- [Cumulocity Alarms API](https://apis.io/apis/cumulocity/cumulocity-alarms-api/)
- [Cumulocity Application Binaries API](https://apis.io/apis/cumulocity/cumulocity-application-binaries-api/)
- [Cumulocity Applications API](https://apis.io/apis/cumulocity/cumulocity-applications-api/)
- [Cumulocity Asset Instances API](https://apis.io/apis/cumulocity/cumulocity-asset-instances-api/)
- [Cumulocity Asset Models API](https://apis.io/apis/cumulocity/cumulocity-asset-models-api/)
- [Cumulocity Binaries API](https://apis.io/apis/cumulocity/cumulocity-binaries-api/)
- [Cumulocity Bulk Operations API](https://apis.io/apis/cumulocity/cumulocity-bulk-operations-api/)
- [Cumulocity Cloud Sync API](https://apis.io/apis/cumulocity/cumulocity-cloud-sync-api/)
- [Cumulocity Current User API](https://apis.io/apis/cumulocity/cumulocity-current-user-api/)
- [Cumulocity Device Credentials API](https://apis.io/apis/cumulocity/cumulocity-device-credentials-api/)

## Tags

Device statistics

---

Profiled by [API Evangelist](https://apievangelist.com) and published on [APIs.io](https://apis.io/apis/cumulocity/cumulocity-device-statistics-api/). The API's provider profile, Kin Score and agent-readiness rating are at https://apis.io/providers/cumulocity/.
