AdminApiQueryController_createPredefinedDecision

AdminApiQueryController_createPredefinedDecision

Header Parameters
PubNub-Version string REQUIRED

Possible values: [2026-02-09]

Request Body REQUIRED
name string

Possible values: 1 ≤ length ≤ 50

description string

Possible values: length ≤ 200

configurationType string

Possible values: length ≤ 50

customerId string
Responses
201

Predefined decision created successfully for the query

Schema OPTIONAL
createdAt date-time OPTIONAL

Creation timestamp (ISO 8601, UTC).

updatedAt date-time OPTIONAL

Last update timestamp (ISO 8601, UTC).

createdBy string OPTIONAL

Email of the creator.

updatedBy string OPTIONAL

Email of the last updater.

id string

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

name string

Decision name (1-50 characters).

description string OPTIONAL

Description (max 200 characters).

accountId string

Your PubNub account ID.

businessObjectId string OPTIONAL

ID of the associated business object.

sourceType string OPTIONAL

Possible values: [BUSINESSOBJECT, METRIC, QUERY]

Decision source type: BUSINESSOBJECT or METRIC.

sourceId string OPTIONAL

ID of the metric or business object used as the data source.

hitType string

Possible values: [SINGLE, MULTI]

Rule matching behavior: SINGLE (stop at first match) or MULTIPLE (evaluate all rules).

enabled boolean

Whether decision is active (default: false). Must be false when creating a decision.

activeFrom date-time OPTIONAL

Start date/time for activation (ISO 8601, UTC).

activeUntil date-time OPTIONAL

End date/time for deactivation (ISO 8601, UTC).

executeOnce boolean

Execute actions only once when conditions are satisfied for the first time.

executionFrequency number OPTIONAL

Evaluation frequency in seconds. Allowed values: 60, 300, 600, 900, 1800, 3600, 86400.

inputFields object[] OPTIONAL

Input fields for decision conditions. Required if sourceType is BUSINESSOBJECT.

id string OPTIONAL

PubNub-generated unique ID for the input field. Required when creating or updating rules.

sourceType object OPTIONAL

Source type for the input field. Use FIELD for BUSINESSOBJECT decisions. For METRIC decisions, this is auto-populated.

sourceId string

ID of metric field/dimension to use as input or condition. References a field from the business object.

name string

Label for the input field (1-50 characters).

outputFields object[] OPTIONAL

Custom variables for use in actions.

id string OPTIONAL

PubNub-generated unique ID for the output field.

name string

Label of the custom variable in the rules table (1-50 characters).

variable string

Name of the custom variable used in action templates (1-50 characters).

rules object[] OPTIONAL

Decision rules containing conditions and actions.

id string OPTIONAL

PubNub-generated unique ID for the rule. Required for updating rules directly.

inputValues object[]

List of conditions to evaluate.

operation string

Possible values: [NUMERIC_EQUALS, NUMERIC_NOT_EQUALS, NUMERIC_GREATER_THAN, NUMERIC_GREATER_THAN_EQUALS, NUMERIC_LESS_THAN, NUMERIC_LESS_THAN_EQUALS, NUMERIC_INCLUSIVE_BETWEEN, STRING_EQUALS, STRING_NOT_EQUALS, STRING_CONTAINS, STRING_NOT_CONTAINS, STRING_STARTS_WITH, STRING_NOT_STARTS_WITH, STRING_ENDS_WITH, STRING_NOT_ENDS_WITH, TIME_SINCE_GREATER_THAN, TIME_SINCE_GREATER_THAN_EQUALS, TIME_SINCE_LESS_THAN, TIME_SINCE_LESS_THAN_EQUALS, TIME_SINCE_EQUALS, TIME_SINCE_NOT_EQUALS, TIME_SINCE_INCLUSIVE_BETWEEN, TIME_UNTIL_GREATER_THAN, TIME_UNTIL_GREATER_THAN_EQUALS, TIME_UNTIL_LESS_THAN, TIME_UNTIL_LESS_THAN_EQUALS, TIME_UNTIL_EQUALS, TIME_UNTIL_NOT_EQUALS, TIME_UNTIL_INCLUSIVE_BETWEEN, ANY]

Condition operation: ANY, NUMERIC_EQUALS, NUMERIC_NOT_EQUALS, NUMERIC_GREATER_THAN, NUMERIC_GREATER_THAN_EQUALS, NUMERIC_LESS_THAN, NUMERIC_LESS_THAN_EQUALS, NUMERIC_INCLUSIVE_BETWEEN, STRING_EQUALS, STRING_NOT_EQUALS, STRING_CONTAINS.

argument string OPTIONAL

Condition argument (max 92 characters). Empty if operation is ANY. For NUMERIC_INCLUSIVE_BETWEEN, separate numbers by comma (e.g., "2,7").

outputValues object[]

Values to assign to outputs when conditions match.

value string

Value that your custom variable will send in actions (max 200 characters).

