Pithub...::Teams(3pm)

πŸ“¦
version 0.01043 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

✨ 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 🫢


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