REST API endpoints for OAuth authorizations

Use the REST API to interact with OAuth apps and OAuth authorizations of GitHub Apps

About OAuth apps and OAuth authorizations of GitHub Apps

You can use these endpoints to manage the OAuth tokens that OAuth apps or GitHub Apps use to access people's accounts on GitHub.

Tokens for OAuth apps have the prefix gho_, while OAuth tokens for GitHub Apps, used for authenticating on behalf of the user, have the prefix ghu_. You can use the following endpoints for both types of OAuth tokens.

Note

Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.

Delete an app authorization

DELETE /applications/{client_id}/grant

OAuth and GitHub application owners can revoke a grant for their application and a specific user. You must provide a valid OAuth access_token as an input parameter and the grant for the token's owner will be deleted.
Deleting an application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on the application authorizations settings screen within GitHub.

Note

This endpoint requires Basic authentication. Use the application's client_id as the username and the client_secret as the password. Do not send an Authorization: Bearer header with this request, because it replaces the Basic credentials.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/applications/Iv1.8a61f9b3a7aba766/grant \
  -u "<YOUR_CLIENT_ID>:<YOUR_CLIENT_SECRET>" \
  -d '{
  "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a"
}'

Response schema (Status: 204):

Check a token

POST /applications/{client_id}/token

OAuth applications and GitHub applications with OAuth authorizations can use this API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. Invalid tokens will return 404 NOT FOUND.

Note

This endpoint requires Basic authentication. Use the application's client_id as the username and the client_secret as the password. Do not send an Authorization: Bearer header with this request, because it replaces the Basic credentials.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/applications/Iv1.8a61f9b3a7aba766/token \
  -u "<YOUR_CLIENT_ID>:<YOUR_CLIENT_SECRET>" \
  -d '{
  "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a"
}'

Response schema (Status: 200):

Reset a token

PATCH /applications/{client_id}/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.

Note

This endpoint requires Basic authentication. Use the application's client_id as the username and the client_secret as the password. Do not send an Authorization: Bearer header with this request, because it replaces the Basic credentials.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PATCH \
  https://api.github.com/applications/Iv1.8a61f9b3a7aba766/token \
  -u "<YOUR_CLIENT_ID>:<YOUR_CLIENT_SECRET>" \
  -d '{
  "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a"
}'

Response schema (Status: 200):

Same response schema as Check a token.

Delete an app token

DELETE /applications/{client_id}/token

OAuth or GitHub application owners can revoke a single token for an OAuth application or a GitHub application with an OAuth authorization.

Note

This endpoint requires Basic authentication. Use the application's client_id as the username and the client_secret as the password. Do not send an Authorization: Bearer header with this request, because it replaces the Basic credentials.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/applications/Iv1.8a61f9b3a7aba766/token \
  -u "<YOUR_CLIENT_ID>:<YOUR_CLIENT_SECRET>" \
  -d '{
  "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a"
}'

Response schema (Status: 204):