We use the Microsoft Graph API "POST teams/v1.0" to create Microsoft Teams team programmatically. This endpoint allows the creation of teams with predefined content such as settings, apps, channels, and tabs. However, we started facing today issues when trying to create a team with predefined tabs. The problem can be easily reproduced in Microsoft Graph Explorer. This is what the sample request looks like:
POST https://graph.microsoft.com/v1.0/teams
{
"[email protected]": "https://graph.microsoft.com/v1.0/teamsTemplates('standard')",
"visibility": "Private",
"displayName": "Sample Engineering Team",
"description": "This is a sample engineering team, used to showcase the range of properties supported by this API",
"channels": [
{
"displayName": "Announcements ????",
"isFavoriteByDefault": true,
"description": "This is a sample announcements channel that is favorited by default. Use this channel to make important team, product, and service announcements."
},
{
"displayName": "Training ????️",
"isFavoriteByDefault": true,
"description": "This is a sample training channel, that is favorited by default, and contains an example of pinned website and YouTube tabs.",
"tabs": [
{
"[email protected]": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')",
"displayName": "A Pinned Website",
"configuration": {
"contentUrl": "https://docs.microsoft.com/microsoftteams/microsoft-teams"
}
},
{
"[email protected]": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.youtube')",
"displayName": "A Pinned YouTube Video",
"configuration": {
"contentUrl": "https://tabs.teams.microsoft.com/Youtube/Home/YoutubeTab?videoId=X8krAMdGvCQ",
"websiteUrl": "https://www.youtube.com/watch?v=X8krAMdGvCQ"
}
}
]
},
{
"displayName": "Planning ???? ",
"description": "This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu.",
"isFavoriteByDefault": false
},
{
"displayName": "Issues and Feedback ????",
"description": "This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu."
}
],
"memberSettings": {
"allowCreateUpdateChannels": true,
"allowDeleteChannels": true,
"allowAddRemoveApps": true,
"allowCreateUpdateRemoveTabs": true,
"allowCreateUpdateRemoveConnectors": true
},
"guestSettings": {
"allowCreateUpdateChannels": false,
"allowDeleteChannels": false
},
"funSettings": {
"allowGiphy": true,
"giphyContentRating": "Moderate",
"allowStickersAndMemes": true,
"allowCustomMemes": true
},
"messagingSettings": {
"allowUserEditMessages": true,
"allowUserDeleteMessages": true,
"allowOwnerDeleteMessages": true,
"allowTeamMentions": true,
"allowChannelMentions": true
},
"discoverySettings": {
"showInTeamsSearchAndSuggestions": true
},
"installedApps": [
{
"[email protected]": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')"
},
{
"[email protected]": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')"
}
]
}
This is what the error response includes:
[
"message":"Tabs with duplicate DisplayName are not allowed.",
"errorCode":"Unknown",
"message":"'Channel Name' must not be empty.",
"errorCode":"Unknown",
"message":"'Channel Name' should not be empty.",
"errorCode":"Unknown",
"message":"'Channel Name' must not be empty.",
"errorCode":"Unknown",
"message":"'Channel Name' should not be empty.",
"errorCode":"Unknown"
]
If the JSON object doesn't contain any tab configuration, the POST v1.0/teams endpoint works correctly. Here the test scenarios we covered:
- POST beta/teams API
- POST v1.0/teams API
- delegated permission
- application permission
Thoughts?