此版本的 GitHub Enterprise 已停止服务 2022-06-03. 即使针对重大安全问题,也不会发布补丁。 要获得更好的性能、改进的安全性和新功能,请升级到 GitHub Enterprise 的最新版本。 如需升级方面的帮助,请联系 GitHub Enterprise 支持。
OAuth 应用程序
Delete an app authorization
OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use Basic Authentication when accessing this endpoint, using the OAuth application's client_id and client_secret as the username and password. You must also provide a valid OAuth access_token as an input parameter and the grant for the token's owner will be deleted.
Deleting an OAuth 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.
参数
| � �头 | 
|---|
| 名称, 类型, 描述 | 
acceptstringSetting to   | 
| 路径参数 | 
| 名称, 类型, 描述 | 
client_idstring必选The client ID of the GitHub app.  | 
| 正文参数 | 
| 名称, 类型, 描述 | 
access_tokenstring必选The OAuth access token used to authenticate to the GitHub API.  | 
HTTP 响应状态代� �
| 状态代� � | 描述 | 
|---|---|
204 | No Content  | 
422 | Validation failed  | 
代� �示例
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \ 
  -H "Authorization: token <TOKEN>" \
  http(s)://HOSTNAME/api/v3/applications/Iv1.8a61f9b3a7aba766/grant \
  -d '{"access_token":"e72e16c7e42f292c6912e7710c838347ae178b4a"}'Response
Status: 204Revoke a grant for an application
Deprecation Notice: GitHub Enterprise Server will discontinue OAuth endpoints that contain access_token in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving access_token to the request body. For more information, see the blog post.
OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use Basic Authentication when accessing this endpoint, using the OAuth application's client_id and client_secret as the username and password. You must also provide a valid token as :access_token and the grant for the token's owner will be deleted.
Deleting an OAuth 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 Applications settings page under "Authorized OAuth Apps" on GitHub Enterprise Server.
参数
| � �头 | 
|---|
| 名称, 类型, 描述 | 
acceptstringSetting to   | 
| 路径参数 | 
| 名称, 类型, 描述 | 
client_idstring必选The client ID of the GitHub app.  | 
access_tokenstring必选 | 
HTTP 响应状态代� �
| 状态代� � | 描述 | 
|---|---|
204 | No Content  | 
代� �示例
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \ 
  -H "Authorization: token <TOKEN>" \
  http(s)://HOSTNAME/api/v3/applications/Iv1.8a61f9b3a7aba766/grants/ACCESS_TOKENResponse
Status: 204Check a token
OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use Basic Authentication to use this endpoint, where the username is the OAuth application client_id and the password is its client_secret. Invalid tokens will return 404 NOT FOUND.
参数
| � �头 | 
|---|
| 名称, 类型, 描述 | 
acceptstringSetting to   | 
| 路径参数 | 
| 名称, 类型, 描述 | 
client_idstring必选The client ID of the GitHub app.  | 
| 正文参数 | 
| 名称, 类型, 描述 | 
access_tokenstring必选The access_token of the OAuth application.  | 
HTTP 响应状态代� �
| 状态代� � | 描述 | 
|---|---|
200 | OK  | 
404 | Resource not found  | 
422 | Validation failed  | 
代� �示例
curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \ 
  -H "Authorization: token <TOKEN>" \
  http(s)://HOSTNAME/api/v3/applications/Iv1.8a61f9b3a7aba766/token \
  -d '{"access_token":"e72e16c7e42f292c6912e7710c838347ae178b4a"}'Response
Status: 200{
  "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": "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",
  "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
  }
}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 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.
参数
| � �头 | 
|---|
| 名称, 类型, 描述 | 
acceptstringSetting to   | 
| 路径参数 | 
| 名称, 类型, 描述 | 
client_idstring必选The client ID of the GitHub app.  | 
| 正文参数 | 
| 名称, 类型, 描述 | 
access_tokenstring必选The access_token of the OAuth application.  | 
HTTP 响应状态代� �
| 状态代� � | 描述 | 
|---|---|
200 | OK  | 
422 | Validation failed  | 
代� �示例
curl \
  -X PATCH \
  -H "Accept: application/vnd.github.v3+json" \ 
  -H "Authorization: token <TOKEN>" \
  http(s)://HOSTNAME/api/v3/applications/Iv1.8a61f9b3a7aba766/token \
  -d '{"access_token":"e72e16c7e42f292c6912e7710c838347ae178b4a"}'Response
