Create Address Objects
Creates multiple address objects in a specified address group in a single request. Each item is validated individually, and items that fail validation appear in the failures field of the response with their reasons.
Required Permissions
Available to users with the Admin role or higher.
HTTP Request
POST /api/sonar/address-groups/:guid/addresses/bulk
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-X POST \
-d '{
"records": [
{ "address": "8.8.8.8", "description": "Public DNS", "period": 60 },
{ "address": "1.1.1.1", "description": "Cloudflare DNS" }
]
}' \
https://HOSTNAME/api/sonar/address-groups/4dc14f3d-ebf8-4032-8a7a-ef9ec6cd3dd2/addresses/bulk
Request Parameters
Path Parameters
| Key | Type | Description | Note |
|---|---|---|---|
| guid | String | Address group GUID | 36 characters |
Request Body Parameters
| Key | Required | Type | Description | Note |
|---|---|---|---|---|
| records | O | Array of objects | Address objects | See Create Address Object for fields |
Each records entry has the following fields:
- address (String, required): IP address
- description (String): Description. Up to 255 characters
- period (Integer): Retention period in minutes. Minimum 1, maximum 52,560,000
Success Response
All items succeeded
{
"failures": []
}
Some items failed
The HTTP status is 200, but result is set to false.
{
"failures": [
{
"id": "256.255.255.255",
"reason": "invalid-ipv4-address"
}
],
"result": false,
"error_msg": "invalid-records"
}
- failures (Array): Items that failed validation and were not registered
- id (String): Identifier of the failed item (IP address or input value)
- reason (String): Failure reason code
- result (Boolean): Indicates partial failure. Omitted when all items succeed
- error_msg (String):
invalid-recordswhen partial failures occur
Error Responses
Required argument is missing
HTTP status code 400
{
"error_code": "null-argument",
"error_msg": "records should be not null"
}
Invalid GUID format
HTTP status code 400
{
"error_code": "invalid-param-type",
"error_msg": "guid should be guid type."
}
Address group does not exist
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "address group not found: ede06992-dd57-4b79-8c54-a295f33d8613"
}
Permission denied
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "no-permission"
}