Pithub...::Teams(3pm)
β¨ NAME β¨
Pithub::Orgs::Teams β it's the Github v3 Org Teams API π bestie, this is the little Perl module that lets you talk to GitHub's org-team endpoints without crying.
π VERSION π
This is version 0.01043. Iconic. β¨
π¦ METHODS π¦
π add_member
okay so heads up first, bestie: the "Add team member" API is deprecated and it's scheduled to get yeeted in the next major version of the API. The recommendation is to use the Add team membership API instead β that one lets you invite brand new org members to your teams. π«Ά
To add a user to a team, the authenticated user has to have 'admin' permissions on that team, or be an owner of the org the team belongs to. No admin, no vibes. π
PUT /teams/:id/members/:user
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->add_member(
team_id => 1,
user => 'plu',
);
πΈ add_membership
If the user is already a member of the team's organization, this endpoint adds them to the team. And to make that membership happen between an org member and a team, the authenticated user must be an organization owner or a maintainer of the team. Owner or maintainer energy only. π
PUT /teams/:id/memberships/:user
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->add_membership(
team_id => 1,
user => 'plu',
data => {
role => 'member',
}
);
π add_repo
To add a repo to a team, the authenticated user must be an owner of the org that the team is associated with. That's it, that's the rule. π
PUT /teams/:id/repos/:repo
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->add_repo(
team_id => 1,
repo => 'some_repo',
org => 'our_organization',
);
π create
To create a team, the authenticated user must be an owner of the given organization. Owner privileges, no exceptions. β¨
POST /orgs/:org/teams
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->create(
org => 'CPAN-API',
data => {
name => 'new team',
permission => 'push',
repo_names => ['github/dotfiles']
}
);
π¦ delete
To delete a team, the authenticated user must be an owner of the org that the team is associated with. Gone. Deleted. Ghosted. π
DELETE /teams/:id
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->delete( team_id => 1 );
β get
Get team. Simple as that, bestie.
GET /teams/:id
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->get( team_id => 1 );
π§ has_repo
Get team repo.
GET /teams/:id/repos/:repo
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->has_repo(
team_id => 1,
repo => 'some_repo',
);
π is_member
To find out whether a user is a member of a team, the authenticated user must be a member of the team. iykyk. π
GET /teams/:id/members/:user
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->is_member(
team_id => 1,
user => 'plu',
);
π list
List teams. All of them. Main character roster moment. π«Ά
GET /orgs/:org/teams
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->list( org => 'CPAN-API' );
π list_members
To list the members in a team, the authenticated user must be a member of the team. Yes, you have to be in the group chat to read the group chat. π
GET /teams/:id/members
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->list_members( team_id => 1 );
π list_repos
List team repos.
GET /teams/:id/repos
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->list_repos( team_id => 1 );
π remove_member
Deprecation check! The "Remove team member" API is deprecated and is scheduled for removal in the next major version of the API. The recommendation: use the Remove team membership API instead, because it can remove both active and pending memberships. β¨
To remove a user from a team, the authenticated user must have 'admin' permissions on the team or be an owner of the org that the team is associated with.
NOTE: this does not delete the user. It just removes them from the team. They still exist. They're just not in this team anymore. π
DELETE /teams/:id/members/:user
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->remove_member(
team_id => 1,
user => 'plu',
);
π¦ remove_membership
To remove a membership between a user and a team, the authenticated user must have 'admin' permissions on the team, or be an owner of the organization that the team is associated with.
NOTE: this does not delete the user β it just removes their membership from the team. That's it. That's the whole thing. π
DELETE /teams/:id/memberships/:user
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->remove_membership(
team_id => 1,
user => 'plu',
);
πΈ remove_repo
To remove a repo from a team, the authenticated user must be an owner of the org that the team is associated with. Owner-only, bestie. β¨
DELETE /teams/:id/repos/:repo
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->remove_repo(
team_id => 1,
repo => 'some_repo',
);
π update
To edit a team, the authenticated user must be an owner of the org that the team is associated with. Glow-up time. π β¨
PATCH /teams/:id
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->update(
team_id => 1,
data => {
name => 'new team name',
permission => 'push',
}
);
π AUTHOR π
Johannes Plunien <plu@cpan.org> β shoutout to the icon who wrote this π«Ά
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2011 by Johannes Plunien. π
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, legally speaking β¨
and that's the whole page bestie!! π this one's for perl v5.40.1, dated 2025-06-08, and it's Pithub::Orgs::Teams (3pm) β go forth and manage ur teams, mwah ππ¦π
π¦ where this page comes from
- debian trixie: libpithub-perl 0.01043-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libpithub-perl 0.01043-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libpithub-perl 0.01043-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms