GitHub v3 REST API

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
http://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
http://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
http://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
http://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

Update pre-receive hook enforcement for an organization

For pre-receive hooks which are allowed to be configured at the org level, you can set enforcement and allow_downstream_configuration

patch
http://HOSTNAME/api/v3/orgs/{org}/pre-receive-hooks/{pre_receive_hook_id}

Path Parameters

orgstringrequired
pre_receive_hook_idintegerrequired

pre_receive_hook_id parameter

Body

application/json
enforcementstring

The state of enforcement for the hook on this repository.

allow_downstream_configurationboolean

Whether repositories can override enforcement.

Response

200 application/json

Response

org-pre-receive-hook

idinteger
namestring
enforcementstring
configuration_urlstring
allow_downstream_configurationboolean
patch/orgs/{org}/pre-receive-hooks/{pre_receive_hook_id}

Body

{ "enforcement": "enabled", "allow_downstream_configuration": false }
 
200 application/json