Skip to content

User - Policies

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

Admin endpoints for managing RADIUS policies and attributes. All endpoints require admin/staff authentication.


Fetch All Policies

Retrieve all RADIUS policies configured in the system.

PropertyValue
EndpointFetch All Policies
MethodGET
URL/api/v1/policies
AuthenticationBearer Token

Request Headers:

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer your-auth-tokenYes

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "name": "Default Policy",
            "attribute_count": 5,
            "package_count": 3
        }
    ]
}

Fetch Policy

Retrieve details of a specific policy including its attributes.

PropertyValue
EndpointFetch Policy
MethodGET
URL/api/v1/policies/{id}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "data": {
        "id": 1,
        "name": "Default Policy",
        "attributes": [
            {
                "id": 1,
                "attribute": "Framed-Protocol",
                "op": ":=",
                "value": "PPP"
            }
        ]
    }
}

Create Policy

Create a new RADIUS policy.

PropertyValue
EndpointCreate Policy
MethodPOST
URL/api/v1/policies
AuthenticationBearer Token

Request Body:

json
{
    "isp_id": 1,
    "branch_id": 1,
    "user_id": 1,
    "name": "Default Policy"
}

Success Response (201 Created):

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

Update Policy

Update an existing policy.

PropertyValue
EndpointUpdate Policy
MethodPUT
URL/api/v1/policies/{id}
AuthenticationBearer Token

Request Body:

json
{
    "name": "Updated Policy"
}

Success Response (200 OK):

json
{
    "success": true,
    "message": "Policy updated successfully"
}

Delete Policy

Delete a policy from the system.

PropertyValue
EndpointDelete Policy
MethodDELETE
URL/api/v1/policies/{id}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "message": "Policy deleted successfully"
}

Policy Attributes

Manage RADIUS attributes within a policy.


Fetch Policy Attributes

Retrieve all attributes for a specific policy.

PropertyValue
EndpointFetch Policy Attributes
MethodGET
URL/api/v1/policies/{id}/attributes
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "attribute": "Framed-Protocol",
            "op": ":=",
            "value": "PPP"
        }
    ]
}

Create Policy Attribute

Add a new attribute to a policy.

PropertyValue
EndpointCreate Policy Attribute
MethodPOST
URL/api/v1/policies/{id}/attributes
AuthenticationBearer Token

Request Body:

json
{
    "isp_id": 1,
    "branch_id": 1,
    "user_id": 1,
    "attribute": "Framed-Protocol",
    "op": ":=",
    "value": "PPP"
}
ParameterTypeRequiredDescription
attributestringYesRADIUS attribute name
opstringYesOperator (:=, ==, !=, etc.)
valuestringYesAttribute value

Success Response (201 Created):

json
{
    "success": true,
    "message": "Attribute added successfully"
}

Update Policy Attribute

Update an existing policy attribute.

PropertyValue
EndpointUpdate Policy Attribute
MethodPUT
URL/api/v1/policies/{id}/attributes/{attr_id}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "message": "Attribute updated successfully"
}

Delete Policy Attribute

Remove an attribute from a policy.

PropertyValue
EndpointDelete Policy Attribute
MethodDELETE
URL/api/v1/policies/{id}/attributes/{attr_id}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "message": "Attribute deleted successfully"
}

www.onezeroart.com