GitHub v3 REST API

Revoke an installation access token

Revokes the installation token you’re using to authenticate as an installation and access this endpoint.

Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the “Create an installation access token for an app” endpoint.

You must use an installation access token to access this endpoint.

delete
{protocol}://{hostname}/api/v3/installation/token

Response

204

Response

delete/installation/token
 
204

Get an organization installation for the authenticated app

Enables an authenticated GitHub App to find the organization’s installation information.

You must use a JWT to access this endpoint.

get
{protocol}://{hostname}/api/v3/orgs/{org}/installation

Path Parameters

orgstringrequired

Response

200 application/json

Response

Installation

Installation

idintegerrequired

The ID of the installation.

Example:1

accountAny Of
required
Simple Userobject

Simple User

Show Child Parameters
repository_selectionstringrequired

Describe whether all repositories have been selected or there’s a selection involved

Allowed values:allselected

access_tokens_urlstring(uri)required

Example:https://api.github.com/installations/1/access_tokens

repositories_urlstring(uri)required

Example:https://api.github.com/installation/repositories

html_urlstring(uri)required

Example:https://github.com/organizations/github/settings/installations/1

app_idintegerrequired

Example:1

target_idintegerrequired

The ID of the user or organization this token is being scoped to.

target_typestringrequired

Example:Organization

permissionsobjectrequired

The permissions granted to the user-to-server access token.

Example:{"contents":"read","issues":"read","deployments":"write","single_file":"read"}

Show Child Parameters
eventsarray[string]required
created_atstring(date-time)required
updated_atstring(date-time)required
single_file_namestring | nullrequired

Example:config.yaml

has_multiple_single_filesboolean

Example:true

single_file_pathsarray[string]

Example:["config.yml",".github/issue_TEMPLATE.md"]

app_slugstringrequired

Example:github-actions

suspended_byobject | nullrequired

Simple User

Show Child Parameters
suspended_atstring | null(date-time)required
contact_emailstring | null

Example:"test_13f1e99741e3e004@d7e1eb0bc0a1ba12.com"

get/orgs/{org}/installation
 
200 application/json

Create a content attachment

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

The app must create a content attachment within six hours of the content reference URL being posted. See “Using content attachments” for details about content attachments.

You must use an installation access token to access this endpoint.

post
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments

Path Parameters

ownerstringrequired

The owner of the repository. Determined from the repository full_name of the content_reference event.

repostringrequired

The name of the repository. Determined from the repository full_name of the content_reference event.

content_reference_idintegerrequired

The id of the content_reference event.

Body

application/json
titlestringrequired

The title of the attachment

<= 1024 characters

Example:Title of the attachment

bodystringrequired

The body of the attachment

<= 262144 characters

Example:Body of the attachment

Response

application/json

Response

ContentReferenceAttachment

Content Reference attachments allow you to provide context around URLs posted in comments

idintegerrequired

The ID of the attachment

Example:21

titlestringrequired

The title of the attachment

<= 1024 characters

Example:Title of the attachment

bodystringrequired

The body of the attachment

<= 262144 characters

Example:Body of the attachment

node_idstring

The node_id of the content attachment

Example:MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=

post/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments

Body

{ "title": "Title of the attachment", "body": "Body of the attachment" }
 
application/json

Get a repository installation for the authenticated app

Enables an authenticated GitHub App to find the repository’s installation information. The installation’s account type will be either an organization or a user account, depending which account the repository belongs to.

You must use a JWT to access this endpoint.

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

Path Parameters

ownerstringrequired
repostringrequired

Response

application/json

Response

Installation

Installation

idintegerrequired

The ID of the installation.

Example:1

accountAny Of
required
Simple Userobject

Simple User

Show Child Parameters
repository_selectionstringrequired

Describe whether all repositories have been selected or there’s a selection involved

Allowed values:allselected

access_tokens_urlstring(uri)required

Example:https://api.github.com/installations/1/access_tokens

repositories_urlstring(uri)required

Example:https://api.github.com/installation/repositories

html_urlstring(uri)required

Example:https://github.com/organizations/github/settings/installations/1

app_idintegerrequired

Example:1

target_idintegerrequired

The ID of the user or organization this token is being scoped to.

target_typestringrequired

Example:Organization

permissionsobjectrequired

The permissions granted to the user-to-server access token.

Example:{"contents":"read","issues":"read","deployments":"write","single_file":"read"}

Show Child Parameters
eventsarray[string]required
created_atstring(date-time)required
updated_atstring(date-time)required
single_file_namestring | nullrequired

Example:config.yaml

has_multiple_single_filesboolean

Example:true

single_file_pathsarray[string]

Example:["config.yml",".github/issue_TEMPLATE.md"]

app_slugstringrequired

Example:github-actions

suspended_byobject | nullrequired

Simple User

Show Child Parameters
suspended_atstring | null(date-time)required
contact_emailstring | null

Example:"test_13f1e99741e3e004@d7e1eb0bc0a1ba12.com"

get/repos/{owner}/{repo}/installation
 
application/json

List app installations accessible to the user access token

Lists installations of your GitHub App that the authenticated user has explicit permission (:read, :write, or :admin) to access.

You must use a user-to-server OAuth access token, created for a user who has authorized your GitHub App, to access this endpoint.

The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.

You can find the permissions for the installation under the permissions key.

get
{protocol}://{hostname}/api/v3/user/installations

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Response

application/json

You can find the permissions for the installation under the permissions key.

total_countintegerrequired
installationsarray[object]required

Installation

Show Child Parameters
get/user/installations
 
application/json