Cancel privilegedRoleAssignmentRequest

Namespace: microsoft.graph


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.


This version of the Privileged Identity Management (PIM) API for Azure Active Directory (Azure AD) roles is deprecated and stopped returning data on May 31, 2021. Use the new PIM v3 API for managing Azure AD roles or learn how to migrate.

Cancel a privilegedRoleAssignmentRequest.


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

Permission type Permissions (from least to most privileged)
Delegated (work or school account) PrivilegedAccess.ReadWrite.AzureAD
Delegated (personal Microsoft account) Not supported.
Application Not supported.

HTTP request

POST /privilegedRoleAssignmentRequests/{requestid}/cancel

Request headers

Name Description
Authorization Bearer {token}. Required.

Request body

Do not supply a request body for this method.


If successful, this method returns a 200 Ok response code. It returns privilegedRoleAssignmentRequest in the response body.

Error codes

This API returns the standard HTTP error codes. In addition, it returns the custom error codes listed in the following table.

Error code Error message
400 BadRequest RequestId cannot be Null.
400 BadRequest Request with request ID not found.
400 BadRequest Cancellation can be done only on status Scheduled and PendingApproval.
403 UnAuthorized Requester not allowed to make Cancel call or request not found.



Here is an example of the request.

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

    "@odata.context": "$metadata#privilegedRoleAssignmentRequests/$entity",
    "schedule": {
        "type": "activation",
        "startDateTime": "2018-02-08T02:35:17.903Z",
        "endDateTime": null,
        "duration" : null
    "id": "bcfb11e3-fc0d-49ea-b3d5-7d60a48e5043",
    "evaluateOnly": false,
    "type": "UserAdd",
    "assignmentState": "Active",
    "requestedDateTime": "2018-02-08T02:35:42.9137335Z",
    "status": "Cancelling",
    "duration": "2",
    "reason": "Activate the role for business purpose",
    "ticketNumber": "234",
    "ticketSystem": "system",
    "userId": "Self",
    "roleId": "88d8e3e3-8f55-4a1e-953a-9b9898b8876b"