Edit

List roleDefinitions

Namespace: microsoft.graph

List custom unifiedRoleDefinition objects that have been soft-deleted from Microsoft Entra directory role management. Built-in role definitions can't be deleted and aren't returned.

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) RoleManagement.Read.Directory RoleManagement.ReadWrite.Directory
Delegated (personal Microsoft account) Not supported. Not supported.
Application RoleManagement.Read.Directory RoleManagement.ReadWrite.Directory

Important

For delegated access using work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role that grants the permissions required for this operation. This operation supports the following built-in roles, which provide only the least privilege necessary:

  • Directory Readers
  • Global Reader
  • Privileged Role Administrator

HTTP request

GET /roleManagement/directory/deletedItems/roleDefinitions

Optional query parameters

This method supports the OData query parameters to help customize the response.

Request headers

Name Description
Authorization ****** Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and a collection of unifiedRoleDefinition objects in the response body.

Examples

Example 1: List soft-deleted custom role definitions

Request

The following example shows a request.

GET https://graph.microsoft.com/v1.0/roleManagement/directory/deletedItems/roleDefinitions

Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#roleManagement/directory/deletedItems/roleDefinitions",
  "value": [
    {
      "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
      "description": "Can manage basic aspects of application registrations.",
      "displayName": "Application Support Administrator",
      "isBuiltIn": false,
      "isEnabled": true,
      "rolePermissions": [
        {
          "allowedResourceActions": [
            "microsoft.directory/applications/basic/update"
          ]
        }
      ]
    }
  ]
}