Επεξεργασία

Κοινή χρήση μέσω


Update adminConsentRequestPolicy

Namespace: microsoft.graph

Update the properties of an adminConsentRequestPolicy object.

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

Important

In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. The following least privileged roles are supported for this operation:

  • Cloud Application Administrator
  • Application Administrator

HTTP request

PUT /policies/adminConsentRequestPolicy

Request headers

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

Request body

In the request body, supply a JSON representation of the adminConsentRequestPolicy object.

The following table shows the properties that are required when you update the adminConsentRequestPolicy.

Property Type Description
isEnabled Boolean Specifies whether the admin consent request feature is enabled or disabled.
notifyReviewers Boolean Specifies whether reviewers will receive notifications.
remindersEnabled Boolean Specifies whether reviewers will receive reminder emails.
requestDurationInDays Int32 Specifies the duration the request is active before it automatically expires if no decision is applied.
reviewers accessReviewReviewerScope collection The list of reviewers for the admin consent.

Response

If successful, this method returns a 204 No content response code and an updated adminConsentRequestPolicy object in the response body.

Examples

Request

PUT https://graph.microsoft.com/v1.0/policies/adminConsentRequestPolicy 
Content-Type: application/json

{
  "isEnabled": true,
  "notifyReviewers": true,
  "remindersEnabled": true,
  "requestDurationInDays": 5,
  "reviewers": [
    {
      "query": "/users/b6879be8-fb87-4482-a72e-18445d2b5c54",
      "queryType": "MicrosoftGraph"
    },
    {
      "query": "/users/b3427cc5-bf69-4dcd-95f7-ed1eb432f5e9",
      "queryType": "MicrosoftGraph"
    }
  ]
}

Response

HTTP/1.1 204 No Content
Content-Type: text/plain