Create group

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

Use this API to create a new group as specified in the request body. You can create one of three types of groups:

  • Office 365 group (unified group)
  • Dynamic group
  • Security group

Note: Although Microsoft Teams is built on Office 365 groups, you can't currently create a team via this API. You can use the other group APIs to manage a team that has been created in the Microsoft Teams UI.

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

HTTP request

POST /groups

Request headers

Name Type Description
Authorization string Bearer {token}. Required.

Request body

The following table shows the properties of the group resource that you must specify at a minimum when you create a group.

Property Type Description
displayName string The name to display in the address book for the group.
mailEnabled boolean Set to true for mail-enabled groups. Set this to true if creating an Office 365 group. Set this to false if creating dynamic or security group.
mailNickname string The mail alias for the group.
securityEnabled boolean Set to true for security-enabled groups. Set this to true if creating a dynamic or security group. Set this to false if creating an Office 365 group.

Specify the groupTypes property if you're creating an Office 365 or dynamic group, as stated below.

Type of group groupTypes property
Office 365 (aka unified group) "Unified"
Dynamic "DynamicMembership"
Security Do not set.

Since the group resource supports extensions, you can use the POST operation and add custom properties with your own data to the group while creating it.

Specify other writable properties as necessary for your group. For more information, see the properties of the group resource.

Response

If successful, this method returns 201, Created response code and group object in the response body.

Example

Request

Here is an example of a request that creates an Office 365 group.

POST https://graph.microsoft.com/beta/groups
Content-type: application/json
Content-length: 244

{
  "description": "Self help community for library",
  "displayName": "Library Assist",
  "groupTypes": [
    "Unified"
  ],
  "mailEnabled": true,
  "mailNickname": "library",
  "securityEnabled": false
}
Response

Here is an example of the response. Note: The response object shown here may be truncated for brevity. More properties will be returned from an actual call.

HTTP/1.1 201 Created
Content-type: application/json
Content-length: 244

{
  "description": "Self help community for library",
  "displayName": "Library Assist",
  "groupTypes": [
    "Unified"
  ],
  "mail": "library@contoso.onmicrosoft.com",
  "mailEnabled": true,
  "mailNickname": "library",
  "securityEnabled": false
}

See also