---
title: "Set how zone targeting rules of one type combine"
type: reference
method: POST
path: /rest-api/zone/{zoneId}/targeting/match-mode.do
tag: "Targeting Rules"
---

# Set how zone targeting rules of one type combine

`POST https://YOUR-NETWORK-DOMAIN/rest-api/zone/{zoneId}/targeting/match-mode.do`

Sets how the zone's Include or Exclude list of one targeting type combines, for the types a visitor can hold several values of: COOKIE_VALUE, CUSTOM, DMP and API_JSON_FIELD. A list splits into groups: the rules on one key a visitor holds once (one cookie name, one custom parameter) are alternatives, and every other rule (a DMP segment, an API JSON field, a custom parameter registered as a list, an expression) is a group of its own. ANY (the default) — an Include list passes when any group matches, an Exclude list keeps out a visitor matching any group. ALL — an Include list passes only when every group matches, an Exclude list keeps out only a visitor matching every group: tier=gold, tier=silver and region=eu under ALL read (tier = gold or silver) and (region = eu). Every rule of the list takes the mode, and a rule created later joins its list's mode. The response carries a warning when the switch leaves a value both included and excluded, at this level or against a level above. Requires UPDATE permission on the zone's site, MANAGE_SUPPLY_PRE_TARGETING and the type's own targeting permission (e.g. PRETARGETING_COOKIE_VALUE).

## Path params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `zoneId` | integer | yes | `200` | Unique numeric ID of the zone |

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `type` | string | yes | `COOKIE_VALUE` | Targeting type whose list to set — COOKIE_VALUE, CUSTOM, DMP or API_JSON_FIELD |
| `rule` | string | yes | `INCLUDE` | Which list to set — INCLUDE or EXCLUDE |
| `matchMode` | string | yes | `ALL` | ANY — one group is enough; ALL — every group must match |

## Responses

- `200` — Success — the response carries the type, the rule, the saved matchMode, how many rules changed (updated) and, when a value is now both included and excluded, a warning
- `400` — Missing or unknown type, rule or matchMode, a type without a match mode, or no rules of that type in that list
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Zone not found
- `500` — Internal server error

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/zone/200/targeting/match-mode.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'type=COOKIE_VALUE' \
  --data-urlencode 'rule=INCLUDE' \
  --data-urlencode 'matchMode=ALL'
```

Source: https://epom.com/ad-server/docs/api/targeting-rules/post-zone-targeting-match-mode