Creating a team with Microsoft Graph

Microsoft 365 groups support all teams. Using Microsoft Graph is the quickest way to get your team up and running. Afterward, you will need to set up a new Microsoft 365 group. 

  1. Using the ‘Create Group’ option in the Graph, create a Microsoft 365 group. When doing so, you can also specify the number of owners and members. Make sure to use the right owner for the new group, which is in Step 2.

Set the following property values shown to create a new team for the group

Initial team creation

  • groupTypes = { “Unified” }
  • mailEnabled = true
  • securityEnabled = false
POST /groups
{
"displayName":"Flight 157",
"mailNickname":"flight157",
"description":"Everything about flight 157",
"visibility":"Private",
"groupTypes":["Unified"],
"mailEnabled":true,
"securityEnabled":false,
"members@odata.bind":[
"https://graph.microsoft.com/v1.0/users/bec05f3d-a818-4b58-8c2e-2b4e74b0246d",
"https://graph.microsoft.com/v1.0/users/ae67a4f4-2308-4522-9021-9f402ff0fba8",
"https://graph.microsoft.com/v1.0/users/eab978dd-35d0-4885-8c46-891b7d618783",
"https://graph.microsoft.com/v1.0/users/6a1272b5-f6fc-45c4-95fe-fe7c5a676133"
],
"owners@odata.bind":[
"https://graph.microsoft.com/v1.0/users/6a1272b5-f6fc-45c4-95fe-fe7c5a676133",
"https://graph.microsoft.com/v1.0/users/eab978dd-35d0-4885-8c46-891b7d618783"
]
}

If you entered everything correctly, you should see the following response after hitting ‘enter.’

HTTP/1.1 200 OK
Content-type: application/json
Content-length: xxx
{
"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#groups/$entity",
"id":"b7f968af-ca51-42f6-a77e-82c7147bc8f2"
}

Note: Since all the properties in the code returned from an actual cell, the response might be smaller for readability

  1. Make sure to have more than one owner in your team just in case you get locked out by clicking add owner in Microsoft Graph. The accounts should be of real individuals, not company accounts. 

Note: Having an additional owner helps handle cases where one owner is unable to be online at a meeting.

  1. Using the ‘add member’ operation add all the members that you would like in this team if you did not do this already in Step 1. After you have created your group, this can ultimately take up to 15 minutes. If you run into an error, your group might not have finished creating, so you should wait until that’s finished.
  1. Create the team using the following code.
POST https://graph.microsoft.com/beta/teams
Content-Type: application/json
{
"template@odata.bind": "https://graph.microsoft.com/beta/teamsTemplates('standard')",
"group@odata.bind": "https://graph.microsoft.com/v1.0/groups('groupId')"
}

The response should be the following

Note: Since all the properties in the code returned from an actual cell, the response might be smaller for readability.

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /teams/{teamId}/operations/{operationId}
Content-Location: /teams/{teamId}
{
}

The content type is the same ID as the group.

  1. After this process is complete, everyone in the group should be able to view the new team in their Teams application.

Next Page: Checklist Validation