Skip to content

User - RADIUS

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

Admin endpoints for RADIUS session management and monitoring. All endpoints require admin/staff authentication.


Online Sessions

Retrieve all currently active RADIUS sessions.

PropertyValue
EndpointOnline Sessions
MethodGET
URL/api/v1/radius/online-sessions
AuthenticationBearer Token

Request Headers:

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer your-auth-tokenYes

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "username": "subscriber001",
            "nas_ip": "192.168.1.1",
            "framed_ip": "10.0.0.5",
            "session_time": 3600,
            "input_octets": 1048576,
            "output_octets": 5242880,
            "start_time": "2024-01-15 09:30:00"
        }
    ],
    "total": 250
}

Session History

Retrieve session history for a specific subscriber.

PropertyValue
EndpointSession History
MethodGET
URL/api/v1/radius/session-history
AuthenticationBearer Token

Query Parameters:

ParameterTypeRequiredDescription
usernamestringYesSubscriber username
from_datedateNoStart date filter
to_datedateNoEnd date filter

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "session_id": "abc123",
            "start_time": "2024-01-15 09:30:00",
            "stop_time": "2024-01-15 10:30:00",
            "session_time": 3600,
            "input_octets": 1048576,
            "output_octets": 5242880,
            "terminate_cause": "User-Request"
        }
    ]
}

Get Subscriber Radcheck

Retrieve radcheck attributes for a subscriber.

PropertyValue
EndpointGet Radcheck
MethodGET
URL/api/v1/radius/radcheck/{username}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "attribute": "Cleartext-Password",
            "op": ":=",
            "value": "***hidden***"
        }
    ]
}

Get Subscriber Radreply

Retrieve radreply attributes for a subscriber.

PropertyValue
EndpointGet Radreply
MethodGET
URL/api/v1/radius/radreply/{username}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "attribute": "Framed-IP-Address",
            "op": ":=",
            "value": "10.0.0.5"
        }
    ]
}

Get Subscriber Radusergroup

Retrieve group membership for a subscriber.

PropertyValue
EndpointGet Radusergroup
MethodGET
URL/api/v1/radius/radusergroup/{username}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "groupname": "10MB-Package",
            "priority": 1
        }
    ]
}

Get Usage Stats

Retrieve bandwidth usage statistics for a subscriber.

PropertyValue
EndpointGet Usage Stats
MethodGET
URL/api/v1/radius/usage-stats/{username}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "data": {
        "total_download": "15.5 GB",
        "total_upload": "2.3 GB",
        "total_sessions": 45,
        "total_session_time": "120 hours",
        "current_month_download": "5.2 GB",
        "current_month_upload": "800 MB"
    }
}

Disconnect Session

Force disconnect a subscriber's live PPPoE / Hotspot session. Issues a real RADIUS Packet-of-Disconnect (CoA) to the NAS — not just a DB-level mark.

Updated in v2.22.26

The endpoint now sends a real CoA via RadiusServices so the subscriber is actually dropped on the NAS, not only flagged in radacct. The input contract is also updated: pass subscriber_id (preferred) or session_id.

PropertyValue
EndpointDisconnect Session
MethodPOST
URL/api/v1/radius/disconnect
AuthenticationBearer Token

Request Headers:

HeaderValueRequired
Acceptapplication/jsonYes
Content-Typeapplication/jsonYes
AuthorizationBearer your-auth-tokenYes

Request Body:

json
{
    "isp_id": 1,
    "branch_id": 1,
    "user_id": 5,
    "subscriber_id": 42
}
ParameterTypeRequiredDescription
isp_idintegerYesISP ID
branch_idintegerYesBranch ID
user_idintegerYesAction-by user ID (admin/staff)
subscriber_idintegerConditionalRequired if session_id is not provided
session_idstringConditionalRADIUS acctsessionid. Required if subscriber_id is not provided

Success Response (200 OK):

json
{
    "status": "success",
    "message": "Disconnect request sent successfully.",
    "data": {
        "subscriber_id": 42,
        "username": "subscriber001"
    }
}

Error Responses:

json
// 404 Not Found — subscriber or active session not found
{
    "status": "error",
    "message": "Subscriber not found."
}
json
// 409 Conflict — subscriber is not currently online
{
    "status": "error",
    "message": "Subscriber Not Online!"
}
json
// 422 Validation Error — neither subscriber_id nor session_id supplied
{
    "status": "error",
    "message": ["The subscriber id field is required when session id is not present."]
}

www.onezeroart.com