Update Rule

Updates a rule’s type, values, conditional, or metadata key.

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

See the create rules endpoint for more examples.

PATCH/campaigns/{campaign_id}/rules/{rule_id}

Path Parameters

campaign_idstringrequired

The campaign identifier (UUID).

rule_idstringrequired

The rule identifier (UUID).

Body application/json

rule_typestring

New rule type (see Rule Types Reference)

valuesstring[]

New values array. Not required for UNIQUE_BY_USER.

conditionalstring

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

metadata_keystring

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

Response

Request
curl -X PATCH "https://api-sandbox.whitelabel.com/v1/campaigns/<campaign_id>/rules/<rule_id>" \
  -H "Content-Type: application/json" \
  -H "public-api-key: <public-api-key>" \
  -H "private-secret-key: <private-secret-key>" \
  -d '{
  "rule_type": "string",
  "values": [
    "string"
  ],
  "conditional": "string",
  "metadata_key": "string"
}'
Response
(no body)