---
title: "Upload preset IP ranges"
type: reference
method: POST
path: /rest-api/preset-ip-ranges/group/upload-ip-ranges.do
tag: "Targeting Rules"
---

# Upload preset IP ranges

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

Bulk-imports IP ranges into the specified preset IP ranges group from an uploaded file. The file should contain IP ranges in a supported format (one range per line). Returns a JSON object with import statistics including the number of processed records. Requires PRESET_DOMAIN_GROUP_MANAGEMENT permission. The action is recorded in the audit log.

## Query params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `groupId` | integer | yes | `100` | Unique numeric ID of the preset IP ranges group to import ranges into |

## Body

A multipart form: `file` (file).

## 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/group/upload-ip-ranges.do?groupId=100' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --form 'file=@data.csv'
```

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