Update group
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 group object.
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) | Group.ReadWrite.All, Directory.ReadWrite.All |
| Delegated (personal Microsoft account) | Not supported. |
| Application | Group.ReadWrite.All, Directory.ReadWrite.All |
HTTP request
PATCH /groups/{id}
Request headers
| Name | Type | Description |
|---|---|---|
| Authorization | string | Bearer {token}. Required. |
Request body
In the request body, supply only the values for properties that should be updated. Existing properties that are not included in the request body will maintain their previous values or be recalculated based on changes to other property values.
The following table specifies the properties that can be updated.
| Property | Type | Description |
|---|---|---|
| allowExternalSenders | Boolean | Default is false. Indicates whether people external to the organization can send messages to the group. |
| autoSubscribeNewMembers | Boolean | Default is false. Indicates whether new members added to the group will be auto-subscribed to receive email notifications. autoSubscribeNewMembers can't be true when subscriptionEnabled is set to false on the group. |
| description | String | An optional description for the group. |
| displayName | String | The display name for the group. This property is required when a group is created and it cannot be cleared during updates. |
| mailNickname | String | The mail alias for the group, unique for Microsoft 365 groups in the organization. Maximum length is 64 characters. This property can contain only characters in the ASCII character set 0 - 127 except the following: @ () \ [] " ; : . <> , SPACE. |
| preferredDataLocation | String | The preferred data location for the Microsoft 365 group. To update this property, the calling user must be assigned one of the following Azure AD roles:
For more information about this property, see OneDrive Online Multi-Geo. |
| securityEnabled | Boolean | Specifies whether the group is a security group, including Microsoft 365 groups. |
| visibility | String | Specifies the visibility of a Microsoft 365 group. Possible values are: Private, Public, or empty (which is interpreted as Public). |
| writebackConfiguration | groupWritebackConfiguration | Specifies whether or not a group is configured to write back group object properties to on-premise Active Directory. These properties are used when group writeback is configured in the Azure AD Connect sync client. |
Important
To update the following properties, you must specify them in their own PATCH request, without including the other properties listed in the table above: allowExternalSenders, autoSubscribeNewMembers, hideFromAddressLists, hideFromOutlookClients, isSubscribedByMail, unseenCount.
Only a subset of the group API pertaining to core group administration and management support application and delegated permissions. All other members of the group API, including updating autoSubscribeNewMembers, support only delegated permissions. See known issues for examples.
The rules for updating mail-enabled security groups in Microsoft Exchange Server can be complex; to learn more, see Manage mail-enabled security groups in Exchange Server.
Manage extensions and associated data
Use this API to manage the directory, schema, and open extensions and their data for groups, as follows:
- Add, update and store data in the extensions for an existing group.
- For directory and schema extensions, remove any stored data by setting the value of the custom extension property to
null. For open extensions, use the Delete open extension API.
Response
If successful, this method returns a 204 No Content response code—except a 200 OK response code when updating the following properties: allowExternalSenders, autoSubscribeNewMembers, hideFromAddressLists, hideFromOutlookClients, isSubscribedByMail, unseenCount.
Examples
Example 1: Update display name and description of a group
Request
The following is an example of the request.
PATCH https://graph.microsoft.com/beta/groups/{id}
Content-type: application/json
{
"description":"Contoso Life v2.0",
"displayName":"Contoso Life Renewed"
}
Response
The following is an example of the response.
HTTP/1.1 204 No Content
Example 2: Apply sensitivity label to a Microsoft 365 group
Request
You can obtain the ID of the label you want to apply to a Microsoft 365 group by using List label. Then you can update the assignedLabels property of the group with the label ID.
Note: Use of this API to apply sensitivity labels to Microsoft 365 groups is only supported for delegated permission scenarios.
PATCH https://graph.microsoft.com/beta/groups/{id}
Content-type: application/json
{
"assignedLabels":
[
{
"labelId" : "45cd0c48-c540-4358-ad79-a3658cdc5b88"
}
]
}
Response
The following is an example of the response.
HTTP/1.1 204 No Content
See also
Feedback
Submit and view feedback for