> ## 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.

# Create IP Group

> Creates a new IP Group. IP Groups allow you to group multiple IP addresses or CIDR ranges together for use in policies. The group is created empty (no IPs); use Add IPs endpoint to add IPs.

## Endpoint

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

## 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 |

### Request Body

#### Full JSON Body Example - Basic IP Group

```json theme={null}
{
  "name": "AllowedIPs",
  "description": "Allowed IP addresses for API access"
}
```

#### Full JSON Body Example - IP Group without Description

```json theme={null}
{
  "name": "BlockedIPs"
}
```

#### Request Body Fields

| Field       | Type   | Required | Default | Description                                      |
| ----------- | ------ | -------- | ------- | ------------------------------------------------ |
| name        | string | Yes      | -       | IP Group name (unique identifier within project) |
| description | string | No       | -       | IP Group description                             |

### Notes

* `name` must be unique within the project
* `name` must not be empty
* IP Group is created empty (no IPs)
* Use Add IPs endpoint to add IP addresses after creation

## Response

### Success Response (200 OK)

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

### Error Response (400 Bad Request)

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

or

```json theme={null}
{
  "error": "bad_request",
  "error_description": "An IP Group with same name (AllowedIPs) already exists in project!"
}
```

### Common Causes

* Missing or empty `name` field
* IP Group name already exists in project

## cURL Example

```bash theme={null}
curl -X POST \
  "https://demo.apinizer.com/apiops/projects/MyProject/ipGroups/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "AllowedIPs",
    "description": "Allowed IP addresses for API access"
  }'
```

## Notes and Warnings

* **Name Uniqueness**:
  * IP Group name must be unique within the project
  * If name already exists, creation will fail

* **Empty Group**:
  * IP Group is created empty (no IPs)
  * Use Add IPs endpoint to add IP addresses

## Permissions

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

## Related Documentation

* [Update IP Group](/api-reference/ip-groups/crud/update-ip-group) - Update an IP Group
* [Add IPs to Group](/api-reference/ip-groups/ips/add-ips-to-group) - Add IP addresses to group
