---
title: "Save zone screen-size ranges in one call"
type: reference
method: POST
path: /rest-api/zone/{zoneId}/targeting/screen-resolution/save-ranges.do
tag: "Targeting Rules"
---

# Save zone screen-size ranges in one call

`POST https://YOUR-NETWORK-DOMAIN/rest-api/zone/{zoneId}/targeting/screen-resolution/save-ranges.do`

Saves one to 20 screen-size ranges as INCLUDE or EXCLUDE rules of the specified zone and deletes the screen-resolution rules listed in replaceIds, in one transaction: when a range is unusable, a replaceIds entry is not a screen-resolution rule of this zone, or a permission is missing, nothing is saved and nothing is deleted. Each range is one rule; its limits are inclusive whole pixels from 1 to 9999 and a limit left out is open, so {"rule":"INCLUDE","ranges":[{"maxWidth":767},{"minWidth":1440}]} targets screens up to 767 or from 1440 px wide. A range equal to a stored rule keeps that rule, including a replaced one. Switches the zone's targeting on if it was off. The answer lists the saved rules in targets and the deleted rule ids in replaced, with a warning when a saved rule is now targeted both ways. Requires UPDATE permission on the zone, MANAGE_SUPPLY_PRE_TARGETING user permission and PRETARGETING_RESOLUTION.

## Path params

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

## Body

A JSON body. An example, built from the field definitions:

```json
{
  "rule": "INCLUDE"
}
```

## Responses

- `200` — Success — the answer carries targets and replaced
- `400` — rule or ranges missing, or a range unusable — nothing changed
- `401` — Unauthorized
- `403` — Forbidden — nothing changed
- `404` — Zone not found, or a replaceIds entry is not one of its screen-resolution rules — nothing changed
- `500` — Internal server error

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/zone/200/targeting/screen-resolution/save-ranges.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "rule": "INCLUDE"
}'
```

Source: https://epom.com/ad-server/docs/api/targeting-rules/post-zone-targeting-screen-resolution-save-ranges