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 Resource roles will be deprecated soon. Please use the new Azure REST PIM API for Azure resource roles.

Cancel a governanceRoleAssignmentRequest.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Azure resources

Permission type Permissions
Delegated (work or school account) PrivilegedAccess.ReadWrite.AzureResources
Delegated (personal Microsoft account) Not supported.
Application Not supported.

Azure AD

Permission type Permissions
Delegated (work or school account) PrivilegedAccess.ReadWrite.AzureAD
Delegated (personal Microsoft account) Not supported.
Application Not supported.

Groups

Permission type Permissions
Delegated (work or school account) PrivilegedAccess.ReadWrite.AzureADGroup
Delegated (personal Microsoft account) Not supported.
Application 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.
Content-type application/json

Request body

Do not supply a request body for this method.

Response

If successful, this method returns 204 NoContent response code. It does not 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 does not exist in system.
400 BadRequest RequestCannotBeCancelled Only requests in status of Granted, PendingApproval, PendingApprovalProvisioning and PendingAdminDecision can be cancelled.

Example

Request

The following is an example of the request.

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

Response

HTTP/1.1 204 No Content