curl -X GET https://api.companyflow.com/roles/550e8400-e29b-41d4-a716-446655440000/permissions \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch(
'https://api.companyflow.com/roles/550e8400-e29b-41d4-a716-446655440000/permissions',
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
}
);
const data = await response.json();
import requests
url = "https://api.companyflow.com/roles/550e8400-e29b-41d4-a716-446655440000/permissions"
headers = {
"Authorization": "Bearer YOUR_TOKEN"
}
response = requests.get(url, headers=headers)
data = response.json()
{
"success": true,
"data": [
{
"id": "770e8400-e29b-41d4-a716-446655440000",
"role_id": "550e8400-e29b-41d4-a716-446655440000",
"action": "read",
"resource": "employees",
"conditions": null,
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "880e8400-e29b-41d4-a716-446655440001",
"role_id": "550e8400-e29b-41d4-a716-446655440000",
"action": "write",
"resource": "employees",
"conditions": {
"department": "engineering"
},
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "990e8400-e29b-41d4-a716-446655440002",
"role_id": "550e8400-e29b-41d4-a716-446655440000",
"action": "read",
"resource": "departments",
"conditions": null,
"created_at": "2024-01-15T10:30:00Z"
}
]
}
{
"success": false,
"message": "invalid role_id"
}
{
"success": false,
"message": "unauthorized"
}
Roles & Permissions
List Permissions
Retrieve all permissions for a role
GET
/
roles
/
{role_id}
/
permissions
curl -X GET https://api.companyflow.com/roles/550e8400-e29b-41d4-a716-446655440000/permissions \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch(
'https://api.companyflow.com/roles/550e8400-e29b-41d4-a716-446655440000/permissions',
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
}
);
const data = await response.json();
import requests
url = "https://api.companyflow.com/roles/550e8400-e29b-41d4-a716-446655440000/permissions"
headers = {
"Authorization": "Bearer YOUR_TOKEN"
}
response = requests.get(url, headers=headers)
data = response.json()
{
"success": true,
"data": [
{
"id": "770e8400-e29b-41d4-a716-446655440000",
"role_id": "550e8400-e29b-41d4-a716-446655440000",
"action": "read",
"resource": "employees",
"conditions": null,
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "880e8400-e29b-41d4-a716-446655440001",
"role_id": "550e8400-e29b-41d4-a716-446655440000",
"action": "write",
"resource": "employees",
"conditions": {
"department": "engineering"
},
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "990e8400-e29b-41d4-a716-446655440002",
"role_id": "550e8400-e29b-41d4-a716-446655440000",
"action": "read",
"resource": "departments",
"conditions": null,
"created_at": "2024-01-15T10:30:00Z"
}
]
}
{
"success": false,
"message": "invalid role_id"
}
{
"success": false,
"message": "unauthorized"
}
Get a complete list of all permissions assigned to a specific role. Requires Super Admin or HR Manager permissions.
Path Parameters
string
required
The unique identifier of the role (UUID format)Example:
"550e8400-e29b-41d4-a716-446655440000"Response
boolean
Indicates if the request was successful
array
Array of permission objects
Show Permission Object
Show Permission Object
string
Unique identifier for the permission
string
The role this permission belongs to
string
The action that can be performed (e.g., “read”, “write”, “delete”)
string
The resource the permission applies to (e.g., “employees”, “departments”)
object
Optional conditions that must be met for the permission to apply
string
ISO 8601 timestamp of when the permission was created
curl -X GET https://api.companyflow.com/roles/550e8400-e29b-41d4-a716-446655440000/permissions \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch(
'https://api.companyflow.com/roles/550e8400-e29b-41d4-a716-446655440000/permissions',
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
}
);
const data = await response.json();
import requests
url = "https://api.companyflow.com/roles/550e8400-e29b-41d4-a716-446655440000/permissions"
headers = {
"Authorization": "Bearer YOUR_TOKEN"
}
response = requests.get(url, headers=headers)
data = response.json()
{
"success": true,
"data": [
{
"id": "770e8400-e29b-41d4-a716-446655440000",
"role_id": "550e8400-e29b-41d4-a716-446655440000",
"action": "read",
"resource": "employees",
"conditions": null,
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "880e8400-e29b-41d4-a716-446655440001",
"role_id": "550e8400-e29b-41d4-a716-446655440000",
"action": "write",
"resource": "employees",
"conditions": {
"department": "engineering"
},
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "990e8400-e29b-41d4-a716-446655440002",
"role_id": "550e8400-e29b-41d4-a716-446655440000",
"action": "read",
"resource": "departments",
"conditions": null,
"created_at": "2024-01-15T10:30:00Z"
}
]
}
{
"success": false,
"message": "invalid role_id"
}
{
"success": false,
"message": "unauthorized"
}