Status: 200{
  "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": "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",
  "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
  }
}Delete an app token
OAuth application owners can revoke a single token for an OAuth application. You must use Basic Authentication when accessing this endpoint, using the OAuth application's client_id and client_secret as the username and password.
参数
| � �头 | 
|---|
| 名称, 类型, 描述 | 
acceptstringSetting to   | 
| 路径参数 | 
| 名称, 类型, 描述 | 
client_idstring必选The client ID of the GitHub app.  | 
| 正文参数 | 
| 名称, 类型, 描述 | 
access_tokenstring必选The OAuth access token used to authenticate to the GitHub API.  | 
HTTP 响应状态代� �
| 状态代� � | 描述 | 
|---|---|
204 | No Content  | 
422 | Validation failed  | 
代� �示例
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \ 
  -H "Authorization: token <TOKEN>" \
  http(s)://HOSTNAME/api/v3/applications/Iv1.8a61f9b3a7aba766/token \
  -d '{"access_token":"e72e16c7e42f292c6912e7710c838347ae178b4a"}'Response
Status: 204Create a scoped access token
Use a non-scoped user-to-server OAuth access token to create a repository scoped and/or permission scoped user-to-server OAuth access token. You can specify which repositories the token can access and which permissions are granted to the token. 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.
参数
| � �头 | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 名称, 类型, 描述 | |||||||||||||||||||||||||||||||||||
acceptstringSetting to   | |||||||||||||||||||||||||||||||||||
| 路径参数 | |||||||||||||||||||||||||||||||||||
| 名称, 类型, 描述 | |||||||||||||||||||||||||||||||||||
client_idstring必选The client ID of the GitHub app.  | |||||||||||||||||||||||||||||||||||
| 正文参数 | |||||||||||||||||||||||||||||||||||
| 名称, 类型, 描述 | |||||||||||||||||||||||||||||||||||
access_tokenstring必选The OAuth access token used to authenticate to the GitHub API.  | |||||||||||||||||||||||||||||||||||
targetstringThe name of the user or organization to scope the user-to-server access token to. Required unless   | |||||||||||||||||||||||||||||||||||
target_idintegerThe ID of the user or organization to scope the user-to-server access token to. Required unless   | |||||||||||||||||||||||||||||||||||
repositoriesarray of stringsThe list of repository names to scope the user-to-server access token to.   | |||||||||||||||||||||||||||||||||||
repository_idsarray of integersThe list of repository IDs to scope the user-to-server access token to.   | |||||||||||||||||||||||||||||||||||
permissionsobjectThe permissions granted to the user-to-server access token.  | |||||||||||||||||||||||||||||||||||
Properties of the | |||||||||||||||||||||||||||||||||||
| 名称, 类型, 描述 | 
|---|
actionsstringThe level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. 可以是以下其中之一:   | 
administrationstringThe level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. 可以是以下其中之一:   | 
checksstringThe level of permission to grant the access token for checks on code. 可以是以下其中之一:   | 
contentsstringThe level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. 可以是以下其中之一:   | 
deploymentsstringThe level of permission to grant the access token for deployments and deployment statuses. 可以是以下其中之一:   | 
environmentsstringThe level of permission to grant the access token for managing repository environments. 可以是以下其中之一:   | 
issuesstringThe level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. 可以是以下其中之一:   | 
metadatastringThe level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. 可以是以下其中之一:   | 
packagesstringThe level of permission to grant the access token for packages published to GitHub Packages. 可以是以下其中之一:   | 
pagesstringThe level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. 可以是以下其中之一:   | 
pull_requestsstringThe level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. 可以是以下其中之一:   | 
repository_hooksstringThe level of permission to grant the access token to manage the post-receive hooks for a repository. 可以是以下其中之一:   | 
repository_projectsstringThe level of permission to grant the access token to manage repository projects, columns, and cards. 可以是以下其中之一:   | 
secret_scanning_alertsstringThe level of permission to grant the access token to view and manage secret scanning alerts. 可以是以下其中之一:   | 
secretsstringThe level of permission to grant the access token to manage repository secrets. 可以是以下其中之一:   | 
security_eventsstringThe level of permission to grant the access token to view and manage security events like code scanning alerts. 可以是以下其中之一:   | 
single_filestringThe level of permission to grant the access token to manage just a single file. 可以是以下其中之一:   | 
statusesstringThe level of permission to grant the access token for commit statuses. 可以是以下其中之一:   | 
vulnerability_alertsstringThe level of permission to grant the access token to manage Dependabot alerts. 可以是以下其中之一:   | 
workflowsstringThe level of permission to grant the access token to update GitHub Actions workflow files. 可以是以下其中之一:   | 
membersstringThe level of permission to grant the access token for organization teams and members. 可以是以下其中之一:   | 
organization_administrationstringThe level of permission to grant the access token to manage access to an organization. 可以是以下其中之一:   | 
organization_hooksstringThe level of permission to grant the access token to manage the post-receive hooks for an organization. 可以是以下其中之一:   | 
organization_planstringThe level of permission to grant the access token for viewing an organization's plan. 可以是以下其中之一:   | 
organization_projectsstringThe level of permission to grant the access token to manage organization projects and projects beta (where available). 可以是以下其中之一:   | 
organization_packagesstringThe level of permission to grant the access token for organization packages published to GitHub Packages. 可以是以下其中之一:   | 
organization_secretsstringThe level of permission to grant the access token to manage organization secrets. 可以是以下其中之一:   | 
organization_self_hosted_runnersstringThe level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. 可以是以下其中之一:   | 
organization_user_blockingstringThe level of permission to grant the access token to view and manage users blocked by the organization. 可以是以下其中之一:   | 
team_discussionsstringThe level of permission to grant the access token to manage team discussions and related comments. 可以是以下其中之一:   | 
content_referencesstringThe level of permission to grant the access token for notification of content references and creation content attachments. 可以是以下其中之一:   | 
HTTP 响应状态代� �
| 状态代� � | 描述 | 
|---|---|
200 | OK  | 
401 | Requires authentication  | 
403 | Forbidden  | 
404 | Resource not found  | 
422 | Validation failed  | 
代� �示例
curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \ 
  -H "Authorization: token <TOKEN>" \
  http(s)://HOSTNAME/api/v3/applications/Iv1.8a61f9b3a7aba766/token/scoped \
  -d '{"access_token":"e72e16c7e42f292c6912e7710c838347ae178b4a","target":"octocat","permissions":{"metadata":"read","issues":"write","contents":"read"}}'Response
