Skip to main content

Reset a token

OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/[email protected]/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`.

PATCH/applications/{client_id}/token
Source
github-v3-rest.json
Revision
f5f067c1e6f6
Active snapshot
85e53e3d0d65

Request

Path Parameters
client_id string
required

The client ID of your GitHub app.

Body Params
required
application/jsonobject
access_token string
required

The access_token of the OAuth application.

Responses

application/json Authorization object

Response

app object
required
client_id string
required
name string
required
url string<uri>
required
created_at string<date-time>
required
fingerprint string
requirednullable
hashed_token string
requirednullable
id integer
required
installation Scoped Installation object
optionalnullable
account Simple User object
required

Simple User

avatar_url string<uri>
required

Example: https://github.com/images/error/octocat_happy.gif

email string
optionalnullable
events_url string
required

Example: https://api.github.com/users/octocat/events{/privacy}

followers_url string<uri>
required

Example: https://api.github.com/users/octocat/followers

following_url string
required

Example: https://api.github.com/users/octocat/following{/other_user}

gists_url string
required

Example: https://api.github.com/users/octocat/gists{/gist_id}

gravatar_id string
requirednullable

Example: 41d064eb2195891e12d0413f63227ea7

html_url string<uri>
required

Example: https://github.com/octocat

id integer
required

Example: 1

login string
required

Example: octocat

name string
optionalnullable
node_id string
required

Example: MDQ6VXNlcjE=

organizations_url string<uri>
required

Example: https://api.github.com/users/octocat/orgs

received_events_url string<uri>
required

Example: https://api.github.com/users/octocat/received_events

repos_url string<uri>
required

Example: https://api.github.com/users/octocat/repos

site_admin boolean
required
starred_at string
optional

Example: "2020-07-09T00:17:55Z"

starred_url string
required

Example: https://api.github.com/users/octocat/starred{/owner}{/repo}

subscriptions_url string<uri>
required

Example: https://api.github.com/users/octocat/subscriptions

type string
required

Example: User

url string<uri>
required

Example: https://api.github.com/users/octocat

has_multiple_single_files boolean
optional

Example: true

permissions App Permissions object
required

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

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

The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. Can be one of: `read` or `write`.

administration string
optional

The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. Can be one of: `read` or `write`.

checks string
optional

The level of permission to grant the access token for checks on code. Can be one of: `read` or `write`.

content_references string
optional

The level of permission to grant the access token for notification of content references and creation content attachments. Can be one of: `read` or `write`.

contents string
optional

The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. Can be one of: `read` or `write`.

deployments string
optional

The level of permission to grant the access token for deployments and deployment statuses. Can be one of: `read` or `write`.

environments string
optional

The level of permission to grant the access token for managing repository environments. Can be one of: `read` or `write`.

issues string
optional

The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. Can be one of: `read` or `write`.

members string
optional

The level of permission to grant the access token for organization teams and members. Can be one of: `read` or `write`.

metadata string
optional

The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. Can be one of: `read` or `write`.

organization_administration string
optional

The level of permission to grant the access token to manage access to an organization. Can be one of: `read` or `write`.

organization_hooks string
optional

The level of permission to grant the access token to manage the post-receive hooks for an organization. Can be one of: `read` or `write`.

organization_packages string
optional

The level of permission to grant the access token for organization packages published to GitHub Packages. Can be one of: `read` or `write`.

organization_plan string
optional

The level of permission to grant the access token for viewing an organization's plan. Can be one of: `read`.

organization_projects string
optional

The level of permission to grant the access token to manage organization projects and projects beta (where available). Can be one of: `read`, `write`, or `admin`.

organization_secrets string
optional

The level of permission to grant the access token to manage organization secrets. Can be one of: `read` or `write`.

organization_self_hosted_runners string
optional

The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. Can be one of: `read` or `write`.

organization_user_blocking string
optional

The level of permission to grant the access token to view and manage users blocked by the organization. Can be one of: `read` or `write`.

packages string
optional

The level of permission to grant the access token for packages published to GitHub Packages. Can be one of: `read` or `write`.

pages string
optional

The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. Can be one of: `read` or `write`.

pull_requests string
optional

The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. Can be one of: `read` or `write`.

repository_hooks string
optional

The level of permission to grant the access token to manage the post-receive hooks for a repository. Can be one of: `read` or `write`.

repository_projects string
optional

The level of permission to grant the access token to manage repository projects, columns, and cards. Can be one of: `read`, `write`, or `admin`.

secret_scanning_alerts string
optional

The level of permission to grant the access token to view and manage secret scanning alerts. Can be one of: `read` or `write`.

secrets string
optional

The level of permission to grant the access token to manage repository secrets. Can be one of: `read` or `write`.

security_events string
optional

The level of permission to grant the access token to view and manage security events like code scanning alerts. Can be one of: `read` or `write`.

single_file string
optional

The level of permission to grant the access token to manage just a single file. Can be one of: `read` or `write`.

statuses string
optional

The level of permission to grant the access token for commit statuses. Can be one of: `read` or `write`.

team_discussions string
optional

The level of permission to grant the access token to manage team discussions and related comments. Can be one of: `read` or `write`.

vulnerability_alerts string
optional

The level of permission to grant the access token to manage Dependabot alerts. Can be one of: `read` or `write`.

workflows string
optional

The level of permission to grant the access token to update GitHub Actions workflow files. Can be one of: `write`.

repositories_url string<uri>
required

Example: https://api.github.com/users/octocat/repos

repository_selection string
required

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

single_file_name string
requirednullable

Example: config.yaml

single_file_paths array[string]
optional
Example:
[
  "config.yml",
  ".github/issue_TEMPLATE.md"
]
note string
requirednullable
note_url string<uri>
requirednullable
scopes array[string]
requirednullable

A list of scopes that this authorization is in.

token string
required
token_last_eight string
requirednullable
updated_at string<date-time>
required
url string<uri>
required
user Simple User object
optionalnullable

Simple User

avatar_url string<uri>
required

Example: https://github.com/images/error/octocat_happy.gif

email string
optionalnullable
events_url string
required

Example: https://api.github.com/users/octocat/events{/privacy}

followers_url string<uri>
required

Example: https://api.github.com/users/octocat/followers

following_url string
required

Example: https://api.github.com/users/octocat/following{/other_user}

gists_url string
required

Example: https://api.github.com/users/octocat/gists{/gist_id}

gravatar_id string
requirednullable

Example: 41d064eb2195891e12d0413f63227ea7

html_url string<uri>
required

Example: https://github.com/octocat

id integer
required

Example: 1

login string
required

Example: octocat

name string
optionalnullable
node_id string
required

Example: MDQ6VXNlcjE=

organizations_url string<uri>
required

Example: https://api.github.com/users/octocat/orgs

received_events_url string<uri>
required

Example: https://api.github.com/users/octocat/received_events

repos_url string<uri>
required

Example: https://api.github.com/users/octocat/repos

site_admin boolean
required
starred_at string
optional

Example: "2020-07-09T00:17:55Z"

starred_url string
required

Example: https://api.github.com/users/octocat/starred{/owner}{/repo}

subscriptions_url string<uri>
required

Example: https://api.github.com/users/octocat/subscriptions

type string
required

Example: User

url string<uri>
required

Example: https://api.github.com/users/octocat

application/json Validation Error object

Validation failed

documentation_url string
required
errors array[object]
optional
items object
code string
required
field string
optional
index integer
optional
message string
optional
resource string
optional
value
optional
message string
required