Showing results for 
Search instead for 
Did you mean: 
Super User
Super User

Creating a private channel in HTTP request does not generate sharepoint site



Im having some issue here, i know the creating of private channel using microsoft graph is in beta.

So i create a team and then i create a private channel in this team using a HTTP request posting to microsoft graph, everything works as it should and the private channel is created.


But the SharePoint site for the private channel is not generated until you actually open the Teams app and go to the private channel and click on the files tab. Then it generates the SharePoint site.


I know this was an issue before when creating a Team using the same method.

Please if anyone know how i can trigger a interaction or something so the SharePoint site starts to generate on the private channel in Teams?

Community Support
Community Support

Hi @JimmyWork ,


Could you please share a screenshot of the configuration of your flow?


Best regards,
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


@v-alzhan-msft Here comes my flow, i have made it as small as possible for test.

The issue is that the private channel site is never generated until i manually opens teams and visit the channel. So i cant get any data from the private channel except channel id, but not siteID or drive id and so on because they are not generated until you open the channel in Teams for the first time.


I can add that if i post everything in graph explorer it works but creating it using a HTTP in flow to graph will not give the same result.


2020-02-05 14_17_53-.png


If you try to use get list or anything on the private channel it will fail because it's not created. And there is no provisioning time for it it's just created when you open the channel, thats the only trigger i found.


Get list to private channel webURL

"message": "We didn't find a site with this address. Make sure you are entering the exact address of the site.\r\nclientRequestId:


The issue is like this:


Except for private channel the SharePoint site is not generated until you visit the files tab in the private channel. This really creates issues because i can never create folders or anything in that private channel in flow as it will fail because the SharePoint site have not been generated even if the channel is created.

No one?

Regular Visitor

No one?

Frequent Visitor

Is there a solution for this? We're facing the same issue: we can't migrate to private channels which we've created via the Graph API in application context as the SharePoint site isn't created.

There is a solution to this as we have implemented something like this in one of our solutions, I believe it is using PowerShell. I can check this in Monday and update this post.

Super User
Super User

Currently we have a delay set for 30sec after creating the private channel.
You can also call Documents folder using Microsoft Graph, this would trigger provisioning of the SPO site.

I believe using Get-filesFolder calling the documents folder of the private channel would trigger the provisioning.

I have more than 1,500 private channels, each one in an own Teams. I'm calling "/filesfolder" via a PowerShell script against an AAD app registry with application permissions (Group Read/Write All):

Invoke-RestMethod -Headers @{Authorization = "Bearer $accessToken" } -Uri "$($team.ObjectId)/channels/$($"

Result: time-out and no SharePoint site provisioned.


This is the whole script, even though it doesn't help because it seems like calling "/filesfolder" is not triggering SPO site creation.

$maxRetryCount = 100

#Get the stored credentials from the Windows Credential Store
$credential = Get-PnPStoredCredential -Name 'MyAADApp'
#Connect to SharePoint Online using clientApp and certificate credentials
Connect-PnPOnline -Url "" -ClientId $credential.UserName -Thumbprint $credential.GetNetworkCredential().Password -Tenant "" -ReturnConnection
#Request graph access toeken
$accessToken = Get-PnPGraphAccessToken

#Get teams from projects list
$teams = Get-AzureADGroup -All:$true | Where-Object {$_.MailNickname.StartsWith('MyProjectTeams-')}
#Loop through each team
foreach ($team in $teams) {
    Write-Host $team.DisplayName -ForegroundColor White -BackgroundColor Green
    #Capture critical errors on rowlevel
    try {
        #Get the primary channel
        $primaryChannel = Invoke-RestMethod -Headers @{Authorization = "Bearer $accessToken" } -Uri "$($team.ObjectId)/primaryChannel" -Method 'GET' -ContentType 'application/json' | Select-Object 'displayName', 'id'
        $privateChannels = (Invoke-RestMethod -Headers @{Authorization = "Bearer $accessToken" } -Uri "$($team.ObjectId)/channels?`$filter=membershipType eq `'private`'" -Method 'GET' -ContentType 'application/json').value | Select-Object 'displayName', 'id'
        #Trigger private channel SharePoint Onlinesite creation
        Invoke-RestMethod -Headers @{Authorization = "Bearer $accessToken" } -Uri "$($team.ObjectId)/channels/$($" | Out-Null
        Write-Host $privateChannels
        if($privateChannels -ne $null){
            foreach ($privateChannel in $privateChannels) {
                #Attempt private channel check
                $stopLoop = $false
                [int]$retryCount = '0'
                do {
                    try {
                        Invoke-RestMethod -Headers @{Authorization = "Bearer $accessToken" } -Uri "$($team.ObjectId)/channels/$($"
                        $stopLoop = $true
                    catch {
                        if ($retryCount -gt $maxRetryCount) {
                            $stoploop = $true
                        else {
                            Start-Sleep -Seconds 5
                            $retryCount = $retryCount + 1
                While ($stopLoop -eq $false)
            Write-Host "No private channel. Create the private channel."
    catch {
        Write-Host $_


I will check if I can get our code. And post it

Helpful resources

Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (33,891)