invitations
Creates, updates, deletes, gets or lists an invitations resource.
Overview
| Name | invitations |
| Type | Resource |
| Id | github.repos.invitations |
Fields
The following fields are returned by SELECT queries:
- list_invitations
- list_invitations_for_authenticated_user
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | Unique identifier of the repository invitation. |
node_id | string | |
created_at | string (date-time) | (example: 2016-06-13T14:52:50-05:00) |
expired | boolean | Whether or not the invitation has expired |
html_url | string | (example: https://github.com/octocat/Hello-World/invitations) |
invitee | object | A GitHub user. (title: Simple User) |
inviter | object | A GitHub user. (title: Simple User) |
permissions | string | The permission associated with the invitation. (read, write, admin, triage, maintain) (example: read) |
repository | object | Minimal Repository (title: Minimal Repository) |
url | string | URL for the repository invitation (example: https://api.github.com/user/repository-invitations/1) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | Unique identifier of the repository invitation. |
node_id | string | |
created_at | string (date-time) | (example: 2016-06-13T14:52:50-05:00) |
expired | boolean | Whether or not the invitation has expired |
html_url | string | (example: https://github.com/octocat/Hello-World/invitations) |
invitee | object | A GitHub user. (title: Simple User) |
inviter | object | A GitHub user. (title: Simple User) |
permissions | string | The permission associated with the invitation. (read, write, admin, triage, maintain) (example: read) |
repository | object | Minimal Repository (title: Minimal Repository) |
url | string | URL for the repository invitation (example: https://api.github.com/user/repository-invitations/1) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_invitations | select | owner, repo | per_page, page | When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. |
list_invitations_for_authenticated_user | select | per_page, page | When authenticating as a user, this endpoint will list all currently open repository invitations for that user. | |
update_invitation | update | owner, repo, invitation_id | ||
delete_invitation | delete | owner, repo, invitation_id | ||
accept_invitation_for_authenticated_user | exec | invitation_id | ||
decline_invitation_for_authenticated_user | exec | invitation_id |
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 |
|---|---|---|
invitation_id | integer | The unique identifier of the invitation. |
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
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_invitations
- list_invitations_for_authenticated_user
When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations.
SELECT
id,
node_id,
created_at,
expired,
html_url,
invitee,
inviter,
permissions,
repository,
url
FROM github.repos.invitations
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
When authenticating as a user, this endpoint will list all currently open repository invitations for that user.
SELECT
id,
node_id,
created_at,
expired,
html_url,
invitee,
inviter,
permissions,
repository,
url
FROM github.repos.invitations
WHERE per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
UPDATE examples
- update_invitation
No description available.
UPDATE github.repos.invitations
SET
permissions = '{{ permissions }}'
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND invitation_id = '{{ invitation_id }}' --required
RETURNING
id,
node_id,
created_at,
expired,
html_url,
invitee,
inviter,
permissions,
repository,
url;
DELETE examples
- delete_invitation
No description available.
DELETE FROM github.repos.invitations
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND invitation_id = '{{ invitation_id }}' --required
;
Lifecycle Methods
- accept_invitation_for_authenticated_user
- decline_invitation_for_authenticated_user
Response
EXEC github.repos.invitations.accept_invitation_for_authenticated_user
@invitation_id='{{ invitation_id }}' --required
;
Response
EXEC github.repos.invitations.decline_invitation_for_authenticated_user
@invitation_id='{{ invitation_id }}' --required
;