> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add IPs to Group

> Adds IP addresses or CIDR ranges to an existing IP Group. IPs are added to the existing list (duplicates are ignored).

## Endpoint

```plaintext theme={null}
POST /apiops/projects/{projectName}/ipGroups/{ipGroupName}/ips/
```

## Authentication

Requires a Personal API Access Token.

### Header

```plaintext theme={null}
Authorization: Bearer YOUR_TOKEN
```

## Request

### Headers

| Header        | Value            | Required |
| ------------- | ---------------- | -------- |
| Authorization | Bearer {token}   | Yes      |
| Content-Type  | application/json | Yes      |

### Path Parameters

| Parameter   | Type   | Required | Description   |
| ----------- | ------ | -------- | ------------- |
| projectName | string | Yes      | Project name  |
| ipGroupName | string | Yes      | IP Group name |

### Request Body

#### Full JSON Body Example - Single IP Address

```json theme={null}
{
  "ipList": [
    "192.168.1.100"
  ]
}
```

#### Full JSON Body Example - Multiple IP Addresses

```json theme={null}
{
  "ipList": [
    "192.168.1.100",
    "192.168.1.101",
    "10.0.0.50"
  ]
}
```

#### Full JSON Body Example - IP Addresses and CIDR Ranges

```json theme={null}
{
  "ipList": [
    "192.168.1.100",
    "10.0.0.0/8",
    "172.16.0.0/12",
    "192.168.0.0/16"
  ]
}
```

#### Request Body Fields

| Field  | Type           | Required | Default | Description                                |
| ------ | -------------- | -------- | ------- | ------------------------------------------ |
| ipList | array\[string] | Yes      | -       | List of IP addresses or CIDR ranges to add |

### IP Address Formats

* Individual IP addresses: `192.168.1.100`
* CIDR ranges: `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`
* IPv4 format only

### Notes

* `ipList` must not be empty
* IPs are added to the existing list
* Duplicate IPs are ignored (not added twice)
* IP addresses and CIDR ranges can be mixed

## Response

### Success Response (200 OK)

```json theme={null}
{
  "success": true
}
```

### Error Response (400 Bad Request)

```json theme={null}
{
  "error": "bad_request",
  "error_description": "ipList value can not be empty!"
}
```

or

```json theme={null}
{
  "error": "bad_request",
  "error_description": "IP Group (AllowedIPs) is not found!"
}
```

## cURL Example

### Example 1: Add Single IP

```bash theme={null}
curl -X POST \
  "https://demo.apinizer.com/apiops/projects/MyProject/ipGroups/AllowedIPs/ips/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ipList": [
      "192.168.1.100"
    ]
  }'
```

### Example 2: Add Multiple IPs and CIDR Ranges

```bash theme={null}
curl -X POST \
  "https://demo.apinizer.com/apiops/projects/MyProject/ipGroups/AllowedIPs/ips/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ipList": [
      "192.168.1.100",
      "10.0.0.0/8",
      "172.16.0.0/12"
    ]
  }'
```

## Notes and Warnings

* **IP List Required**:
  * `ipList` must not be empty
  * At least one IP must be provided

* **Duplicate Handling**:
  * Duplicate IPs are ignored (not added twice)
  * No error is thrown for duplicates

* **IP Format**:
  * Supports IPv4 addresses and CIDR ranges
  * Invalid formats may cause errors

* **Group Must Exist**:
  * IP Group must exist before adding IPs

## Permissions

* User must have **`GLOBAL_SETTINGS` + `MANAGE`** permission in the project

## Related Documentation

* [Update IPs in Group](/api-reference/ip-groups/ips/update-ips-in-group) - Replace all IPs in group
* [Delete IPs from Group](/api-reference/ip-groups/ips/delete-ips-from-group) - Remove IPs from group
* [Create IP Group](/api-reference/ip-groups/crud/create-ip-group) - Create a new IP Group
