List metrics

Returns a list of all metrics for your account.

Query Parameters
customerId string
isCustomer boolean
Header Parameters
PubNub-Version string REQUIRED

Possible values: [2026-02-09]

Responses
200
Schema OPTIONAL
object[]
id string

PubNub-generated unique ID for the metric. Required in later requests to update, delete, or retrieve the metric.

name string

Metric name (1-50 characters).

measureId string

Field ID to aggregate (required for AVG, MAX, MIN, SUM functions). References a NUMERIC field from the business object.

businessObjectId string

ID of the source business object.

evaluationWindow number OPTIONAL

Time period in seconds for metric evaluation. Allowed values: 60 (1 min), 300 (5 min), 600 (10 min), 900 (15 min), 1800 (30 min), 3600 (1 hour), 86400 (1 day).

function string

Aggregation function: AVG, COUNT, COUNT_DISTINCT, MAX, MIN, or SUM.

dimensionIds string[] OPTIONAL

Field IDs to group by (TEXT fields only). References dimensions from the business object.

dimensions object[] OPTIONAL

Information about the IDs included in the dimensionIds - the fields you grouped by.

id string

PubNub-generated unique ID for the field. Required when creating metrics and decisions. Used as measureId, dimensionIds, or inputFields[].sourceId.

name string

Field name (1-50 characters).

jsonPath string OPTIONAL

JSON path expression for extracting data (max 200 chars). Required when source is JSONPATH and isActive is true.

jsonFieldType string

Possible values: [TEXT, TEXT_LONG, NUMERIC, TIMESTAMP, DURATION_SECONDS]

Field data type: TEXT, TEXT_LONG (character limit is 1000, limited to 5 per Business Object), NUMERIC, or TIMESTAMP. Required when source is JSONPATH.

isKeyset boolean

Boolean flag indicating if this field is part of the keyset. Informational only.

source string

Possible values: [JSONPATH, DERIVED]

Field source type: JSONPATH or DERIVED.

derivation object OPTIONAL

Derivation configuration. Required when source is DERIVED.

operation string

Possible values: [TIME_DIFF]

Derivation operation type. Currently only TIME_DIFF is supported.

params object

Parameters for the derivation calculation.

startSource string

Possible values: [DATA_FIELD, PUBLISH_TIMETOKEN]

Start source for time difference calculation: DATA_FIELD or PUBLISH_TIMETOKEN. DATA_FIELD accepts only TIMESTAMP data type.

startFieldIndex number OPTIONAL

Index or position of the start timestamp data field in your array. Not required if startSource is PUBLISH_TIMETOKEN.

endSource string

Possible values: [DATA_FIELD, PUBLISH_TIMETOKEN]

End source for time difference calculation: DATA_FIELD or PUBLISH_TIMETOKEN.

endFieldIndex number OPTIONAL

Index or position of the end timestamp data field in your array. Not required if endSource is PUBLISH_TIMETOKEN.

filters object[] OPTIONAL

Filtering criteria for the metric.

id string

PubNub-generated ID for the metric filter. Required when updating a metric (PUT).

sourceType string

Possible values: [MEASURE, DIMENSION]

Filter source type. Value must always be DIMENSION.

sourceId string

ID of the field or data field to filter on.

operation string

Possible values: [NUMERIC_GREATER_THAN, NUMERIC_GREATER_THAN_EQUALS, NUMERIC_LESS_THAN, NUMERIC_LESS_THAN_EQUALS, NUMERIC_INCLUSIVE_BETWEEN, NUMERIC_EXCLUSIVE_NOT_BETWEEN, BOOLEAN_IS_TRUE, BOOLEAN_IS_FALSE, STRING_CONTAINS, STRING_NOT_CONTAINS, STRING_STARTS_WITH, STRING_ENDS_WITH, STRING_EQUALS, STRING_IS_EMPTY, STRING_IS_NOT_EMPTY, STRING_NOT_EQUALS]

Filter operation: STRING_EQUALS, STRING_NOT_EQUAL, STRING_CONTAINS, STRING_NOT_CONTAINS, STRING_IS_EMPTY, STRING_IS_NOT_EMPTY, STRING_STARTS_WITH, STRING_ENDS_WITH.

arguments string[]

Filter arguments (1 string). Matching is case-sensitive.

businessObject (circular) OPTIONAL

Optional nested object with details of the source Business Object.

* required
PubNub-Version*
Type: string
Possible values: [2026-02-09]
customerId
Type: string
isCustomer
Type: boolean