AdminApiQueryController_executeSavedQuery

AdminApiQueryController_executeSavedQuery

Header Parameters
PubNub-Version string REQUIRED

Possible values: [2026-02-09]

Responses
200

Saved query executed successfully

Schema OPTIONAL
data object[]
executionTime number
queryDefinition object
version string
pipeline object
sources object[]
id string

Possible values: length ≤ 128, Value must match regular expression IDENTIFIER_PATTERN

type string

Possible values: [businessObject, reference]

businessObjectId string OPTIONAL
referenceId string OPTIONAL
timeRange object OPTIONAL
field string
relative object OPTIONAL
direction string

Possible values: [past, future]

value number

Possible values: 1 ≤ value

unit string

Possible values: [seconds, minutes, hours, days, weeks, months]

absolute object OPTIONAL
start string
end string
filters object[] OPTIONAL
field string
operator string

Possible values: [=, !=, >, <, >=, <=, in, notIn, like, between, notBetween, isNull, isNotNull, contains, notContains, startsWith, endsWith, isEmpty, isNotEmpty, minLength, maxLength]

value object OPTIONAL
fields object[]
id string OPTIONAL

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

name string

Possible values: 1 ≤ length ≤ 50

Field name (1-50 characters).

source string OPTIONAL

Possible values: [JSONPATH, DERIVED]

Field source type: JSONPATH or DERIVED.

jsonPath string OPTIONAL

Possible values: length ≤ 200

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

jsonFieldType string OPTIONAL

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 OPTIONAL

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

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.

transforms object[] OPTIONAL
id string

Possible values: length ≤ 128, Value must match regular expression IDENTIFIER_PATTERN

type string

Possible values: [aggregate, window, join, dedupe, calculate, unnest, filter_join]

input string

Possible values: length ≤ 128, Value must match regular expression IDENTIFIER_PATTERN

aggregate object OPTIONAL
groupBy string[]
aggregations object[]
function string

Possible values: [sum, count, avg, min, max, countDistinct, stddev, percentile, groupArray, groupUniqArray, any]

field string
alias string
parameter number OPTIONAL
collectFields object[] OPTIONAL
field string
function string

Possible values: [groupArray, groupUniqArray]

alias string
limit number OPTIONAL

Possible values: 1 ≤ value

orderBy object OPTIONAL
field string
direction string OPTIONAL

Possible values: [ASC, DESC]

window object OPTIONAL
functions object[]
function string

Possible values: [rowNumber, rank, denseRank, percentRank, lag, lead, firstValue, lastValue, sumOver, avgOver]

partitionBy string[]
orderBy object[]
field string
direction string OPTIONAL

Possible values: [ASC, DESC]

alias string
offset number OPTIONAL
join object OPTIONAL
with string

Possible values: length ≤ 128, Value must match regular expression IDENTIFIER_PATTERN

type string

Possible values: [inner, left, right, full]

on object[]
left string
operator string

Possible values: [=, !=, >, <, >=, <=]

right string
dedupe object OPTIONAL
partitionBy string[]
orderBy object[]
field string
direction string OPTIONAL

Possible values: [ASC, DESC]

keep string

Possible values: [first, last]

calculate object OPTIONAL
expressions object[]
expression object
alias string

Possible values: length ≤ 128, Value must match regular expression IDENTIFIER_PATTERN

type string

Possible values: [dimension, measure]

unnest object OPTIONAL
arrayField string
alias string OPTIONAL
filter_join object OPTIONAL
criteriaAggregate object
groupBy string[]
aggregations object[]
function string

Possible values: [sum, count, avg, min, max, countDistinct, stddev, percentile, groupArray, groupUniqArray, any]

field string
alias string
parameter number OPTIONAL
collectFields object[] OPTIONAL
field string
function string

Possible values: [groupArray, groupUniqArray]

alias string
limit number OPTIONAL

Possible values: 1 ≤ value

orderBy object OPTIONAL
field string
direction string OPTIONAL

Possible values: [ASC, DESC]

criteriaFilters object[] OPTIONAL
field string
operator string

Possible values: [=, !=, >, <, >=, <=, in, notIn, like, between, notBetween, isNull, isNotNull, contains, notContains, startsWith, endsWith, isEmpty, isNotEmpty, minLength, maxLength]

value object OPTIONAL
joinFields string[]
filters object[] OPTIONAL
field string
operator string

Possible values: [=, !=, >, <, >=, <=, in, notIn, like, between, notBetween, isNull, isNotNull, contains, notContains, startsWith, endsWith, isEmpty, isNotEmpty, minLength, maxLength]

value object OPTIONAL
output object
from string

Possible values: length ≤ 128, Value must match regular expression IDENTIFIER_PATTERN

select object[]
field string
alias string OPTIONAL
id string OPTIONAL
orderBy object[] OPTIONAL
field string
direction string OPTIONAL

Possible values: [ASC, DESC]

limit number OPTIONAL

Possible values: 1 ≤ value ≤ 500

offset number OPTIONAL
meta object OPTIONAL
400

Invalid query request structure or parameters

404

Query not found

* required
PubNub-Version*
Type: string
Possible values: [2026-02-09]
data
Type: array
Array items:
items
Type: object
executionTime
Type: number
queryDefinition
Type: object