GitHub v3 REST API

List repository invitations

When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations.

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/invitations

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

ownerstringrequired
repostringrequired

Response

200 application/json

Response

Repository invitations let you manage who you collaborate with.

idintegerrequired

Unique identifier of the repository invitation.

Example:42

repositoryobjectrequired

Minimal Repository

Show Child Parameters
inviteeobject | nullrequired

Simple User

Show Child Parameters
inviterobject | nullrequired

Simple User

Show Child Parameters
permissionsstringrequired

The permission associated with the invitation.

Allowed values:readwriteadmintriagemaintain

Example:read

created_atstring(date-time)required

Example:2016-06-13T14:52:50-05:00

expiredboolean

Whether or not the invitation has expired

urlstringrequired

URL for the repository invitation

Example:https://api.github.com/user/repository-invitations/1

html_urlstringrequired

Example:https://github.com/octocat/Hello-World/invitations

node_idstringrequired
get/repos/{owner}/{repo}/invitations
 
200 application/json

Update a repository invitation

patch
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/invitations/{invitation_id}

Path Parameters

ownerstringrequired
repostringrequired
invitation_idintegerrequired

invitation_id parameter

Body

application/json
permissionsstring

The permissions that the associated user will have on the repository. Valid values are read, write, maintain, triage, and admin.

Allowed values:readwritemaintaintriageadmin

Response

200 application/json

Response

Repository Invitation

Repository invitations let you manage who you collaborate with.

idintegerrequired

Unique identifier of the repository invitation.

Example:42

repositoryobjectrequired

Minimal Repository

Show Child Parameters
inviteeobject | nullrequired

Simple User

Show Child Parameters
inviterobject | nullrequired

Simple User

Show Child Parameters
permissionsstringrequired

The permission associated with the invitation.

Allowed values:readwriteadmintriagemaintain

Example:read

created_atstring(date-time)required

Example:2016-06-13T14:52:50-05:00

expiredboolean

Whether or not the invitation has expired

urlstringrequired

URL for the repository invitation

Example:https://api.github.com/user/repository-invitations/1

html_urlstringrequired

Example:https://github.com/octocat/Hello-World/invitations

node_idstringrequired
patch/repos/{owner}/{repo}/invitations/{invitation_id}

Body

{}
 
200 application/json

Delete a repository invitation

delete
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/invitations/{invitation_id}

Path Parameters

ownerstringrequired
repostringrequired
invitation_idintegerrequired

invitation_id parameter

Response

204

Response

delete/repos/{owner}/{repo}/invitations/{invitation_id}
 
204

List deploy keys

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/keys

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

ownerstringrequired
repostringrequired

Response

200 application/json

Response

An SSH key granting access to a single repository.

idintegerrequired
keystringrequired
urlstringrequired
titlestringrequired
verifiedbooleanrequired
created_atstringrequired
read_onlybooleanrequired
get/repos/{owner}/{repo}/keys
 
200 application/json

Create a deploy key

You can create a read-only deploy key.

post
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/keys

Path Parameters

ownerstringrequired
repostringrequired

Body

application/json
titlestring

A name for the key.

keystringrequired

The contents of the key.

read_onlyboolean

If true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.

Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see “Repository permission levels for an organization” and “Permission levels for a user account repository.”

Response

application/json

Response

Deploy Key

An SSH key granting access to a single repository.

idintegerrequired
keystringrequired
urlstringrequired
titlestringrequired
verifiedbooleanrequired
created_atstringrequired
read_onlybooleanrequired
post/repos/{owner}/{repo}/keys

Body

{ "title": "octocat@octomac", "key": "ssh-rsa AAA...", "read_only": true }
 
application/json