Search code examples
javascriptrestmicrosoft-graph-apimicrosoft-teams

Creating a private Teams channel in Migration Mode using Graph API


I have been tasked with migrating an existing Teams where all the channels are in a "Standard" membershipType, to a new Teams where all the channels are in a "Private" membershipType. The reason behind this is because Microsoft don't seem to let you just change the type after it's already been created.

Now the problem I'm having is that whenever I try to create a new channel in Migration Mode, it automatically creates it as "Standard" despite specifying "Private" in the payload. I can create a Private channel in an already established channel, however it doesn't let you put it back in to Migration Mode once Migration has already been completed. Has anyone else come across this issue?

The payload I am sending:

{
          "@microsoft.graph.channelCreationMode": "migration",
          "displayName": displayName,
          "description": description,
          "membershipType": "private",
          "createdDateTime": date,
          "members":
          [
              {
                "@odata.type":"#microsoft.graph.aadUserConversationMember",
                "user@odata.bind":"https://graph.microsoft.com/v1.0/users('XXXXXXXXXXXXXXXX')",
                "roles":["owner"]
              }
          ]
}

The response I get when I do a GET request on the newly created channel:

{
            "id": "id",
            "createdDateTime": "2023-10-26T08:25:24.739Z",
            "displayName": "displayName",
            "description": "description",
            "isFavoriteByDefault": null,
            "email": null,
            "tenantId": "tenantId",
            "webUrl": "webUrl",
            "membershipType": "standard"
        }

Solution

  • Please note that creating private channel is currently not supported.