Update directorySetting
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 a specific directory setting object.
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.
For all settings except the Consent Policy Settings object
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | Directory.ReadWrite.All | Policy.ReadWrite.Authorization |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | Directory.ReadWrite.All | Policy.ReadWrite.Authorization |
For the Consent Policy Settings object
The following permissions are required to update the "Consent Policy Settings" directorySetting object.
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | Directory.ReadWrite.All | Policy.ReadWrite.Authorization |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | Directory.ReadWrite.All | Policy.ReadWrite.Authorization |
For delegated scenarios, the calling user needs at least one of the following Microsoft Entra roles.
Microsoft Entra role | Allowed privileges |
---|---|
Microsoft Entra Joined Device Local Administrator Directory Readers Global Reader |
Read basic properties on setting templates and settings |
Groups Administrator Directory Writers |
Manage all group settings |
Authentication Policy Administrator | Update Password Rule Settings |
User Administrator | Read basic properties on setting templates and settings Update settings |
HTTP request
Update a tenant-wide setting.
PATCH /settings/{directorySettingId}
Update a group-specific setting.
PATCH /groups/{groupId}/settings/{directorySettingId}
Optional request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Request body
In the request body, supply the values for relevant fields that should be updated.
Property | Type | Description |
---|---|---|
values | settingValue collection | The updated set of values. NOTE: You must supply the entire collection set. You cannot update a single set of values. |
Response
If successful, this method returns a 204 No Content
response code.
Example
Request
The following example shows a request.
PATCH https://graph.microsoft.com/beta/settings/3c105fc3-2254-4861-9e2d-d59e2126f3ef
Content-type: application/json
{
"values": [
{
"name": "CustomBlockedWordsList",
"value": "Contoso"
}
]
}
Response
HTTP/1.1 204 No Content
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for