Delete Role
Delete a custom role from your workspace.
DELETE
Requires the role:delete permission in the workspace. Deleting a role also removes it from every user who held it.
System roles (owner, admin, editor, viewer) and roles from other workspaces can't be deleted; they return 404 Role not found.
Headers
x-workspace-idstringrequiredWorkspace identifier for the API.
Path Parameters
roleIdstringrequiredThe unique identifier of the role to delete.
Response Fields
successbooleanWhether the deletion was successful.
deletedRoleobjectThe role that was deleted.
{
"success": true,
"deletedRole": {
"_id": "a4a4a4a4a4a4a4a4a4a4a4a4",
"workspaceId": "a1a1a1a1a1a1a1a1a1a1a1a1",
"name": "Manager",
"description": "Full access to agents and call history",
"permissions": {
"agent": ["agent:view", "agent:create", "agent:edit"],
"call_history": ["call_history:view"]
},
"isSystem": false,
"createdAt": "2024-06-01T09:00:00.000Z",
"updatedAt": "2024-06-01T09:00:00.000Z",
"__v": 0
}
}Last updated on