GitHub v6.8.1 published on Saturday, Nov 1, 2025 by Pulumi
github.getOrganizationTeams
Start a Neo task
Explain and create a github.getOrganizationTeams resource
Use this data source to retrieve information about all GitHub teams in an organization.
Example Usage
To retrieve all teams of the organization:
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const all = github.getOrganizationTeams({});
import pulumi
import pulumi_github as github
all = github.get_organization_teams()
package main
import (
"github.com/pulumi/pulumi-github/sdk/v6/go/github"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := github.GetOrganizationTeams(ctx, &github.GetOrganizationTeamsArgs{}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var all = Github.GetOrganizationTeams.Invoke();
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.GithubFunctions;
import com.pulumi.github.inputs.GetOrganizationTeamsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var all = GithubFunctions.getOrganizationTeams(GetOrganizationTeamsArgs.builder()
.build());
}
}
variables:
all:
fn::invoke:
function: github:getOrganizationTeams
arguments: {}
To retrieve only the team’s at the root of the organization:
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const rootTeams = github.getOrganizationTeams({
rootTeamsOnly: true,
});
import pulumi
import pulumi_github as github
root_teams = github.get_organization_teams(root_teams_only=True)
package main
import (
"github.com/pulumi/pulumi-github/sdk/v6/go/github"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := github.GetOrganizationTeams(ctx, &github.GetOrganizationTeamsArgs{
RootTeamsOnly: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var rootTeams = Github.GetOrganizationTeams.Invoke(new()
{
RootTeamsOnly = true,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.GithubFunctions;
import com.pulumi.github.inputs.GetOrganizationTeamsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var rootTeams = GithubFunctions.getOrganizationTeams(GetOrganizationTeamsArgs.builder()
.rootTeamsOnly(true)
.build());
}
}
variables:
rootTeams:
fn::invoke:
function: github:getOrganizationTeams
arguments:
rootTeamsOnly: true
Using getOrganizationTeams
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getOrganizationTeams(args: GetOrganizationTeamsArgs, opts?: InvokeOptions): Promise<GetOrganizationTeamsResult>
function getOrganizationTeamsOutput(args: GetOrganizationTeamsOutputArgs, opts?: InvokeOptions): Output<GetOrganizationTeamsResult>def get_organization_teams(results_per_page: Optional[int] = None,
root_teams_only: Optional[bool] = None,
summary_only: Optional[bool] = None,
opts: Optional[InvokeOptions] = None) -> GetOrganizationTeamsResult
def get_organization_teams_output(results_per_page: Optional[pulumi.Input[int]] = None,
root_teams_only: Optional[pulumi.Input[bool]] = None,
summary_only: Optional[pulumi.Input[bool]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetOrganizationTeamsResult]func GetOrganizationTeams(ctx *Context, args *GetOrganizationTeamsArgs, opts ...InvokeOption) (*GetOrganizationTeamsResult, error)
func GetOrganizationTeamsOutput(ctx *Context, args *GetOrganizationTeamsOutputArgs, opts ...InvokeOption) GetOrganizationTeamsResultOutput> Note: This function is named GetOrganizationTeams in the Go SDK.
public static class GetOrganizationTeams
{
public static Task<GetOrganizationTeamsResult> InvokeAsync(GetOrganizationTeamsArgs args, InvokeOptions? opts = null)
public static Output<GetOrganizationTeamsResult> Invoke(GetOrganizationTeamsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetOrganizationTeamsResult> getOrganizationTeams(GetOrganizationTeamsArgs args, InvokeOptions options)
public static Output<GetOrganizationTeamsResult> getOrganizationTeams(GetOrganizationTeamsArgs args, InvokeOptions options)
fn::invoke:
function: github:index/getOrganizationTeams:getOrganizationTeams
arguments:
# arguments dictionaryThe following arguments are supported:
- Results
Per intPage - (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to
100. - Root
Teams boolOnly - (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to
false. - Summary
Only bool - (Optional) Exclude the members and repositories of the team from the returned result. Defaults to
false.
- Results
Per intPage - (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to
100. - Root
Teams boolOnly - (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to
false. - Summary
Only bool - (Optional) Exclude the members and repositories of the team from the returned result. Defaults to
false.
- results
Per IntegerPage - (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to
100. - root
Teams BooleanOnly - (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to
false. - summary
Only Boolean - (Optional) Exclude the members and repositories of the team from the returned result. Defaults to
false.
- results
Per numberPage - (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to
100. - root
Teams booleanOnly - (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to
false. - summary
Only boolean - (Optional) Exclude the members and repositories of the team from the returned result. Defaults to
false.
- results_
per_ intpage - (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to
100. - root_
teams_ boolonly - (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to
false. - summary_
only bool - (Optional) Exclude the members and repositories of the team from the returned result. Defaults to
false.
- results
Per NumberPage - (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to
100. - root
Teams BooleanOnly - (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to
false. - summary
Only Boolean - (Optional) Exclude the members and repositories of the team from the returned result. Defaults to
false.
getOrganizationTeams Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Teams
List<Get
Organization Teams Team> - (Required) An Array of GitHub Teams. Each
teamblock consists of the fields documented below. - Results
Per intPage - (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to
100. - Root
Teams boolOnly - (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to
false. - Summary
Only bool - (Optional) Exclude the members and repositories of the team from the returned result. Defaults to
false.
- Id string
- The provider-assigned unique ID for this managed resource.
- Teams
[]Get
Organization Teams Team - (Required) An Array of GitHub Teams. Each
teamblock consists of the fields documented below. - Results
Per intPage - (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to
100. - Root
Teams boolOnly - (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to
false. - Summary
Only bool - (Optional) Exclude the members and repositories of the team from the returned result. Defaults to
false.
- id String
- The provider-assigned unique ID for this managed resource.
- teams
List<Get
Organization Teams Team> - (Required) An Array of GitHub Teams. Each
teamblock consists of the fields documented below. - results
Per IntegerPage - (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to
100. - root
Teams BooleanOnly - (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to
false. - summary
Only Boolean - (Optional) Exclude the members and repositories of the team from the returned result. Defaults to
false.
- id string
- The provider-assigned unique ID for this managed resource.
- teams
Get
Organization Teams Team[] - (Required) An Array of GitHub Teams. Each
teamblock consists of the fields documented below. - results
Per numberPage - (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to
100. - root
Teams booleanOnly - (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to
false. - summary
Only boolean - (Optional) Exclude the members and repositories of the team from the returned result. Defaults to
false.
- id str
- The provider-assigned unique ID for this managed resource.
- teams
Sequence[Get
Organization Teams Team] - (Required) An Array of GitHub Teams. Each
teamblock consists of the fields documented below. - results_
per_ intpage - (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to
100. - root_
teams_ boolonly - (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to
false. - summary_
only bool - (Optional) Exclude the members and repositories of the team from the returned result. Defaults to
false.
- id String
- The provider-assigned unique ID for this managed resource.
- teams List<Property Map>
- (Required) An Array of GitHub Teams. Each
teamblock consists of the fields documented below. - results
Per NumberPage - (Optional) Set the number of results per graphql query. Reducing this number can alleviate timeout errors. Accepts a value between 0 - 100. Defaults to
100. - root
Teams BooleanOnly - (Optional) Only return teams that are at the organization's root, i.e. no nested teams. Defaults to
false. - summary
Only Boolean - (Optional) Exclude the members and repositories of the team from the returned result. Defaults to
false.
Supporting Types
GetOrganizationTeamsTeam
- Description string
- The team's description.
- Id int
- The ID of the team.
- Members List<string>
- List of team members. Not returned if
summary_only </span>= true - Name string
- The team's full name.
- Node
Id string - The Node ID of the team.
- Parent Dictionary<string, string>
- (DEPRECATED) The parent team, use
parent_team_idorparent_team_sluginstead. - Parent
Team stringId - The ID of the parent team, if there is one.
- Parent
Team stringSlug - The slug of the parent team, if there is one.
- Privacy string
- The team's privacy type.
- Repositories List<string>
- List of team repositories. Not returned if
summary_only </span>= true - Slug string
- The slug of the team.
- Description string
- The team's description.
- Id int
- The ID of the team.
- Members []string
- List of team members. Not returned if
summary_only </span>= true - Name string
- The team's full name.
- Node
Id string - The Node ID of the team.
- Parent map[string]string
- (DEPRECATED) The parent team, use
parent_team_idorparent_team_sluginstead. - Parent
Team stringId - The ID of the parent team, if there is one.
- Parent
Team stringSlug - The slug of the parent team, if there is one.
- Privacy string
- The team's privacy type.
- Repositories []string
- List of team repositories. Not returned if
summary_only </span>= true - Slug string
- The slug of the team.
- description String
- The team's description.
- id Integer
- The ID of the team.
- members List<String>
- List of team members. Not returned if
summary_only </span>= true - name String
- The team's full name.
- node
Id String - The Node ID of the team.
- parent Map<String,String>
- (DEPRECATED) The parent team, use
parent_team_idorparent_team_sluginstead. - parent
Team StringId - The ID of the parent team, if there is one.
- parent
Team StringSlug - The slug of the parent team, if there is one.
- privacy String
- The team's privacy type.
- repositories List<String>
- List of team repositories. Not returned if
summary_only </span>= true - slug String
- The slug of the team.
- description string
- The team's description.
- id number
- The ID of the team.
- members string[]
- List of team members. Not returned if
summary_only </span>= true - name string
- The team's full name.
- node
Id string - The Node ID of the team.
- parent {[key: string]: string}
- (DEPRECATED) The parent team, use
parent_team_idorparent_team_sluginstead. - parent
Team stringId - The ID of the parent team, if there is one.
- parent
Team stringSlug - The slug of the parent team, if there is one.
- privacy string
- The team's privacy type.
- repositories string[]
- List of team repositories. Not returned if
summary_only </span>= true - slug string
- The slug of the team.
- description str
- The team's description.
- id int
- The ID of the team.
- members Sequence[str]
- List of team members. Not returned if
summary_only </span>= true - name str
- The team's full name.
- node_
id str - The Node ID of the team.
- parent Mapping[str, str]
- (DEPRECATED) The parent team, use
parent_team_idorparent_team_sluginstead. - parent_
team_ strid - The ID of the parent team, if there is one.
- parent_
team_ strslug - The slug of the parent team, if there is one.
- privacy str
- The team's privacy type.
- repositories Sequence[str]
- List of team repositories. Not returned if
summary_only </span>= true - slug str
- The slug of the team.
- description String
- The team's description.
- id Number
- The ID of the team.
- members List<String>
- List of team members. Not returned if
summary_only </span>= true - name String
- The team's full name.
- node
Id String - The Node ID of the team.
- parent Map<String>
- (DEPRECATED) The parent team, use
parent_team_idorparent_team_sluginstead. - parent
Team StringId - The ID of the parent team, if there is one.
- parent
Team StringSlug - The slug of the parent team, if there is one.
- privacy String
- The team's privacy type.
- repositories List<String>
- List of team repositories. Not returned if
summary_only </span>= true - slug String
- The slug of the team.
Package Details
- Repository
- GitHub pulumi/pulumi-github
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
githubTerraform Provider.
