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)
Reports.Read.All
Not available.
Delegated (personal Microsoft account)
Not supported.
Not supported.
Application
Reports.Read.All
Not available.
Note: For delegated permissions to allow apps to read service usage reports on behalf of a user, the tenant administrator must have assigned the user the appropriate Microsoft Entra ID limited administrator role. For more information, see Authorization for APIs to read Microsoft 365 usage reports.
HTTP request
GET /reports/getTeamsTeamCounts(period='{period_value}')
Function parameters
In the request URL, provide the following parameters with a valid value.
Parameter
Type
Description
period
string
Specifies the length of time over which the report is aggregated. The supported values for {period_value} are: D7, D30, D90, and D180. These values follow the format Dn, where n represents the number of days over which the report is aggregated. Required.
If successful, this method returns a 302 Found response that redirects to a pre-authenticated download URL for the report. That URL can be found in the Location header in the response.
Pre-authenticated download URLs are only valid for a short period (a few minutes) and don't require an Authorization header.
The CSV file has the following headers for columns:
GET https://graph.microsoft.com/beta/reports/getTeamsTeamCounts(period='D7')?$format=text/csv
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Reports.GetTeamsTeamCountsWithPeriod("{period}").GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Format = "text/csv";
});
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphreports "github.com/microsoftgraph/msgraph-beta-sdk-go/reports"
//other-imports
)
requestFormat := "text/csv"
requestParameters := &graphreports.ReportsGetTeamsTeamCountsWithPeriodRequestBuilderGetQueryParameters{
Format: &requestFormat,
}
configuration := &graphreports.ReportsGetTeamsTeamCountsWithPeriodRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
period := "{period}"
graphClient.Reports().GetTeamsTeamCountsWithPeriod(&period).Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
graphClient.reports().getTeamsTeamCountsWithPeriod("{period}").get(requestConfiguration -> {
requestConfiguration.queryParameters.format = "text/csv";
});
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.reports.get_teams_team_counts(period='{period}').get_teams_team_counts_with_period_request_builder import GetTeamsTeamCountsWithPeriodRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = GetTeamsTeamCountsWithPeriodRequestBuilder.GetTeamsTeamCountsWithPeriodRequestBuilderGetQueryParameters(
format = "text/csv",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
await graph_client.reports.get_teams_team_counts_with_period("{period}").get(request_configuration = request_configuration)
HTTP/1.1 302 Found
Content-Type: text/plain
Location: https://reports.office.com/data/download/JDFKdf2_eJXKS034dbc7e0t__XDe
Follow the 302 redirection and the CSV file that downloads have the following schema.
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Report Refresh Date,Report Date,Public Teams,Active Public Teams,Private Teams,Active Private Teams