---
title: "Delete all campaign targeting rules"
type: reference
method: DELETE
path: /rest-api/campaign/{campaignId}/targetings.do
tag: "Targeting Rules"
---

# Delete all campaign targeting rules

`DELETE https://YOUR-NETWORK-DOMAIN/rest-api/campaign/{campaignId}/targetings.do`

Deletes every targeting rule of the campaign, or only those matching the optional type and rule filters. Nothing is deleted unless the caller holds the targeting permission of every matching rule's type. Targeting stays enabled. The response carries the number of deleted rules. Requires UPDATE permission on the campaign and MANAGE_DEMAND_TARGETING user permission.

## Path params

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

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `targetType` | string | no | `COUNTRY` | Optional targeting type filter — only rules of this type are deleted |
| `rule` | string | no | `EXCLUDE` | Optional rule filter — only INCLUDE or only EXCLUDE rules are deleted |

## Responses

- `200` — Success — the response carries the deleted count
- `400` — Unknown targeting type or rule
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Campaign not found
- `500` — Internal server error

## Example request

```bash
curl --request DELETE \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/campaign/1234/targetings.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'targetType=COUNTRY' \
  --data-urlencode 'rule=EXCLUDE'
```

Source: https://epom.com/ad-server/docs/api/targeting-rules/delete-campaign-targetings