Trillet AI logo

Delete Role

Delete a custom role from your workspace.

DELETEhttps://api.trillet.ai/v1/api/roles-and-permissions/roles/{roleId}

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-idstringrequired

Workspace identifier for the API.

Path Parameters

roleIdstringrequired

The unique identifier of the role to delete.

Response Fields

successboolean

Whether the deletion was successful.

deletedRoleobject

The 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