Skip to main content
DELETE
/
roles
/
{role_id}
/
permissions
/
{permission_id}
curl -X DELETE https://api.companyflow.com/roles/550e8400-e29b-41d4-a716-446655440000/permissions/770e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "company_id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "Department Manager",
    "description": "Can manage specific departments",
    "is_system_role": false,
    "permissions_cache": [
      "employees:read",
      "departments:read"
    ],
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2025-03-03T14:25:00Z"
  }
}
Remove a specific permission from a role. This allows you to revoke individual permissions without affecting other permissions assigned to the role. Requires Super Admin or HR Manager permissions.

Path Parameters

role_id
string
required
The unique identifier of the role (UUID format)Example: "550e8400-e29b-41d4-a716-446655440000"
permission_id
string
required
The unique identifier of the permission to remove (UUID format)Example: "770e8400-e29b-41d4-a716-446655440000"

Response

success
boolean
Indicates if the request was successful
data
object
The updated role object after permission removal
curl -X DELETE https://api.companyflow.com/roles/550e8400-e29b-41d4-a716-446655440000/permissions/770e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "company_id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "Department Manager",
    "description": "Can manage specific departments",
    "is_system_role": false,
    "permissions_cache": [
      "employees:read",
      "departments:read"
    ],
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2025-03-03T14:25:00Z"
  }
}

Authorization

This endpoint requires authentication with a Bearer token and one of the following roles:
  • Super Admin
  • HR Manager
Removing a permission will immediately affect all users assigned to this role. Ensure this action is intentional before proceeding.

Build docs developers (and LLMs) love