Create Rules

Creates one or more rules for a campaign. All active rules must pass for a payment to trigger the campaign (AND logic).

Visit the conditional operators reference for more information on how to use them.

POST/campaigns/{campaign_id}/rules

Path Parameters

campaign_idstringrequired

The campaign identifier (UUID).

Body application/json

rulesobject[]required

Array of rule objects

Show rules properties
rule_typestringrequired

Type of rule (see Rule Types Reference)

valuesstring[]

Array of string values for comparison. Not required for UNIQUE_BY_USER.

conditionalstring

Comparison operator. Not required for USER_COMMS_PER_DAY or UNIQUE_BY_USER. See Conditional Operators Reference.

metadata_keystring

Required when rule_type is METADATA. The metadata field name to evaluate.

Response

Created

dataobject[]
Show data properties
idstring
rule_typestring
valuesstring[]
conditionalstring
metadata_keystring
statusstring
created_atstring
updated_atstring
Request
curl -X POST "https://api-sandbox.whitelabel.com/v1/campaigns/<campaign_id>/rules" \
  -H "Content-Type: application/json" \
  -H "public-api-key: <public-api-key>" \
  -H "private-secret-key: <private-secret-key>" \
  -d '{
  "rules": [
    {
      "rule_type": "string",
      "values": [
        "string"
      ],
      "conditional": "string",
      "metadata_key": "string"
    }
  ]
}'
Response
{
  "data": [
    {
      "id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
      "rule_type": "PAYMENT_STATUS",
      "values": [
        "DECLINED"
      ],
      "conditional": "EQUAL",
      "metadata_key": null,
      "status": "ACTIVE",
      "created_at": "2025-07-01T12:05:00Z",
      "updated_at": "2025-07-01T12:05:00Z"
    }
  ]
}