Skip to main content

invitations

Creates, updates, deletes, gets or lists an invitations resource.

Overview​

Nameinvitations
TypeResource
Idgithub.repos.invitations

Fields​

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger (int64)Unique identifier of the repository invitation.
node_idstring
created_atstring (date-time) (example: 2016-06-13T14:52:50-05:00)
expiredbooleanWhether or not the invitation has expired
html_urlstring (example: https://github.com/octocat/Hello-World/invitations)
inviteeobjectA GitHub user. (title: Simple User)
inviterobjectA GitHub user. (title: Simple User)
permissionsstringThe permission associated with the invitation. (read, write, admin, triage, maintain) (example: read)
repositoryobjectMinimal Repository (title: Minimal Repository)
urlstringURL for the repository invitation (example: https://api.github.com/user/repository-invitations/1)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_invitationsselectowner, repoper_page, pageWhen authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations.
list_invitations_for_authenticated_userselectper_page, pageWhen authenticating as a user, this endpoint will list all currently open repository invitations for that user.
update_invitationupdateowner, repo, invitation_id
delete_invitationdeleteowner, repo, invitation_id
accept_invitation_for_authenticated_userexecinvitation_id
decline_invitation_for_authenticated_userexecinvitation_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.

NameDatatypeDescription
invitation_idintegerThe unique identifier of the invitation.
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

SELECT examples​

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 }}'
;

UPDATE examples​

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​

No description available.

DELETE FROM github.repos.invitations
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND invitation_id = '{{ invitation_id }}' --required
;

Lifecycle Methods​

Response

EXEC github.repos.invitations.accept_invitation_for_authenticated_user
@invitation_id='{{ invitation_id }}' --required
;