---
title: "Add preset IP range to group"
type: reference
method: POST
path: /rest-api/preset-ip-ranges/ip-range/add.do
tag: "Targeting Rules"
---

# Add preset IP range to group

`POST https://YOUR-NETWORK-DOMAIN/rest-api/preset-ip-ranges/ip-range/add.do`

Adds a single IP address range to the specified preset IP ranges group. Both from and to values must be valid IPv4 addresses. The group must exist or a 404 error is returned. Returns the created IP range object as JSON. Requires PRESET_DOMAIN_GROUP_MANAGEMENT permission. The action is recorded in the audit log.

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `groupId` | integer | yes | `100` | Unique numeric ID of the preset IP ranges group to add the range to |
| `from` | string | yes | `192.168.1.0` | Start IPv4 address of the range (e.g., 192.168.1.0) |
| `to` | string | yes | `192.168.1.255` | End IPv4 address of the range (e.g., 192.168.1.255) |

## Responses

- `200` — Success
- `400` — Missing required parameter
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Preset group not found
- `500` — Internal server error

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/preset-ip-ranges/ip-range/add.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'groupId=100' \
  --data-urlencode 'from=192.168.1.0' \
  --data-urlencode 'to=192.168.1.255'
```

Source: https://epom.com/ad-server/docs/api/targeting-rules/post-preset-ip-ranges-ip-range-add