---
title: "Remove stale location targeting"
type: reference
method: POST
path: /rest-api/targeting/stale-locations/remove.do
tag: "Targeting Rules"
---

# Remove stale location targeting

`POST https://YOUR-NETWORK-DOMAIN/rest-api/targeting/stale-locations/remove.do`

Removes the listed rules that are still stale and that the user may manage, one by one, each with an action log entry; the ad servers pick the change up as after any targeting edit. Each rule carries 'kind': SAFE - removing it changes nothing, the ad server already ignores it (a valid include of the same type sits beside it, or it is a country exclude); OPENS_ALL - it is among the entity's only includes of its type, which keep every visitor out today, and removing them lifts the location limit altogether; STARTS_DELIVERY - a location exclude that keeps every visitor out today, so removing it starts delivery to everyone else. A rule of kind OPENS_ALL or STARTS_DELIVERY changes delivery, so it is removed only with confirmChanges=true; without it, it comes back in 'skipped' with reason CONFIRM_REQUIRED. Other reasons: NOT_STALE (not a stale rule the user may manage, or removed meanwhile), FORBIDDEN.

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `targetIds` | array<integer> | yes | `8012` | Ids of the stale rules to remove, as the list answers them |
| `confirmChanges` | boolean | no | `false` | Also remove rules whose removal changes delivery (OPENS_ALL, STARTS_DELIVERY) |

## Responses

- `200` — {success, removed:[targetId], skipped:[{targetId, reason, message}]}
- `400` — Bad request — invalid or missing parameters
- `401` — Authentication error
- `403` — The role lacks both MANAGE_DEMAND_TARGETING and MANAGE_SUPPLY_PRE_TARGETING
- `503` — The geo service did not answer, so staleness could not be checked; nothing was removed

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/targeting/stale-locations/remove.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'targetIds=8012' \
  --data-urlencode 'confirmChanges=false'
```

Source: https://epom.com/ad-server/docs/api/targeting-rules/post-targeting-stale-locations-remove