Sample - GitHub REST API
GET/orgs/{org}/teams/{team_slug}/invitations

List pending team invitations

The return hash contains a role field which refers to the Organization Invitation role and will be one of the following values: direct_member, admin, billing_manager, hiring_manager, or reinstate. If the invitee is not a GitHub member, the login field in the return hash will be null.

[!NOTE] You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/invitations.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

4 parameters
orgstringrequired
The organization name. The name is not case sensitive.
team_slugstringrequired
The slug of the team name.
per_pageintegeroptional
The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
Default:30
pageintegeroptional
The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
Default:1

2 status codes
200Response
idintegerrequired
loginstringrequired
emailstringrequired
rolestringrequired
created_atstringrequired
failed_atstringoptional
failed_reasonstringoptional
inviterobjectrequired
A GitHub user.
team_countintegerrequired
node_idstringrequired
invitation_teams_urlstringrequired
invitation_sourcestringoptional
422Unprocessable entity if you attempt to modify an enterprise team at the organization level.

Error handling

A 422 is returned: Unprocessable entity if you attempt to modify an enterprise team at the organization level.