---
title: "Set how campaign targeting rule types combine"
type: reference
method: POST
path: /rest-api/campaign/{campaignId}/targeting/operation-between-rule-types.do
tag: "Targeting Rules"
---

# Set how campaign targeting rule types combine

`POST https://YOUR-NETWORK-DOMAIN/rest-api/campaign/{campaignId}/targeting/operation-between-rule-types.do`

Sets whether the campaign's rule types must all match (AND) or any one of them is enough (OR). Rules of the same type always combine with OR. Requires UPDATE permission on the campaign, MANAGE_DEMAND_TARGETING and MANAGE_OPERATION_BETWEEN_TARGETING_RULE_TYPES user permissions.

## Path params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `campaignId` | integer | yes | `1234` | Unique numeric ID of the campaign |

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `operator` | string | yes | `AND` | AND — every rule type must match; OR — any one rule type is enough |

## Responses

- `200` — Success — the response carries the saved operationBetweenRuleTypes
- `400` — Missing or unknown operator
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Campaign not found
- `500` — Internal server error

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/campaign/1234/targeting/operation-between-rule-types.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'operator=AND'
```

Source: https://epom.com/ad-server/docs/api/targeting-rules/post-campaign-targeting-operation-between-rule-types