| Schema — OPTIONAL |
|---|
createdAt date-time — OPTIONALCreation timestamp (ISO 8601, UTC). | updatedAt date-time — OPTIONALLast update timestamp (ISO 8601, UTC). | createdBy string — OPTIONAL | updatedBy string — OPTIONALEmail of the last updater. | id stringPubNub-generated unique ID for the decision. Required in later requests to update, delete, or retrieve this decision. | name stringDecision name (1-50 characters). | description string — OPTIONALDescription (max 200 characters). | accountId string | businessObjectId string — OPTIONALID of the associated business object. | sourceType string — OPTIONALPossible values: [BUSINESSOBJECT, METRIC, QUERY] Decision source type: BUSINESSOBJECT or METRIC. | sourceId string — OPTIONALID of the metric or business object used as the data source. | hitType stringPossible values: [SINGLE, MULTI] Rule matching behavior: SINGLE (stop at first match) or MULTIPLE (evaluate all rules). | enabled booleanWhether decision is active (default: false). Must be false when creating a decision. | activeFrom date-time — OPTIONALStart date/time for activation (ISO 8601, UTC). | activeUntil date-time — OPTIONALEnd date/time for deactivation (ISO 8601, UTC). | executeOnce booleanExecute actions only once when conditions are satisfied for the first time. | executionFrequency number — OPTIONALEvaluation frequency in seconds. Allowed values: 60, 300, 600, 900, 1800, 3600, 86400. | inputFields object[] — OPTIONALInput fields for decision conditions. Required if sourceType is BUSINESSOBJECT. id string — OPTIONALPubNub-generated unique ID for the input field. Required when creating or updating rules. | sourceType object — OPTIONALSource type for the input field. Use FIELD for BUSINESSOBJECT decisions. For METRIC decisions, this is auto-populated. | sourceId stringID of metric field/dimension to use as input or condition. References a field from the business object. | name stringLabel for the input field (1-50 characters). |
| outputFields object[] — OPTIONALCustom variables for use in actions. id string — OPTIONALPubNub-generated unique ID for the output field. | name stringLabel of the custom variable in the rules table (1-50 characters). | variable stringName of the custom variable used in action templates (1-50 characters). |
| rules object[] — OPTIONALDecision rules containing conditions and actions. id string — OPTIONALPubNub-generated unique ID for the rule. Required for updating rules directly. | inputValues object[]List of conditions to evaluate. operation stringPossible 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 — OPTIONALCondition 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 stringValue that your custom variable will send in actions (max 200 characters). |
| actionValues object[]Actions to trigger when conditions match. status booleanWhether action is active for this rule (true = execute when conditions satisfied, false = do not execute). | executionLimitType string — OPTIONALPossible 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 — OPTIONALExecution 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[] — OPTIONALField IDs for execution limits. Required if executionLimitType is ONCE_PER_INTERVAL_PER_CONDITION. | resetLimits boolean — OPTIONALWhen true, resets accumulated execution limits for this action when updating rules. |
|
| actions object[] — OPTIONALAvailable actions for rules to execute. id string — OPTIONALPubNub-generated unique ID for the action. Required when referencing an action in rules. | actionType string — OPTIONALPossible 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 — OPTIONALOptional description of the action (max 200 characters). | name stringName for the action (1-50 characters). | template object — OPTIONALAction template structure. Format depends on actionType. | note string — OPTIONALAdditional notes (max 2,048 characters). |
| businessObject (circular) — OPTIONALAssociated business object details. | metric (circular) — OPTIONALAssociated metric details. | query (circular) — OPTIONALAssociated query details. | customer object — OPTIONALAssociated OEM customer for this decision. id stringYour unique customer ID for OEM partners (requires Partner Portal). | name string |
|
|