Reset a token
OAuth applications and GitHub applications with OAuth authorizations 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. Invalid tokens will return 404 NOT FOUND.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The client ID of the GitHub app.
Examples
Iv1.8a61f9b3a7aba766Request Body required
Section titled “ Request Body required ”object
The access_token of the OAuth or GitHub application.
Examples
{ "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a"}Responses
Section titled “ Responses ”Response
The authorization for an OAuth app, GitHub App, or a Personal Access Token.
object
A list of scopes that this authorization is in.
object
A GitHub user.
object
object
The permissions granted to the fine-grained access token.
object
The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts.
The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation.
The level of permission to grant the access token to create and retrieve build artifact metadata records.
The level of permission to create and retrieve the access token for repository attestations.
The level of permission to grant the access token for checks on code.
The level of permission to grant the access token to view and manage code quality data.
The level of permission to grant the access token to create, edit, delete, and list Codespaces.
The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges.
The level of permission to grant the access token to manage Dependabot secrets.
The level of permission to grant the access token for deployments and deployment statuses.
The level of permission to grant the access token for discussions and related comments and labels.
The level of permission to grant the access token for managing repository environments.
The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones.
The level of permission to grant the access token to manage the merge queues for a repository.
The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata.
The level of permission to grant the access token for packages published to GitHub Packages.
The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds.
The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges.
The level of permission to grant the access token to view and edit custom properties for a repository, when allowed by the property.
The level of permission to grant the access token to manage the post-receive hooks for a repository.
The level of permission to grant the access token to manage repository projects, columns, and cards.
The level of permission to grant the access token to view and manage secret scanning alerts.
The level of permission to grant the access token to manage repository secrets.
The level of permission to grant the access token to view and manage security events like code scanning alerts.
The level of permission to grant the access token to manage just a single file.
The level of permission to grant the access token for commit statuses.
The level of permission to grant the access token to manage Dependabot alerts.
The level of permission to grant the access token to update GitHub Actions workflow files.
The level of permission to grant the access token to view and edit custom properties for an organization, when allowed by the property.
The level of permission to grant the access token for organization teams and members.
The level of permission to grant the access token to manage access to an organization.
The level of permission to grant the access token for custom repository roles management.
The level of permission to grant the access token for custom organization roles management.
The level of permission to grant the access token for repository custom properties management at the organization level.
The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in public preview and is subject to change.
The level of permission to grant the access token to view and manage Copilot cloud agent settings for an organization.
The level of permission to grant the access token to view and manage announcement banners for an organization.
The level of permission to grant the access token to view events triggered by an activity in an organization.
The level of permission to grant the access token to manage the post-receive hooks for an organization.
The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization.
The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization.
The level of permission to grant the access token for viewing an organization’s plan.
The level of permission to grant the access token to manage organization projects and projects public preview (where available).
The level of permission to grant the access token for organization packages published to GitHub Packages.
The level of permission to grant the access token to manage organization secrets.
The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization.
The level of permission to grant the access token to view and manage users blocked by the organization.
The level of permission to grant the access token to manage the email addresses belonging to a user.
The level of permission to grant the access token to manage the followers belonging to a user.
The level of permission to grant the access token to manage git SSH keys.
The level of permission to grant the access token to view and manage GPG keys belonging to a user.
The level of permission to grant the access token to view and manage interaction limits on a repository.
The level of permission to grant the access token to manage the profile settings belonging to a user.
The level of permission to grant the access token to list and manage repositories a user is starring.
The level of permission to grant the access token for organization custom properties management at the enterprise level.
Describe whether all repositories have been selected or there’s a selection involved
A GitHub user.
object
Examples
{ "id": 1, "url": "https://api.github.com/authorizations/1", "scopes": [ "public_repo", "user" ], "token": "ghu_16C7e42F292c6912E7710c838347Ae178B4a", "token_last_eight": "Ae178B4a", "hashed_token": "25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8", "app": { "url": "https://example.com", "name": "my github app", "client_id": "Iv1.8a61f9b3a7aba766" }, "note": "optional note", "note_url": "http://optional/note/url", "updated_at": "2011-09-06T20:39:23Z", "created_at": "2011-09-06T17:26:27Z", "fingerprint": "jklmnop12345678", "expires_at": "2011-09-08T17:26:27Z", "user": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false }}Validation failed, or the endpoint has been spammed.
Validation Error
object
object
Example generated
{ "message": "example", "documentation_url": "example", "errors": [ { "resource": "example", "field": "example", "message": "example", "code": "example", "index": 1, "value": [ "example" ] } ]}