Appearance
User - RADIUS
Base URL:
https://your-domain.com
Staff endpoints for RADIUS sessions and attributes: online sessions, session history, a subscriber's radcheck / radreply / radusergroup rows, usage totals and disconnect.
The RADIUS tables carry no ISP or branch of their own, so every endpoint ties a session or a username to a subscriber of your ISP and branch, and to the subscribers you may see: Admin and Super admin see every subscriber of the branch, admin staff the subscribers of the resellers their role manages plus the admin's own, and resellers (and their staff) only their own tree. See What each user sees.
Only Disconnect Session needs a module permission (subscriber_disconnect) for non-admin users; the read endpoints need only api_access.
Online Sessions
Retrieve the sessions that are online now (acctstoptime is empty), newest first.
| Property | Value |
|---|---|
| Endpoint | Online Sessions |
| Method | GET |
| URL | /api/v1/radius/online-sessions |
| Authentication | Bearer Token |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer your-auth-token | Yes |
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
isp_id | integer | Yes | ISP ID |
branch_id | integer | Yes | Branch ID |
user_id | integer | Yes | Your user ID |
search | string | No | Partial match on the username, the framed IP address or the calling station ID (MAC) |
nas_id | integer | No | Only sessions on this NAS |
per_page | integer | No | Sessions per page, 1 to 100 (default: 25) |
page | integer | No | Page number (default: 1) |
Request Body: None
Success Response (200 OK):
json
{
"status": "success",
"data": {
"sessions": [
{
"radacctid": 884213,
"acctsessionid": "81a00c4f",
"acctuniqueid": "6f1e0b3c2a9d4e7f8a1b2c3d4e5f6a7b",
"username": "rahim.uttara",
"realm": "",
"nasipaddress": "10.10.0.1",
"nasportid": "vlan120",
"nasporttype": "Ethernet",
"acctstarttime": "2026-10-24 08:12:03",
"acctupdatetime": "2026-10-24 10:12:03",
"acctstoptime": null,
"acctinterval": 300,
"acctsessiontime": 7200,
"acctauthentic": "RADIUS",
"connectinfo_start": "",
"connectinfo_stop": null,
"acctinputoctets": 182736451,
"acctoutputoctets": 2469606195,
"calledstationid": "pppoe-server-1",
"callingstationid": "A4:2B:B0:7C:19:E2",
"acctterminatecause": "",
"servicetype": "Framed-User",
"framedprotocol": "PPP",
"framedipaddress": "100.64.12.45",
"framedipv6address": "",
"framedipv6prefix": "",
"framedinterfaceid": "",
"delegatedipv6prefix": "",
"class": null,
"subscriber_data": {
"id": 1532,
"username": "rahim.uttara",
"fullname": "Abdur Rahim",
"phone": "01712345678"
}
}
],
"total_online": 412,
"pagination": {
"current_page": 1,
"per_page": 25,
"total": 412,
"last_page": 17
}
}
}| Field | Description |
|---|---|
sessions | The radacct rows of this page, with the subscriber's id, username, fullname and phone in subscriber_data |
total_online | All sessions online now that you may see, ignoring search and nas_id |
pagination.total | Sessions matching the filters |
acctinputoctets / acctoutputoctets | Bytes uploaded / downloaded by the subscriber in this session |
Error Response (422 Validation Error):
json
{
"status": "error",
"message": ["The per page field must not be greater than 100."]
}Error Response (500 Server Error):
json
{
"status": "error",
"message": "Failed to fetch sessions."
}Code Examples:
bash
curl -X GET "https://your-domain.com/api/v1/radius/online-sessions?isp_id=1&branch_id=1&user_id=1&search=john&per_page=25" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token"php
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://your-domain.com']);
$response = $client->request('GET', '/api/v1/radius/online-sessions', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-auth-token',
],
'query' => [
'isp_id' => 1,
'branch_id' => 1,
'user_id' => 1,
'search' => 'john',
'per_page' => 25,
],
]);
$data = json_decode($response->getBody(), true);
print_r($data);javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';
const params = new URLSearchParams({
isp_id: 1,
branch_id: 1,
user_id: 1,
search: 'john',
per_page: 25,
});
const response = await fetch(`${BASE_URL}/api/v1/radius/online-sessions?${params}`, {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: `Bearer ${TOKEN}`,
},
});
const data = await response.json();
console.log(data);python
import requests
BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"
response = requests.get(
f"{BASE_URL}/api/v1/radius/online-sessions",
headers={
"Accept": "application/json",
"Authorization": f"Bearer {TOKEN}",
},
params={
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"search": "john",
"per_page": 25,
},
)
data = response.json()
print(data)go
package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
const baseURL = "https://your-domain.com"
const token = "your-auth-token"
func main() {
endpoint := baseURL + "/api/v1/radius/online-sessions"
q := url.Values{}
q.Set("isp_id", "1")
q.Set("branch_id", "1")
q.Set("user_id", "1")
q.Set("search", "john")
q.Set("per_page", "25")
endpoint += "?" + q.Encode()
req, _ := http.NewRequest("GET", endpoint, nil)
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(body))
}rust
use reqwest::Client;
const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let response = client
.get(format!("{BASE_URL}/api/v1/radius/online-sessions"))
.header("Accept", "application/json")
.bearer_auth(TOKEN)
.query(&[
("isp_id", "1"),
("branch_id", "1"),
("user_id", "1"),
("search", "john"),
("per_page", "25"),
])
.send()
.await?;
let data: serde_json::Value = response.json().await?;
println!("{data:#}");
Ok(())
}Session History
Retrieve finished sessions (acctstoptime is set), newest first.
| Property | Value |
|---|---|
| Endpoint | Session History |
| Method | GET |
| URL | /api/v1/radius/session-history |
| Authentication | Bearer Token |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer your-auth-token | Yes |
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
isp_id | integer | Yes | ISP ID |
branch_id | integer | Yes | Branch ID |
user_id | integer | Yes | Your user ID |
username | string | No | Only this subscriber's sessions (exact username). A subscriber you may not see gives an empty list |
date_from | date | No | Sessions that started on or after this date (YYYY-MM-DD) |
date_to | date | No | Sessions that started on or before this date (YYYY-MM-DD) |
per_page | integer | No | Sessions per page, 1 to 100 (default: 25) |
page | integer | No | Page number (default: 1) |
Request Body: None
Success Response (200 OK):
json
{
"status": "success",
"data": {
"sessions": [
{
"radacctid": 880017,
"acctsessionid": "81a00b12",
"acctuniqueid": "0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f",
"username": "rahim.uttara",
"realm": "",
"nasipaddress": "10.10.0.1",
"nasportid": "vlan120",
"nasporttype": "Ethernet",
"acctstarttime": "2026-10-23 19:40:11",
"acctupdatetime": "2026-10-24 07:55:11",
"acctstoptime": "2026-10-24 08:01:37",
"acctinterval": 300,
"acctsessiontime": 44486,
"acctauthentic": "RADIUS",
"connectinfo_start": "",
"connectinfo_stop": "",
"acctinputoctets": 734002187,
"acctoutputoctets": 9126805504,
"calledstationid": "pppoe-server-1",
"callingstationid": "A4:2B:B0:7C:19:E2",
"acctterminatecause": "Lost-Carrier",
"servicetype": "Framed-User",
"framedprotocol": "PPP",
"framedipaddress": "100.64.12.45",
"framedipv6address": "",
"framedipv6prefix": "",
"framedinterfaceid": "",
"delegatedipv6prefix": "",
"class": null
}
],
"pagination": {
"current_page": 1,
"per_page": 25,
"total": 1,
"last_page": 1
}
}
}Error Response (422 Validation Error):
json
{
"status": "error",
"message": ["The date from field must be a valid date."]
}Error Response (500 Server Error):
json
{
"status": "error",
"message": "Failed to fetch session history."
}Code Examples:
bash
curl -X GET "https://your-domain.com/api/v1/radius/session-history?isp_id=1&branch_id=1&user_id=1&per_page=25&page=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token"php
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://your-domain.com']);
$response = $client->request('GET', '/api/v1/radius/session-history', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-auth-token',
],
'query' => [
'isp_id' => 1,
'branch_id' => 1,
'user_id' => 1,
'per_page' => 25,
'page' => 1,
],
]);
$data = json_decode($response->getBody(), true);
print_r($data);javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';
const params = new URLSearchParams({
isp_id: 1,
branch_id: 1,
user_id: 1,
per_page: 25,
page: 1,
});
const response = await fetch(`${BASE_URL}/api/v1/radius/session-history?${params}`, {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: `Bearer ${TOKEN}`,
},
});
const data = await response.json();
console.log(data);python
import requests
BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"
response = requests.get(
f"{BASE_URL}/api/v1/radius/session-history",
headers={
"Accept": "application/json",
"Authorization": f"Bearer {TOKEN}",
},
params={
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"per_page": 25,
"page": 1,
},
)
data = response.json()
print(data)go
package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
const baseURL = "https://your-domain.com"
const token = "your-auth-token"
func main() {
endpoint := baseURL + "/api/v1/radius/session-history"
q := url.Values{}
q.Set("isp_id", "1")
q.Set("branch_id", "1")
q.Set("user_id", "1")
q.Set("per_page", "25")
q.Set("page", "1")
endpoint += "?" + q.Encode()
req, _ := http.NewRequest("GET", endpoint, nil)
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(body))
}rust
use reqwest::Client;
const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let response = client
.get(format!("{BASE_URL}/api/v1/radius/session-history"))
.header("Accept", "application/json")
.bearer_auth(TOKEN)
.query(&[
("isp_id", "1"),
("branch_id", "1"),
("user_id", "1"),
("per_page", "25"),
("page", "1"),
])
.send()
.await?;
let data: serde_json::Value = response.json().await?;
println!("{data:#}");
Ok(())
}Get Subscriber Radcheck
Retrieve a subscriber's radcheck rows (password, expiration, simultaneous use and other check attributes).
WARNING
The rows are returned as stored, the Cleartext-Password value included. Keep this answer private.
| Property | Value |
|---|---|
| Endpoint | Get Radcheck |
| Method | GET |
| URL | /api/v1/radius/radcheck/{username} |
| Authentication | Bearer Token |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer your-auth-token | Yes |
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Subscriber username |
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
isp_id | integer | Yes | ISP ID |
branch_id | integer | Yes | Branch ID |
user_id | integer | Yes | Your user ID |
Request Body: None
Success Response (200 OK):
json
{
"status": "success",
"data": {
"radcheck": [
{
"id": 50211,
"username": "rahim.uttara",
"attribute": "Cleartext-Password",
"op": ":=",
"value": "rahim@2026"
},
{
"id": 50212,
"username": "rahim.uttara",
"attribute": "Expiration",
"op": ":=",
"value": "05 Nov 2026 23:59:59"
},
{
"id": 50213,
"username": "rahim.uttara",
"attribute": "Simultaneous-Use",
"op": ":=",
"value": "1"
}
]
}
}Error Response (403 Forbidden):
Returned when the subscriber is in your ISP and branch but not one you may see (another reseller's subscriber).
json
{
"status": "error",
"message": "Oops! Insufficient Permission"
}Error Response (404 Not Found):
Returned when no subscriber of your ISP and branch has this username.
json
{
"status": "error",
"message": "Subscriber not found."
}Code Examples:
bash
curl -X GET "https://your-domain.com/api/v1/radius/radcheck/subscriber001?isp_id=1&branch_id=1&user_id=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token"php
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://your-domain.com']);
$username = 'subscriber001';
$response = $client->request('GET', "/api/v1/radius/radcheck/{$username}", [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-auth-token',
],
'query' => [
'isp_id' => 1,
'branch_id' => 1,
'user_id' => 1,
],
]);
$data = json_decode($response->getBody(), true);
print_r($data);javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';
const username = "subscriber001";
const params = new URLSearchParams({
isp_id: 1,
branch_id: 1,
user_id: 1,
});
const response = await fetch(`${BASE_URL}/api/v1/radius/radcheck/${username}?${params}`, {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: `Bearer ${TOKEN}`,
},
});
const data = await response.json();
console.log(data);python
import requests
BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"
username = "subscriber001"
response = requests.get(
f"{BASE_URL}/api/v1/radius/radcheck/{username}",
headers={
"Accept": "application/json",
"Authorization": f"Bearer {TOKEN}",
},
params={
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
},
)
data = response.json()
print(data)go
package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
const baseURL = "https://your-domain.com"
const token = "your-auth-token"
func main() {
username := "subscriber001"
endpoint := baseURL + "/api/v1/radius/radcheck/" + username
q := url.Values{}
q.Set("isp_id", "1")
q.Set("branch_id", "1")
q.Set("user_id", "1")
endpoint += "?" + q.Encode()
req, _ := http.NewRequest("GET", endpoint, nil)
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(body))
}rust
use reqwest::Client;
const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let username = "subscriber001";
let response = client
.get(format!("{BASE_URL}/api/v1/radius/radcheck/{username}"))
.header("Accept", "application/json")
.bearer_auth(TOKEN)
.query(&[
("isp_id", "1"),
("branch_id", "1"),
("user_id", "1"),
])
.send()
.await?;
let data: serde_json::Value = response.json().await?;
println!("{data:#}");
Ok(())
}Get Subscriber Radreply
Retrieve a subscriber's radreply rows (attributes sent back to the NAS, such as a static IP or a rate limit).
| Property | Value |
|---|---|
| Endpoint | Get Radreply |
| Method | GET |
| URL | /api/v1/radius/radreply/{username} |
| Authentication | Bearer Token |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer your-auth-token | Yes |
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Subscriber username |
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
isp_id | integer | Yes | ISP ID |
branch_id | integer | Yes | Branch ID |
user_id | integer | Yes | Your user ID |
Request Body: None
Success Response (200 OK):
json
{
"status": "success",
"data": {
"radreply": [
{
"id": 7310,
"username": "rahim.uttara",
"attribute": "Framed-IP-Address",
"op": ":=",
"value": "100.64.12.45"
}
]
}
}radreply is an empty array when the subscriber has no reply attributes.
Error Response (403 Forbidden):
json
{
"status": "error",
"message": "Oops! Insufficient Permission"
}Error Response (404 Not Found):
json
{
"status": "error",
"message": "Subscriber not found."
}Code Examples:
bash
curl -X GET "https://your-domain.com/api/v1/radius/radreply/subscriber001?isp_id=1&branch_id=1&user_id=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token"php
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://your-domain.com']);
$username = 'subscriber001';
$response = $client->request('GET', "/api/v1/radius/radreply/{$username}", [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-auth-token',
],
'query' => [
'isp_id' => 1,
'branch_id' => 1,
'user_id' => 1,
],
]);
$data = json_decode($response->getBody(), true);
print_r($data);javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';
const username = "subscriber001";
const params = new URLSearchParams({
isp_id: 1,
branch_id: 1,
user_id: 1,
});
const response = await fetch(`${BASE_URL}/api/v1/radius/radreply/${username}?${params}`, {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: `Bearer ${TOKEN}`,
},
});
const data = await response.json();
console.log(data);python
import requests
BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"
username = "subscriber001"
response = requests.get(
f"{BASE_URL}/api/v1/radius/radreply/{username}",
headers={
"Accept": "application/json",
"Authorization": f"Bearer {TOKEN}",
},
params={
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
},
)
data = response.json()
print(data)go
package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
const baseURL = "https://your-domain.com"
const token = "your-auth-token"
func main() {
username := "subscriber001"
endpoint := baseURL + "/api/v1/radius/radreply/" + username
q := url.Values{}
q.Set("isp_id", "1")
q.Set("branch_id", "1")
q.Set("user_id", "1")
endpoint += "?" + q.Encode()
req, _ := http.NewRequest("GET", endpoint, nil)
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(body))
}rust
use reqwest::Client;
const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let username = "subscriber001";
let response = client
.get(format!("{BASE_URL}/api/v1/radius/radreply/{username}"))
.header("Accept", "application/json")
.bearer_auth(TOKEN)
.query(&[
("isp_id", "1"),
("branch_id", "1"),
("user_id", "1"),
])
.send()
.await?;
let data: serde_json::Value = response.json().await?;
println!("{data:#}");
Ok(())
}Get Subscriber Radusergroup
Retrieve a subscriber's radusergroup rows (the RADIUS group / policy the subscriber is in).
| Property | Value |
|---|---|
| Endpoint | Get Radusergroup |
| Method | GET |
| URL | /api/v1/radius/radusergroup/{username} |
| Authentication | Bearer Token |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer your-auth-token | Yes |
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Subscriber username |
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
isp_id | integer | Yes | ISP ID |
branch_id | integer | Yes | Branch ID |
user_id | integer | Yes | Your user ID |
Request Body: None
Success Response (200 OK):
json
{
"status": "success",
"data": {
"radusergroup": [
{
"id": 15822,
"username": "rahim.uttara",
"groupname": "20Mbps-Home",
"priority": 1
}
]
}
}Error Response (403 Forbidden):
json
{
"status": "error",
"message": "Oops! Insufficient Permission"
}Error Response (404 Not Found):
json
{
"status": "error",
"message": "Subscriber not found."
}Code Examples:
bash
curl -X GET "https://your-domain.com/api/v1/radius/radusergroup/subscriber001?isp_id=1&branch_id=1&user_id=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token"php
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://your-domain.com']);
$username = 'subscriber001';
$response = $client->request('GET', "/api/v1/radius/radusergroup/{$username}", [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-auth-token',
],
'query' => [
'isp_id' => 1,
'branch_id' => 1,
'user_id' => 1,
],
]);
$data = json_decode($response->getBody(), true);
print_r($data);javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';
const username = "subscriber001";
const params = new URLSearchParams({
isp_id: 1,
branch_id: 1,
user_id: 1,
});
const response = await fetch(`${BASE_URL}/api/v1/radius/radusergroup/${username}?${params}`, {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: `Bearer ${TOKEN}`,
},
});
const data = await response.json();
console.log(data);python
import requests
BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"
username = "subscriber001"
response = requests.get(
f"{BASE_URL}/api/v1/radius/radusergroup/{username}",
headers={
"Accept": "application/json",
"Authorization": f"Bearer {TOKEN}",
},
params={
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
},
)
data = response.json()
print(data)go
package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
const baseURL = "https://your-domain.com"
const token = "your-auth-token"
func main() {
username := "subscriber001"
endpoint := baseURL + "/api/v1/radius/radusergroup/" + username
q := url.Values{}
q.Set("isp_id", "1")
q.Set("branch_id", "1")
q.Set("user_id", "1")
endpoint += "?" + q.Encode()
req, _ := http.NewRequest("GET", endpoint, nil)
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(body))
}rust
use reqwest::Client;
const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let username = "subscriber001";
let response = client
.get(format!("{BASE_URL}/api/v1/radius/radusergroup/{username}"))
.header("Accept", "application/json")
.bearer_auth(TOKEN)
.query(&[
("isp_id", "1"),
("branch_id", "1"),
("user_id", "1"),
])
.send()
.await?;
let data: serde_json::Value = response.json().await?;
println!("{data:#}");
Ok(())
}Get Usage Stats
Retrieve a subscriber's usage totals over all its sessions (online and finished), or over a date range.
| Property | Value |
|---|---|
| Endpoint | Get Usage Stats |
| Method | GET |
| URL | /api/v1/radius/usage-stats/{username} |
| Authentication | Bearer Token |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer your-auth-token | Yes |
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Subscriber username |
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
isp_id | integer | Yes | ISP ID |
branch_id | integer | Yes | Branch ID |
user_id | integer | Yes | Your user ID |
date_from | date | No | Count sessions that started on or after this date (YYYY-MM-DD) |
date_to | date | No | Count sessions that started on or before this date (YYYY-MM-DD) |
Request Body: None
Success Response (200 OK):
json
{
"status": "success",
"data": {
"username": "rahim.uttara",
"total_upload_bytes": "2467398112",
"total_download_bytes": "38654705664",
"total_upload_formatted": "2.30 GB",
"total_download_formatted": "36.00 GB",
"total_session_time_seconds": "1324800",
"total_session_time_formatted": "368:00:00",
"session_count": 45
}
}| Field | Description |
|---|---|
total_upload_bytes / total_download_bytes | Bytes uploaded / downloaded (sums of acctinputoctets / acctoutputoctets). Sent as a numeric string; 0 when there are no sessions |
total_upload_formatted / total_download_formatted | The same in B, KB, MB or GB with two decimals |
total_session_time_seconds | Total online time in seconds (numeric string; 0 when there are no sessions) |
total_session_time_formatted | The same as HH:MM:SS; hours can go past 24 |
session_count | Number of sessions counted |
Error Response (403 Forbidden):
json
{
"status": "error",
"message": "Oops! Insufficient Permission"
}Error Response (404 Not Found):
json
{
"status": "error",
"message": "Subscriber not found."
}Error Response (500 Server Error):
json
{
"status": "error",
"message": "Failed to fetch usage stats."
}Code Examples:
bash
curl -X GET "https://your-domain.com/api/v1/radius/usage-stats/subscriber001?isp_id=1&branch_id=1&user_id=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer your-auth-token"php
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://your-domain.com']);
$username = 'subscriber001';
$response = $client->request('GET', "/api/v1/radius/usage-stats/{$username}", [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-auth-token',
],
'query' => [
'isp_id' => 1,
'branch_id' => 1,
'user_id' => 1,
],
]);
$data = json_decode($response->getBody(), true);
print_r($data);javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';
const username = "subscriber001";
const params = new URLSearchParams({
isp_id: 1,
branch_id: 1,
user_id: 1,
});
const response = await fetch(`${BASE_URL}/api/v1/radius/usage-stats/${username}?${params}`, {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: `Bearer ${TOKEN}`,
},
});
const data = await response.json();
console.log(data);python
import requests
BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"
username = "subscriber001"
response = requests.get(
f"{BASE_URL}/api/v1/radius/usage-stats/{username}",
headers={
"Accept": "application/json",
"Authorization": f"Bearer {TOKEN}",
},
params={
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
},
)
data = response.json()
print(data)go
package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
const baseURL = "https://your-domain.com"
const token = "your-auth-token"
func main() {
username := "subscriber001"
endpoint := baseURL + "/api/v1/radius/usage-stats/" + username
q := url.Values{}
q.Set("isp_id", "1")
q.Set("branch_id", "1")
q.Set("user_id", "1")
endpoint += "?" + q.Encode()
req, _ := http.NewRequest("GET", endpoint, nil)
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(body))
}rust
use reqwest::Client;
const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let username = "subscriber001";
let response = client
.get(format!("{BASE_URL}/api/v1/radius/usage-stats/{username}"))
.header("Accept", "application/json")
.bearer_auth(TOKEN)
.query(&[
("isp_id", "1"),
("branch_id", "1"),
("user_id", "1"),
])
.send()
.await?;
let data: serde_json::Value = response.json().await?;
println!("{data:#}");
Ok(())
}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 database mark. Non-admin users need the subscriber_disconnect permission.
Updated in v2.22.26
The endpoint sends a real CoA via RadiusServices, so the subscriber is actually dropped on the NAS, not only flagged in radacct. Pass subscriber_id (preferred) or session_id.
| Property | Value |
|---|---|
| Endpoint | Disconnect Session |
| Method | POST |
| URL | /api/v1/radius/disconnect |
| Authentication | Bearer Token |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Content-Type | application/json | Yes |
Authorization | Bearer your-auth-token | Yes |
Request Body:
json
{
"isp_id": 1,
"branch_id": 1,
"user_id": 5,
"subscriber_id": 1532
}| Parameter | Type | Required | Description |
|---|---|---|---|
isp_id | integer | Yes | ISP ID |
branch_id | integer | Yes | Branch ID |
user_id | integer | Yes | Your user ID |
subscriber_id | integer | Conditional | Required if session_id is not provided |
session_id | string | Conditional | The online session's acctsessionid. Required if subscriber_id is not provided |
Success Response (200 OK):
json
{
"status": "success",
"message": "Disconnect request sent successfully.",
"data": {
"subscriber_id": 1532,
"username": "rahim.uttara",
"disconnected": true
}
}data.disconnected (from v2.30.8) is true when the router confirmed the disconnect (Disconnect-ACK). When the router did not confirm it, the answer is still 200 with "disconnected": false and the message Disconnect request sent, but the router did not confirm the disconnect. Check the session again with Online Sessions before retrying.
Error Response (403 Forbidden):
Returned when the caller lacks subscriber_disconnect, or the subscriber is in your ISP and branch but not one you may manage.
json
{
"status": "error",
"message": "Oops! Insufficient Permission"
}Error Response (404 Not Found):
Subscriber not found. for a subscriber_id outside your ISP and branch. For a session_id, a session that is not online or belongs to a subscriber you may not see answers:
json
{
"status": "error",
"message": "Active session not found."
}Error Response (409 Conflict):
The subscriber is not online.
json
{
"status": "error",
"message": "Subscriber Not Online!"
}Error Response (422 Validation Error):
Neither subscriber_id nor session_id was sent.
json
{
"status": "error",
"message": [
"The subscriber id field is required when session id is not present.",
"The session id field is required when subscriber id is not present."
]
}Error Response (500 Server Error):
Also returned when the NAS of the session cannot be found.
json
{
"status": "error",
"message": "Failed to disconnect."
}Code Examples:
bash
curl -X POST "https://your-domain.com/api/v1/radius/disconnect" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-auth-token" \
-d '{
"isp_id": 1,
"branch_id": 1,
"user_id": 5,
"subscriber_id": 1532
}'php
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://your-domain.com']);
$response = $client->request('POST', '/api/v1/radius/disconnect', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-auth-token',
],
'json' => [
'isp_id' => 1,
'branch_id' => 1,
'user_id' => 5,
'subscriber_id' => 1532,
],
]);
$data = json_decode($response->getBody(), true);
print_r($data);javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';
const response = await fetch(`${BASE_URL}/api/v1/radius/disconnect`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: `Bearer ${TOKEN}`,
},
body: JSON.stringify({
isp_id: 1,
branch_id: 1,
user_id: 5,
subscriber_id: 1532,
}),
});
const data = await response.json();
console.log(data);python
import requests
BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"
response = requests.post(
f"{BASE_URL}/api/v1/radius/disconnect",
headers={
"Accept": "application/json",
"Authorization": f"Bearer {TOKEN}",
},
json={
"isp_id": 1,
"branch_id": 1,
"user_id": 5,
"subscriber_id": 1532,
},
)
data = response.json()
print(data)go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
const baseURL = "https://your-domain.com"
const token = "your-auth-token"
func main() {
endpoint := baseURL + "/api/v1/radius/disconnect"
payload, _ := json.Marshal(map[string]any{
"isp_id": 1,
"branch_id": 1,
"user_id": 5,
"subscriber_id": 1532,
})
req, _ := http.NewRequest("POST", endpoint, bytes.NewBuffer(payload))
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(body))
}rust
use reqwest::Client;
use serde_json::json;
const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let response = client
.post(format!("{BASE_URL}/api/v1/radius/disconnect"))
.header("Accept", "application/json")
.bearer_auth(TOKEN)
.json(&json!({
"isp_id": 1,
"branch_id": 1,
"user_id": 5,
"subscriber_id": 1532
}))
.send()
.await?;
let data: serde_json::Value = response.json().await?;
println!("{data:#}");
Ok(())
}