Skip to content

User - Bandwidth Allocations

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

Admin endpoints for managing bandwidth allocations/profiles. All endpoints require admin/staff authentication.


Fetch All Bandwidth Allocations

Retrieve all bandwidth profiles configured in the system.

PropertyValue
EndpointFetch All Bandwidth Allocations
MethodGET
URL/api/v1/bandwidth-allocations
AuthenticationBearer Token

Request Headers:

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer your-auth-tokenYes

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "name": "50Mbps",
            "upload": 50,
            "download": 50,
            "upload_unit": "M",
            "download_unit": "M",
            "package_count": 5
        }
    ]
}

Fetch Bandwidth Allocation

Retrieve details of a specific bandwidth profile.

PropertyValue
EndpointFetch Bandwidth Allocation
MethodGET
URL/api/v1/bandwidth-allocations/{id}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "data": {
        "id": 1,
        "name": "50Mbps",
        "upload": 50,
        "download": 50,
        "upload_unit": "M",
        "download_unit": "M"
    }
}

Create Bandwidth Allocation

Create a new bandwidth profile.

PropertyValue
EndpointCreate Bandwidth Allocation
MethodPOST
URL/api/v1/bandwidth-allocations
AuthenticationBearer Token

Request Body:

json
{
    "isp_id": 1,
    "branch_id": 1,
    "user_id": 1,
    "name": "50Mbps",
    "upload": 50,
    "download": 50,
    "upload_unit": "M",
    "download_unit": "M"
}
ParameterTypeRequiredDescription
namestringYesProfile name
uploadintegerYesUpload speed value
downloadintegerYesDownload speed value
upload_unitstringYesUpload unit (K, M, G)
download_unitstringYesDownload unit (K, M, G)

Success Response (201 Created):

json
{
    "success": true,
    "message": "Bandwidth allocation created successfully",
    "data": {
        "id": 1
    }
}

Update Bandwidth Allocation

Update an existing bandwidth profile.

PropertyValue
EndpointUpdate Bandwidth Allocation
MethodPUT
URL/api/v1/bandwidth-allocations/{id}
AuthenticationBearer Token

Request Body:

json
{
    "name": "100Mbps",
    "upload": 100,
    "download": 100
}

Success Response (200 OK):

json
{
    "success": true,
    "message": "Bandwidth allocation updated successfully"
}

Delete Bandwidth Allocation

Delete a bandwidth profile.

PropertyValue
EndpointDelete Bandwidth Allocation
MethodDELETE
URL/api/v1/bandwidth-allocations/{id}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "message": "Bandwidth allocation deleted successfully"
}

www.onezeroart.com