GitHub v3 REST API

Create a remove token for an organization

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

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

Example using remove token

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

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

Path Parameters

orgstringrequired

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/orgs/{org}/actions/runners/remove-token
 
201 application/json

Get a self-hosted runner for an organization

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

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

get
{protocol}://{hostname}/api/v3/orgs/{org}/actions/runners/{runner_id}

Path Parameters

orgstringrequired
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/orgs/{org}/actions/runners/{runner_id}
 
200 application/json

Delete a self-hosted runner from an organization

Forces the removal of a self-hosted runner from an organization. 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:org scope to use this endpoint.

delete
{protocol}://{hostname}/api/v3/orgs/{org}/actions/runners/{runner_id}

Path Parameters

orgstringrequired
runner_idintegerrequired

Unique identifier of the self-hosted runner.

Response

204

Response

delete/orgs/{org}/actions/runners/{runner_id}
 
204

List organization secrets

Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

get
{protocol}://{hostname}/api/v3/orgs/{org}/actions/secrets

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

orgstringrequired

Response

200 application/json

Response

total_countintegerrequired
secretsarray[object]required

Secrets for GitHub Actions for an organization.

Show Child Parameters
get/orgs/{org}/actions/secrets
 
200 application/json

Get an organization public key

Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

get
{protocol}://{hostname}/api/v3/orgs/{org}/actions/secrets/public-key

Path Parameters

orgstringrequired

Response

200 application/json

Response

ActionsPublicKey

The public key used for setting Actions Secrets.

key_idstringrequired

The identifier for the key.

Example:1234567

keystringrequired

The Base64 encoded public key.

Example:hBT5WZEj8ZoOv6TYJsfWq7MxTEQopZO5/IT3ZCVQPzs=

idinteger

Example:2

urlstring

Example:https://api.github.com/user/keys/2

titlestring

Example:ssh-rsa AAAAB3NzaC1yc2EAAA

created_atstring

Example:2011-01-26T19:01:12Z

get/orgs/{org}/actions/secrets/public-key
 
200 application/json