Appearance
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.
| Property | Value |
|---|---|
| Endpoint | Fetch All Policies |
| Method | GET |
| URL | /api/v1/policies |
| Authentication | Bearer Token |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer your-auth-token | Yes |
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.
| Property | Value |
|---|---|
| Endpoint | Fetch Policy |
| Method | GET |
| URL | /api/v1/policies/{id} |
| Authentication | Bearer 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.
| Property | Value |
|---|---|
| Endpoint | Create Policy |
| Method | POST |
| URL | /api/v1/policies |
| Authentication | Bearer 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.
| Property | Value |
|---|---|
| Endpoint | Update Policy |
| Method | PUT |
| URL | /api/v1/policies/{id} |
| Authentication | Bearer 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.
| Property | Value |
|---|---|
| Endpoint | Delete Policy |
| Method | DELETE |
| URL | /api/v1/policies/{id} |
| Authentication | Bearer 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.
| Property | Value |
|---|---|
| Endpoint | Fetch Policy Attributes |
| Method | GET |
| URL | /api/v1/policies/{id}/attributes |
| Authentication | Bearer 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.
| Property | Value |
|---|---|
| Endpoint | Create Policy Attribute |
| Method | POST |
| URL | /api/v1/policies/{id}/attributes |
| Authentication | Bearer Token |
Request Body:
json
{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"attribute": "Framed-Protocol",
"op": ":=",
"value": "PPP"
}| Parameter | Type | Required | Description |
|---|---|---|---|
attribute | string | Yes | RADIUS attribute name |
op | string | Yes | Operator (:=, ==, !=, etc.) |
value | string | Yes | Attribute value |
Success Response (201 Created):
json
{
"success": true,
"message": "Attribute added successfully"
}Update Policy Attribute
Update an existing policy attribute.
| Property | Value |
|---|---|
| Endpoint | Update Policy Attribute |
| Method | PUT |
| URL | /api/v1/policies/{id}/attributes/{attr_id} |
| Authentication | Bearer Token |
Success Response (200 OK):
json
{
"success": true,
"message": "Attribute updated successfully"
}Delete Policy Attribute
Remove an attribute from a policy.
| Property | Value |
|---|---|
| Endpoint | Delete Policy Attribute |
| Method | DELETE |
| URL | /api/v1/policies/{id}/attributes/{attr_id} |
| Authentication | Bearer Token |
Success Response (200 OK):
json
{
"success": true,
"message": "Attribute deleted successfully"
}