invitations
Creates, updates, deletes, gets or lists an invitations resource.
Overview
| Name | invitations |
| Type | Resource |
| Id | github.teams.invitations |
Fields
The following fields are returned by SELECT queries:
- list_pending_invitations_in_org
- list_pending_invitations_legacy
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | |
node_id | string | (example: "MDIyOk9yZ2FuaXphdGlvbkludml0YXRpb24x") |
created_at | string | |
email | string | |
failed_at | string | |
failed_reason | string | |
invitation_source | string | (example: "member") |
invitation_teams_url | string | (example: "https://api.github.com/organizations/16/invitations/1/teams") |
inviter | object | A GitHub user. (title: Simple User) |
login | string | |
role | string | |
team_count | integer |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | |
node_id | string | (example: "MDIyOk9yZ2FuaXphdGlvbkludml0YXRpb24x") |
created_at | string | |
email | string | |
failed_at | string | |
failed_reason | string | |
invitation_source | string | (example: "member") |
invitation_teams_url | string | (example: "https://api.github.com/organizations/16/invitations/1/teams") |
inviter | object | A GitHub user. (title: Simple User) |
login | string | |
role | string | |
team_count | integer |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_pending_invitations_in_org | select | org, team_slug | per_page, page | 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. |
list_pending_invitations_legacy | select | team_id | per_page, page | > [!WARNING] > Endpoint closing down notice: This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new List pending team invitations endpoint.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. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
org | string | The organization name. The name is not case sensitive. |
team_id | integer | The unique identifier of the team. |
team_slug | string | The slug of the team name. |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- list_pending_invitations_in_org
- list_pending_invitations_legacy
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.
SELECT
id,
node_id,
created_at,
email,
failed_at,
failed_reason,
invitation_source,
invitation_teams_url,
inviter,
login,
role,
team_count
FROM github.teams.invitations
WHERE org = '{{ org }}' -- required
AND team_slug = '{{ team_slug }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
> [!WARNING]
> Endpoint closing down notice: This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new List pending team invitations endpoint.
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.
SELECT
id,
node_id,
created_at,
email,
failed_at,
failed_reason,
invitation_source,
invitation_teams_url,
inviter,
login,
role,
team_count
FROM github.teams.invitations
WHERE team_id = '{{ team_id }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;