Ana içeriğe geç

Add IPs to Group

Endpoint

POST /apiops/projects/{projectName}/ipGroups/{ipGroupName}/ips/

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
ipGroupNamestringYesIP Group name

Request Body

Full JSON Body Example - Single IP Address

{
"ipList": [
"192.168.1.100"
]
}

Full JSON Body Example - Multiple IP Addresses

{
"ipList": [
"192.168.1.100",
"192.168.1.101",
"10.0.0.50"
]
}

Full JSON Body Example - IP Addresses and CIDR Ranges

{
"ipList": [
"192.168.1.100",
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16"
]
}

Request Body Fields

FieldTypeRequiredDefaultDescription
ipListarray[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)

{
"success": true
}

Error Response (400 Bad Request)

{
"error": "bad_request",
"error_description": "ipList value can not be empty!"
}

or

{
"error": "bad_request",
"error_description": "IP Group (AllowedIPs) is not found!"
}

cURL Example

Example 1: Add Single IP

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

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