Cancel governanceRoleAssignmentRequest

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.

Caution

This version of the Privileged Identity Management (PIM) API for Azure resources will be deprecated soon. Please use the new Azure REST PIM API for Azure resource roles.

Cancel a governanceRoleAssignmentRequest.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

The following tables show the least privileged permission or permissions required to call this API on each supported resource type. Follow best practices to request least privileged permissions. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Azure resources

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) PrivilegedAccess.ReadWrite.AzureResources Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application Not supported. Not supported.

Microsoft Entra ID

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) PrivilegedAccess.ReadWrite.AzureAD Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application Not supported. Not supported.

Groups

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) PrivilegedAccess.ReadWrite.AzureADGroup Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application Not supported. Not supported.

Optional query parameters

This method does not support OData Query Parameters.

HTTP request

POST /privilegedAccess/azureResources/roleAssignmentRequests/{id}/cancel

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-type application/json

Request body

Don't supply a request body for this method.

Response

If successful, this method returns 204 NoContent response code. It doesn't return anything in the response body.

Error codes

This API follows the standard of HTTP codes. Besides, the custom error codes are shown below.

Error code Error message Details
400 BadRequest RoleAssignmentRequestNotFound The governanceRoleAssignmentRequest doesn't exist in system.
400 BadRequest RequestCannotBeCancelled Only requests in status of Granted, PendingApproval, PendingApprovalProvisioning and PendingAdminDecision can be canceled.

Example

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/privilegedAccess/azureResources/roleAssignmentRequests/7c53453e-d5a4-41e0-8eb1-32d5ec8bfdee/cancel

Response

HTTP/1.1 204 No Content