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 on Feb 19th 2021 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 I am using looks like. I used the sample provided in this documentation: https://learn.microsoft.com/en-us/graph/api/team-post?view=graph-rest-1.0&tabs=http
POST https://graph.microsoft.com/v1.0/teams
{
"******@odata.bind": "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": [
{
"******@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')",
"displayName": "A Pinned Website",
"configuration": {
"contentUrl": "https://learn.microsoft.com/microsoftteams/microsoft-teams"
}
},
{
"******@odata.bind": "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": [
{
"******@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')"
},
{
"******@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')"
}
]
}
This is what the error response includes:
{
"error":{
"code":"BadRequest",
"message":"Failed to execute Templates backend request CreateTeamFromTemplateRequest. Request Url: https://teams.microsoft.com/fabric/emea/templates/api/team, Request Method: POST, Response Status Code: BadRequest, Response Headers: Strict-Transport-Security: max-age=2592000x-operationid: 32e057e44a0d6f4db6573946dc15fcfdx-telemetryid: 00-32e057e44a0d6f4db6573946dc15fcfd-20ade0692a92db46-00X-MSEdge-Ref: Ref A: 8AECC984E039443AB1E83EF82CD13757 Ref B: DB3EDGE0719 Ref C: 2021-02-20T07:00:06ZDate: Sat, 20 Feb 2021 07:00:06 GMT, ErrorMessage : {\"errors\":[{\"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\"}],\"operationId\":\"32e057e44a0d6f4db6573946dc15fcfd\"}",
"innerError":{
"date":"2021-02-20T07:00:06",
"request-id":"7cb1cac4-9618-4ea6-baf0-9c415ad4a20c",
"client-request-id":"146e1b6f-49ed-91ed-82c1-1691a5ca21ad"
}
}
}
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