Skip to content

User - IP Pools

Base URL: https://your-domain.com

Admin endpoints for managing IP address pools. All endpoints require admin/staff authentication.


Fetch All IP Pools

Retrieve all IP pools configured in the system.

PropertyValue
EndpointFetch All IP Pools
MethodGET
URL/api/v1/ip-pools
AuthenticationBearer Token

Request Headers:

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer your-auth-tokenYes

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "name": "Pool-A",
            "start_ip": "192.168.1.1",
            "end_ip": "192.168.1.254",
            "total_ips": 254,
            "used_ips": 150,
            "available_ips": 104
        }
    ]
}

Fetch IP Pool

Retrieve details of a specific IP pool.

PropertyValue
EndpointFetch IP Pool
MethodGET
URL/api/v1/ip-pools/{id}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "data": {
        "id": 1,
        "name": "Pool-A",
        "start_ip": "192.168.1.1",
        "end_ip": "192.168.1.254",
        "total_ips": 254,
        "used_ips": 150,
        "available_ips": 104
    }
}

Create IP Pool

Create a new IP address pool.

PropertyValue
EndpointCreate IP Pool
MethodPOST
URL/api/v1/ip-pools
AuthenticationBearer Token

Request Body:

json
{
    "isp_id": 1,
    "branch_id": 1,
    "user_id": 1,
    "name": "Pool-A",
    "start_ip": "192.168.1.1",
    "end_ip": "192.168.1.254"
}
ParameterTypeRequiredDescription
namestringYesPool name
start_ipstringYesStarting IP address
end_ipstringYesEnding IP address

Success Response (201 Created):

json
{
    "success": true,
    "message": "IP Pool created successfully",
    "data": {
        "id": 1
    }
}

Update IP Pool

Update an existing IP pool.

PropertyValue
EndpointUpdate IP Pool
MethodPUT
URL/api/v1/ip-pools/{id}
AuthenticationBearer Token

Request Body:

json
{
    "name": "Pool-Updated"
}

Success Response (200 OK):

json
{
    "success": true,
    "message": "IP Pool updated successfully"
}

Delete IP Pool

Delete an IP pool from the system.

PropertyValue
EndpointDelete IP Pool
MethodDELETE
URL/api/v1/ip-pools/{id}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "message": "IP Pool deleted successfully"
}

Generate IPs

Generate individual IP addresses from the pool range.

PropertyValue
EndpointGenerate IPs
MethodPOST
URL/api/v1/ip-pools/{id}/generate
AuthenticationBearer Token

Request Body:

json
{
    "isp_id": 1,
    "branch_id": 1,
    "user_id": 1
}

Success Response (200 OK):

json
{
    "success": true,
    "message": "IPs generated successfully",
    "data": {
        "generated": 254
    }
}

www.onezeroart.com