Skip to content

Create a remove token for a repository

POST
/repos/{owner}/{repo}/actions/runners/remove-token

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

For example, you can replace TOKEN in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization:

./config.sh remove --token TOKEN

Authenticated users must have admin access to the repository to use this endpoint.

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

Response

Media type application/json
Authentication Token

Authentication Token

object
token
required

The token used for authentication

string
expires_at
required

The time this token expires

string format: date-time
permissions
object
repositories

The repositories this token has access to

Array<object>
Repository

A repository on GitHub.

object
id
required

Unique identifier of the repository

integer format: int64
node_id
required
string
name
required

The name of the repository.

string
full_name
required
string
license
required
License Simple

License Simple

object
key
required
string
name
required
string
url
required
string format: uri
nullable
spdx_id
required
string
nullable
node_id
required
string
html_url
string format: uri
forks
required
integer
permissions
object
admin
required
boolean
pull
required
boolean
triage
boolean
push
required
boolean
maintain
boolean
owner
required
Simple User

A GitHub user.

object
name
string
nullable
email
string
nullable
login
required
string
id
required
integer format: int64
node_id
required
string
avatar_url
required
string format: uri
gravatar_id
required
string
nullable
url
required
string format: uri
html_url
required
string format: uri
followers_url
required
string format: uri
following_url
required
string
gists_url
required
string
starred_url
required
string
subscriptions_url
required
string format: uri
organizations_url
required
string format: uri
repos_url
required
string format: uri
events_url
required
string
received_events_url
required
string format: uri
type
required
string
site_admin
required
boolean
starred_at
string
user_view_type
string
private
required

Whether the repository is private or public.

boolean
html_url
required
string format: uri
description
required
string
nullable
fork
required
boolean
url
required
string format: uri
archive_url
required
string
assignees_url
required
string
blobs_url
required
string
branches_url
required
string
collaborators_url
required
string
comments_url
required
string
commits_url
required
string
compare_url
required
string
contents_url
required
string
contributors_url
required
string format: uri
deployments_url
required
string format: uri
downloads_url
required
string format: uri
events_url
required
string format: uri
forks_url
required
string format: uri
git_commits_url
required
string
git_refs_url
required
string
git_tags_url
required
string
git_url
required
string
issue_comment_url
required
string
issue_events_url
required
string
issues_url
required
string
keys_url
required
string
labels_url
required
string
languages_url
required
string format: uri
merges_url
required
string format: uri
milestones_url
required
string
notifications_url
required
string
pulls_url
required
string
releases_url
required
string
ssh_url
required
string
stargazers_url
required
string format: uri
statuses_url
required
string
subscribers_url
required
string format: uri
subscription_url
required
string format: uri
tags_url
required
string format: uri
teams_url
required
string format: uri
trees_url
required
string
clone_url
required
string
mirror_url
required
string format: uri
nullable
hooks_url
required
string format: uri
svn_url
required
string format: uri
homepage
required
string format: uri
nullable
language
required
string
nullable
forks_count
required
integer
stargazers_count
required
integer
watchers_count
required
integer
size
required

The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0.

integer
default_branch
required

The default branch of the repository.

string
open_issues_count
required
integer
is_template

Whether this repository acts as a template that can be used to generate new repositories.

boolean
topics
Array<string>
has_issues
required

Whether issues are enabled.

boolean
default: true
has_projects
required

Whether projects are enabled.

boolean
default: true
has_wiki
required

Whether the wiki is enabled.

boolean
default: true
has_pages
required
boolean
has_downloads
required

Whether downloads are enabled.

boolean
default: true
has_discussions

Whether discussions are enabled.

boolean
has_pull_requests

Whether pull requests are enabled.

boolean
default: true
pull_request_creation_policy

The policy controlling who can create pull requests: all or collaborators_only.

string
Allowed values: all collaborators_only
archived
required

Whether the repository is archived.

boolean
disabled
required

Returns whether or not this repository disabled.

boolean
visibility

The repository visibility: public, private, or internal.

string
default: public
pushed_at
required
string format: date-time
nullable
created_at
required
string format: date-time
nullable
updated_at
required
string format: date-time
nullable
allow_rebase_merge

Whether to allow rebase merges for pull requests.

boolean
default: true
temp_clone_token
string
allow_squash_merge

Whether to allow squash merges for pull requests.

boolean
default: true
allow_auto_merge

Whether to allow Auto-merge to be used on pull requests.

boolean
delete_branch_on_merge

Whether to delete head branches when pull requests are merged

boolean
allow_update_branch

Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging.

boolean
use_squash_pr_title_as_default

Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use squash_merge_commit_title instead.

boolean
squash_merge_commit_title

The default value for a squash merge commit title:

  • PR_TITLE - default to the pull request’s title.
  • COMMIT_OR_PR_TITLE - default to the commit’s title (if only one commit) or the pull request’s title (when more than one commit).
string
Allowed values: PR_TITLE COMMIT_OR_PR_TITLE
squash_merge_commit_message

The default value for a squash merge commit message:

  • PR_BODY - default to the pull request’s body.
  • COMMIT_MESSAGES - default to the branch’s commit messages.
  • BLANK - default to a blank commit message.
string
Allowed values: PR_BODY COMMIT_MESSAGES BLANK
merge_commit_title

The default value for a merge commit title.

  • PR_TITLE - default to the pull request’s title.
  • MERGE_MESSAGE - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name).
string
Allowed values: PR_TITLE MERGE_MESSAGE
merge_commit_message

The default value for a merge commit message.

  • PR_TITLE - default to the pull request’s title.
  • PR_BODY - default to the pull request’s body.
  • BLANK - default to a blank commit message.
string
Allowed values: PR_BODY PR_TITLE BLANK
allow_merge_commit

Whether to allow merge commits for pull requests.

boolean
default: true
allow_forking

Whether to allow forking this repo

boolean
web_commit_signoff_required

Whether to require contributors to sign off on web-based commits

boolean
open_issues
required
integer
watchers
required
integer
master_branch
string
starred_at
string
anonymous_access_enabled

Whether anonymous git access is enabled for this repository

boolean
code_search_index_status

The status of the code search index for this repository

object
lexical_search_ok
boolean
lexical_commit_sha
string
single_file
string
nullable
repository_selection

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

string
Allowed values: all selected
Examples
Example default
{
"token": "AABF3JGZDX3P5PMEXLND6TS6FCWO6",
"expires_at": "2020-01-29T12:13:35.123-08:00"
}