getMetrics

getMetrics

Query Parameters
entityType string REQUIRED

Possible values: [account, app, keyset]

Type of entity to get metrics for

entityId string REQUIRED

ID of the entity

from string REQUIRED

Start date (inclusive) in YYYY-MM-DD format

to string REQUIRED

End date (exclusive) in YYYY-MM-DD format

metrics string REQUIRED

Comma-separated list of metric names to retrieve. Each metric name must be one of the valid values defined in the introduction section.

Header Parameters
PubNub-Version string REQUIRED

Possible values: [2025-11-15]

Responses
200

Successful metrics query

Schema OPTIONAL
metrics object

Metrics data organized by metric name and date. Each key is a metric name, and its value is an object with date keys (YYYY-MM-DD) and numeric values.

400

Bad request - invalid parameters

Schema OPTIONAL
undefined
* required
PubNub-Version*
Type: string
Possible values: [2025-11-15]
* required
entityType*
Type: string
Type of entity to get metrics for
entityId*
Type: string
ID of the entity
from*
Type: string
Start date (inclusive) in YYYY-MM-DD format
to*
Type: string
End date (exclusive) in YYYY-MM-DD format
metrics*
Type: string
Comma-separated list of metric names to retrieve. Each metric name must be one of the valid values defined in the introduction section.
metrics
Type: object
Metrics data organized by metric name and date. Each key is a metric name, and its value is an object with date keys (YYYY-MM-DD) and numeric values.
Example: [{"publish":{"2024-04-03":1234,"2024-04-04":1567,"2024-04-05":2134},"subscribe_msgs":{"2024-04-03":5678,"2024-04-04":6234,"2024-04-05":7890}},{"mtd_uuid":{"2024-04-30":20480259}}]