Status: 200{
  "id": 1,
  "url": "https://api.github.com/authorizations/1",
  "scopes": [],
  "token": "ghu_16C7e42F292c6912E7710c838347Ae178B4a",
  "token_last_eight": "Ae178B4a",
  "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",
  "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
  },
  "installation": {
    "permissions": {
      "metadata": "read",
      "issues": "write",
      "contents": "read"
    },
    "repository_selection": "selected",
    "single_file_name": ".github/workflow.yml",
    "repositories_url": "https://api.github.com/user/repos",
    "account": {
      "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
    },
    "has_multiple_single_files": false,
    "single_file_paths": []
  }
}Check an authorization
Deprecation Notice: GitHub Enterprise Server will discontinue OAuth endpoints that contain access_token in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving access_token to the request body. For more information, see the blog post.
OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. 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.
参数
| � �头 | 
|---|
| 名称, 类型, 描述 | 
acceptstringSetting to   | 
| 路径参数 | 
| 名称, 类型, 描述 | 
client_idstring必选The client ID of the GitHub app.  | 
access_tokenstring必选 | 
HTTP 响应状态代� �
| 状态代� � | 描述 | 
|---|---|
200 | OK  | 
404 | Resource not found  | 
代� �示例
curl \
  -H "Accept: application/vnd.github.v3+json" \ 
  -H "Authorization: token <TOKEN>" \
  http(s)://HOSTNAME/api/v3/applications/Iv1.8a61f9b3a7aba766/tokens/ACCESS_TOKENResponse
Status: 200{
  "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": "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",
  "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
  }
}Reset an authorization
Deprecation Notice: GitHub Enterprise Server will discontinue OAuth endpoints that contain access_token in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving access_token to the request body. For more information, see the blog post.
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.
参数
| � �头 | 
|---|
| 名称, 类型, 描述 | 
acceptstringSetting to   | 
| 路径参数 | 
| 名称, 类型, 描述 | 
client_idstring必选The client ID of the GitHub app.  | 
access_tokenstring必选 | 
HTTP 响应状态代� �
| 状态代� � | 描述 | 
|---|---|
200 | OK  | 
代� �示例
curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \ 
  -H "Authorization: token <TOKEN>" \
  http(s)://HOSTNAME/api/v3/applications/Iv1.8a61f9b3a7aba766/tokens/ACCESS_TOKENResponse
Status: 200{
  "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": "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",
  "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
  }
}Revoke an authorization for an application
Deprecation Notice: GitHub Enterprise Server will discontinue OAuth endpoints that contain access_token in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving access_token to the request body. For more information, see the blog post.
OAuth application owners can revoke a single token for an OAuth application. You must use Basic Authentication when accessing this endpoint, using the OAuth application's client_id and client_secret as the username and password.
参数
| � �头 | 
|---|
| 名称, 类型, 描述 | 
acceptstringSetting to   | 
| 路径参数 | 
| 名称, 类型, 描述 | 
client_idstring必选The client ID of the GitHub app.  | 
access_tokenstring必选 | 
HTTP 响应状态代� �
| 状态代� � | 描述 | 
|---|---|
204 | No Content  | 
代� �示例
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \ 
  -H "Authorization: token <TOKEN>" \
  http(s)://HOSTNAME/api/v3/applications/Iv1.8a61f9b3a7aba766/tokens/ACCESS_TOKENResponse
Status: 204