Update group

Namespace: microsoft.graph

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, Directory.AccessAsUser.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 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:
  • Global Administrator
  • User Account Administrator
  • Partner Tier1 or Tier2 Support
  • Directory Writer
  • Exchange Administrator
  • SharePoint Administrator

For more information about this property, see OneDrive Online Multi-Geo.
securityEnabled Boolean Specifies whether the group is a security group.
visibility String Specifies the visibility of a Microsoft 365 group. The possible values are: Private, Public, or empty (which is interpreted as Public).

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.

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.

Example

The following example shows how to update a group.

Request

The following is an example of the request.

PATCH https://graph.microsoft.com/v1.0/groups/{id}
Content-type: application/json

{
  "description": "Library Assist",
  "displayName": "Library Assist",
  "groupTypes": [
    "Unified"
  ],
  "mailEnabled": true,
  "mailNickname": "library-help"
}

Response

The following is an example of the response.

HTTP/1.1 204 No Content