Update adminConsentRequestPolicy
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.
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.
Examples
Request
PUT https://graph.microsoft.com/beta/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