Edit

Restore unifiedRoleDefinition

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Restore a soft-deleted custom unifiedRoleDefinition object to the active role definitions collection for Microsoft Entra directory role management.

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.ReadWrite.Directory Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application RoleManagement.ReadWrite.Directory Not available.

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. Privileged Role Administrator is the least privileged role supported for this operation.

HTTP request

POST /roleManagement/directory/deletedItems/roleDefinitions/{id}/restore

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this action.

Response

If successful, this action returns a 200 OK response code and a unifiedRoleDefinition object in the response body.

Examples

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/roleManagement/directory/deletedItems/roleDefinitions/a1b2c3d4-5678-90ab-cdef-1234567890ab/restore

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/beta/$metadata#roleManagement/directory/roleDefinitions/$entity",
  "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"
      ]
    }
  ]
}