Update a directory setting

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported.

Update the properties of a specific directory setting object.

Note: The /beta version of this API is only applies to groups. The /v1.0 version of this API has been renamed to Update groupSettings.

Permissions

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

HTTP request

Update a tenant-wide or group specific setting.

PATCH /settings/{id}
PATCH /groups/{id}/settings/{id}

Optional request headers

Name Description
Authorization Bearer {token}. Required.

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 OK response code.

Example

Request

Here is an example of the request.

PATCH https://graph.microsoft.com/beta/settings/{id}
Content-type: application/json
Content-length: 178

{
  "values": [
    {
      "name": "name-value",
      "value": "value-value"
    }
  ]
}
Response
HTTP/1.1 204 OK

SDK sample code


GraphServiceClient graphClient = new GraphServiceClient( authProvider );

var directorySetting = new DirectorySetting
{
	Values = new List<SettingValue>()
	{
		new SettingValue
		{
			Name = "name-value",
			Value = "value-value"
		}
	}
};

await graphClient.Settings["{id}"]
	.Request()
	.UpdateAsync(directorySetting);

Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.