In order to create a team, the group must have a least one owner.
If the creation of the team call is delayed, you can retry the call up to three times before you have to wait for 15 minutes due to a propagation delay. If the group was created less than 15 minutes ago, the call might fail with a 404 error code due to replication delays.
If the group was created less than 15 minutes ago, it's possible for a call to create a team to fail with a 404 error code, due to ongoing replication delays.
The recommended pattern is to retry the Create team call three times, with a 10 second delay between calls.
Note: SharePoint provisioning doesn't occur in real time, it's a background process. The completion of the provisioning can't be determined.
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type
Least privileged permissions
Higher privileged permissions
Delegated (work or school account)
Group.ReadWrite.All
Directory.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Not supported.
Application
Group.ReadWrite.All
Directory.ReadWrite.All
Note: This API supports admin permissions. Microsoft Teams service admins can access groups that they are not a member of.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new Team
{
MemberSettings = new TeamMemberSettings
{
AllowCreatePrivateChannels = true,
AllowCreateUpdateChannels = true,
},
MessagingSettings = new TeamMessagingSettings
{
AllowUserEditMessages = true,
AllowUserDeleteMessages = true,
},
FunSettings = new TeamFunSettings
{
AllowGiphy = true,
GiphyContentRating = GiphyRatingType.Strict,
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Groups["{group-id}"].Team.PutAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Team team = new Team();
TeamMemberSettings memberSettings = new TeamMemberSettings();
memberSettings.setAllowCreatePrivateChannels(true);
memberSettings.setAllowCreateUpdateChannels(true);
team.setMemberSettings(memberSettings);
TeamMessagingSettings messagingSettings = new TeamMessagingSettings();
messagingSettings.setAllowUserEditMessages(true);
messagingSettings.setAllowUserDeleteMessages(true);
team.setMessagingSettings(messagingSettings);
TeamFunSettings funSettings = new TeamFunSettings();
funSettings.setAllowGiphy(true);
funSettings.setGiphyContentRating(GiphyRatingType.Strict);
team.setFunSettings(funSettings);
Team result = graphClient.groups().byGroupId("{group-id}").team().put(team);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\Team;
use Microsoft\Graph\Generated\Models\TeamMemberSettings;
use Microsoft\Graph\Generated\Models\TeamMessagingSettings;
use Microsoft\Graph\Generated\Models\TeamFunSettings;
use Microsoft\Graph\Generated\Models\GiphyRatingType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Team();
$memberSettings = new TeamMemberSettings();
$memberSettings->setAllowCreatePrivateChannels(true);
$memberSettings->setAllowCreateUpdateChannels(true);
$requestBody->setMemberSettings($memberSettings);
$messagingSettings = new TeamMessagingSettings();
$messagingSettings->setAllowUserEditMessages(true);
$messagingSettings->setAllowUserDeleteMessages(true);
$requestBody->setMessagingSettings($messagingSettings);
$funSettings = new TeamFunSettings();
$funSettings->setAllowGiphy(true);
$funSettings->setGiphyContentRating(new GiphyRatingType('strict'));
$requestBody->setFunSettings($funSettings);
$result = $graphServiceClient->groups()->byGroupId('group-id')->team()->put($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.team import Team
from msgraph.generated.models.team_member_settings import TeamMemberSettings
from msgraph.generated.models.team_messaging_settings import TeamMessagingSettings
from msgraph.generated.models.team_fun_settings import TeamFunSettings
from msgraph.generated.models.giphy_rating_type import GiphyRatingType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Team(
member_settings = TeamMemberSettings(
allow_create_private_channels = True,
allow_create_update_channels = True,
),
messaging_settings = TeamMessagingSettings(
allow_user_edit_messages = True,
allow_user_delete_messages = True,
),
fun_settings = TeamFunSettings(
allow_giphy = True,
giphy_content_rating = GiphyRatingType.Strict,
),
)
result = await graph_client.groups.by_group_id('group-id').team.put(request_body)