API Reference - Admin Roles
Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108128
← Back to API Reference | Getting Started
Admin Roles
Admin Roles define named permission groups for administrators on your directory site. Each role can be assigned a set of permissions and plugin access rules that control what sections of the admin panel a sub-administrator can access. Roles are created and managed from the admin panel's Roles & Permissions section.
Model name in URL:
admin_roles — DB table: admin_rolesThe Admin Role Object
| Field | Type | Description |
|---|---|---|
role_id | integer | Unique admin role ID (primary key, read-only) |
role_name | string | Human-readable name for this role (EG Content Editors, Support Staff); max 500 characters required on create |
created_by | integer | Foreign key referencing the administrator who created this role required on create |
modified_by | integer | Foreign key referencing the administrator who last modified this role required on create |
created | datetime | Datetime when this role was created |
modified | datetime | Datetime when this role was last modified |
description | string | Optional description for this role |
List Admin Roles
GET /api/v2/admin_roles/get
Example Request
Copy
curl -X GET "https://www.yourdomain.com/api/v2/admin_roles/get?limit=25" \ -H "X-Api-Key: your-api-key-here"
Example Response
Copy
{
"status": "success",
"message": [
{
"role_id": "4",
"role_name": "Content Editors",
"created_by": "27",
"modified_by": "27",
"created": "2025-05-07 16:04:59",
"modified": "2025-05-07 16:04:59"
}
],
"total": "1",
"current_page": 1,
"total_pages": 1
}Retrieve an Admin Role
GET /api/v2/admin_roles/get/{role_id}
Example Request
Copy
curl -X GET "https://www.yourdomain.com/api/v2/admin_roles/get/4" \ -H "X-Api-Key: your-api-key-here"
Example Response
Copy
{
"status": "success",
"message": [
{
"role_id": "4",
"role_name": "Content Editors",
"created_by": "27",
"modified_by": "27",
"created": "2025-05-07 16:04:59",
"modified": "2025-05-07 16:04:59"
}
],
"total": "1",
"current_page": 1,
"total_pages": 1
}Create an Admin Role
POST /api/v2/admin_roles/create
Example Request
Copy
curl -X POST "https://www.yourdomain.com/api/v2/admin_roles/create" \ -H "X-Api-Key: your-api-key-here" \ -d "role_name=Support+Staff" \ -d "created_by=27" \ -d "modified_by=27"
Example Response
Copy
{
"status": "success",
"message": {
"role_id": "5",
"role_name": "Support Staff",
"created_by": "27",
"modified_by": "27",
"created": null,
"modified": null
}
}Update an Admin Role
PUT /api/v2/admin_roles/update
Example Request
Copy
curl -X PUT "https://www.yourdomain.com/api/v2/admin_roles/update" \ -H "X-Api-Key: your-api-key-here" \ -d "role_id=5" \ -d "role_name=Support+Team" \ -d "modified_by=27"
Example Response
Copy
{
"status": "success",
"message": {
"role_id": "5",
"role_name": "Support Team",
"created_by": "27",
"modified_by": "27",
"created": "0000-00-00 00:00:00",
"modified": "0000-00-00 00:00:00"
}
}Delete an Admin Role
DELETE /api/v2/admin_roles/delete
Example Request
Copy
curl -X DELETE "https://www.yourdomain.com/api/v2/admin_roles/delete" \ -H "X-Api-Key: your-api-key-here" \ -d "role_id=5"
Example Response
Copy
{
"status": "success",
"message": "admin_roles record was deleted"
}