GitHub v3 REST API

Create a remove token for an enterprise

Returns a token that you can pass to the config script to remove a self-hosted runner from an enterprise. The token expires after one hour.

You must authenticate using an access token with the admin:enterprise scope to use this endpoint.

Example using remove token

To remove your self-hosted runner from an enterprise, replace TOKEN with the remove token provided by this
endpoint.

./config.sh remove --token TOKEN
post
{protocol}://{hostname}/api/v3/enterprises/{enterprise}/actions/runners/remove-token

Path Parameters

enterprisestringrequired

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

Response

201 application/json

Response

Authentication Token

Authentication Token

tokenstringrequired

The token used for authentication

Example:v1.1f699f1069f60xxx

expires_atstring(date-time)required

The time this token expires

Example:2016-07-11T22:14:10Z

permissionsobject

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

repositoriesarray[object]

A git repository

Show Child Parameters
single_filestring | null

Example:config.yaml

repository_selectionstring

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

Allowed values:allselected

post/enterprises/{enterprise}/actions/runners/remove-token
 
201 application/json

Get a self-hosted runner for an enterprise

Gets a specific self-hosted runner configured in an enterprise.

You must authenticate using an access token with the admin:enterprise scope to use this endpoint.

get
{protocol}://{hostname}/api/v3/enterprises/{enterprise}/actions/runners/{runner_id}

Path Parameters

enterprisestringrequired

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

runner_idintegerrequired

Unique identifier of the self-hosted runner.

Response

200 application/json

Response

Self hosted runners

A self hosted runner

idintegerrequired

The id of the runner.

Example:5

namestringrequired

The name of the runner.

Example:iMac

osstringrequired

The Operating System of the runner.

Example:macos

statusstringrequired

The status of the runner.

Example:online

busybooleanrequired
labelsarray[object]required

A label for a self hosted runner

Show Child Parameters
get/enterprises/{enterprise}/actions/runners/{runner_id}
 
200 application/json

Delete a self-hosted runner from an enterprise

Forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.

You must authenticate using an access token with the admin:enterprise scope to use this endpoint.

delete
{protocol}://{hostname}/api/v3/enterprises/{enterprise}/actions/runners/{runner_id}

Path Parameters

enterprisestringrequired

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

runner_idintegerrequired

Unique identifier of the self-hosted runner.

Response

204

Response

delete/enterprises/{enterprise}/actions/runners/{runner_id}
 
204

List pre-receive hooks for an organization

List all pre-receive hooks that are enabled or testing for this organization as well as any disabled hooks that can be configured at the organization level. Globally disabled pre-receive hooks that do not allow downstream configuration are not listed.

get
{protocol}://{hostname}/api/v3/orgs/{org}/pre-receive-hooks

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

directionstring

One of asc (ascending) or desc (descending).

Allowed values:ascdesc

Default:desc

sortstring

The sort order for the response collection.

Allowed values:createdupdatedname

Default:created

Path Parameters

orgstringrequired

Response

200 application/json

Response

idinteger
namestring
enforcementstring
configuration_urlstring
allow_downstream_configurationboolean
get/orgs/{org}/pre-receive-hooks
 
200 application/json

Get a pre-receive hook for an organization

get
{protocol}://{hostname}/api/v3/orgs/{org}/pre-receive-hooks/{pre_receive_hook_id}

Path Parameters

orgstringrequired
pre_receive_hook_idintegerrequired

pre_receive_hook_id parameter

Response

200 application/json

Response

org-pre-receive-hook

idinteger
namestring
enforcementstring
configuration_urlstring
allow_downstream_configurationboolean
get/orgs/{org}/pre-receive-hooks/{pre_receive_hook_id}
 
200 application/json