# Update Rule

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

Visit the [conditional operators reference](/reference/communications-campaigns#conditional-operators-reference) for more information on how to use them.

See the [create rules](/reference/create-rules) endpoint for more examples.

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

Base URL: `https://api-sandbox.whitelabel.com/v1`

## Authorization

- public-api-key (apiKey in header)
- private-secret-key (apiKey in header)

## Path parameters

- `campaign_id` (string, required)
  The campaign identifier (UUID).
- `rule_id` (string, required)
  The rule identifier (UUID).

## Body

Content type: `application/json`

- `rule_type` (string)
  New rule type (see [Rule Types Reference](/reference/communications-campaigns#rule-types-reference))
- `values` (string[])
  New values array. Not required for `UNIQUE_BY_USER`.
- `conditional` (string)
  New comparison operator. Not required for `USER_COMMS_PER_DAY` or `UNIQUE_BY_USER`. See [Conditional Operators Reference](/reference/communications-campaigns#conditional-operators-reference).
- `metadata_key` (string)
  New metadata key. Required when `rule_type` is `METADATA`. The metadata field name to evaluate.

Example:

```json
{
  "rule_type": "string",
  "values": [
    "string"
  ],
  "conditional": "string",
  "metadata_key": "string"
}
```

## Responses

### 200