Reset a token
PATCH {{baseUrl}}/applications/:client_id/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 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
.
Request Body
{"access_token"=>"<string>"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |
RESPONSES
status: OK
{"id":1,"url":"https://api.github.com/authorizations/1","scopes":["public_repo"],"token":"abcdefgh12345678","token_last_eight":"12345678","hashed_token":"25f94a2a5c7fbaf499c665bc73d67c1c87e496da8985131633ee0a95819db2e8","app":{"url":"http://my-github-app.com","name":"my github app","client_id":"abcde12345fghij67890"},"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","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}}