actionValues object[]

Actions to trigger when conditions match.

status boolean

Whether action is active for this rule (true = execute when conditions satisfied, false = do not execute).

executionLimitType string OPTIONAL

Possible values: [ALWAYS, ONCE, ONCE_PER_INTERVAL, ONCE_PER_CONDITION_GROUP, ONCE_PER_INTERVAL_PER_CONDITION_GROUP]

How often to execute when conditions satisfied. Options: ALWAYS (default), ONCE_PER_INTERVAL, ONCE_PER_INTERVAL_PER_CONDITION, ONCE_PER_INTERVAL_PER_CONDITION_GROUP.

executionLimitIntervalInSeconds number OPTIONAL

Execution interval in seconds: 60, 300, 600, 900, 1800, 3600, 86400. Required if executionLimitType is ONCE_PER_INTERVAL or ONCE_PER_INTERVAL_PER_CONDITION.

executionLimitInputFieldIds string[] OPTIONAL

Field IDs for execution limits. Required if executionLimitType is ONCE_PER_INTERVAL_PER_CONDITION.

resetLimits boolean OPTIONAL

When true, resets accumulated execution limits for this action when updating rules.

actions object[] OPTIONAL

Available actions for rules to execute.

id string OPTIONAL

PubNub-generated unique ID for the action. Required when referencing an action in rules.

actionType string OPTIONAL

Possible values: [WEBHOOK_EXECUTION, PUBNUB_PUBLISH, APPCONTEXT_SET_USER_METADATA, APPCONTEXT_SET_CHANNEL_METADATA, APPCONTEXT_SET_MEMBERSHIP_METADATA]

Action type: PUBNUB_PUBLISH, WEBHOOK_EXECUTION, APPCONTEXT_SET_USER_METADATA, APPCONTEXT_SET_CHANNEL_METADATA, APPCONTEXT_SET_MEMBERSHIP_METADATA.

description string OPTIONAL

Optional description of the action (max 200 characters).

name string

Name for the action (1-50 characters).

template object OPTIONAL

Action template structure. Format depends on actionType.

note string OPTIONAL

Additional notes (max 2,048 characters).

businessObject (circular) OPTIONAL

Associated business object details.

metric (circular) OPTIONAL

Associated metric details.

query (circular) OPTIONAL

Associated query details.

customer object OPTIONAL

Associated OEM customer for this decision.

id string

Your unique customer ID for OEM partners (requires Partner Portal).

name string

Customer name.

400

Invalid request parameters or query cannot have decision created

404

Query not found

* required
PubNub-Version*
Type: string
Possible values: [2026-02-09]
name
Type: string
1-50 chars
description
Type: string
≤ 200 chars
configurationType
Type: string
≤ 50 chars
customerId
Type: string
nullable
createdAt
Type: string
Creation timestamp (ISO 8601, UTC).
Format: date-time
updatedAt
Type: string
Last update timestamp (ISO 8601, UTC).
Format: date-time
createdBy
Type: string
nullableEmail of the creator.
updatedBy
Type: string
nullableEmail of the last updater.
id
Type: string
PubNub-generated unique ID for the decision. Required in later requests to update, delete, or retrieve this decision.
name
Type: string
Decision name (1-50 characters).
description
Type: string
Description (max 200 characters).
accountId
Type: string
Your PubNub account ID.
businessObjectId
Type: string
ID of the associated business object.
sourceType
Type: string
Decision source type: BUSINESSOBJECT or METRIC.
Enum (3 values)
View all values
"BUSINESSOBJECT""METRIC""QUERY"
sourceId
Type: string
ID of the metric or business object used as the data source.
hitType
Type: string
Rule matching behavior: SINGLE (stop at first match) or MULTIPLE (evaluate all rules).
Enum (2 values)
View all values
"SINGLE""MULTI"
enabled
Type: boolean
Whether decision is active (default: false). Must be false when creating a decision.
activeFrom
Type: string
Start date/time for activation (ISO 8601, UTC).
Format: date-time
activeUntil
Type: string
End date/time for deactivation (ISO 8601, UTC).
Format: date-time
executeOnce
Type: boolean
Execute actions only once when conditions are satisfied for the first time.
executionFrequency
Type: number
Evaluation frequency in seconds. Allowed values: 60, 300, 600, 900, 1800, 3600, 86400.
inputFields
Type: array
Input fields for decision conditions. Required if sourceType is BUSINESSOBJECT.
Array items:
items
Type: object
outputFields
Type: array
Custom variables for use in actions.
Array items:
items
Type: object
rules
Type: array
Decision rules containing conditions and actions.
Array items:
items
Type: object
actions
Type: array
Available actions for rules to execute.
Array items:
items
Type: object
businessObject
Type: any
Associated business object details.
metric
Type: any
Associated metric details.
query
Type: any
Associated query details.
customer
Type: object
nullableAssociated OEM customer for this decision.