GitHub v3 REST API

Get a single authorization

DEPRECATED

Deprecation Notice: GitHub Enterprise Server will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

get
http://HOSTNAME/api/v3/authorizations/{authorization_id}

Path Parameters

authorization_idintegerrequired

authorization_id parameter

Response

application/json

Response

Authorization

The authorization for an OAuth app, GitHub App, or a Personal Access Token.

idintegerrequired
urlstring(uri)required
scopesarray | null[string]required

A list of scopes that this authorization is in.

tokenstringrequired
token_last_eightstring | nullrequired
hashed_tokenstring | nullrequired
appobjectrequired
Show Child Parameters
notestring | nullrequired
note_urlstring | null(uri)required
updated_atstring(date-time)required
created_atstring(date-time)required
fingerprintstring | nullrequired
userobject | null

Simple User

Show Child Parameters
installationobject | null
Show Child Parameters
get/authorizations/{authorization_id}
 
application/json

Update an existing authorization

DEPRECATED

Deprecation Notice: GitHub Enterprise Server will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”

You can only send one of these scope keys at a time.

patch
http://HOSTNAME/api/v3/authorizations/{authorization_id}

Path Parameters

authorization_idintegerrequired

authorization_id parameter

Body

application/json
scopesarray | null[string]

A list of scopes that this authorization is in.

Example:["public_repo","user"]

add_scopesarray[string]

A list of scopes to add to this authorization.

remove_scopesarray[string]

A list of scopes to remove from this authorization.

notestring

A note to remind you what the OAuth token is for.

Example:Update all gems

note_urlstring

A URL to remind you what app the OAuth token is for.

fingerprintstring

A unique string to distinguish an authorization from others created for the same client ID and user.

Response

application/json

Response

Authorization

The authorization for an OAuth app, GitHub App, or a Personal Access Token.

idintegerrequired
urlstring(uri)required
scopesarray | null[string]required

A list of scopes that this authorization is in.

tokenstringrequired
token_last_eightstring | nullrequired
hashed_tokenstring | nullrequired
appobjectrequired
Show Child Parameters
notestring | nullrequired
note_urlstring | null(uri)required
updated_atstring(date-time)required
created_atstring(date-time)required
fingerprintstring | nullrequired
userobject | null

Simple User

Show Child Parameters
installationobject | null
Show Child Parameters
patch/authorizations/{authorization_id}

Body

{}
 
application/json

Delete an authorization

DEPRECATED

Deprecation Notice: GitHub Enterprise Server will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

delete
http://HOSTNAME/api/v3/authorizations/{authorization_id}

Path Parameters

authorization_idintegerrequired

authorization_id parameter

Response

Response

delete/authorizations/{authorization_id}
 

List organizations

Lists all organizations, in the order that they were created on GitHub Enterprise Server.

Note: Pagination is powered exclusively by the since parameter. Use the Link header to get the URL for the next page of organizations.

get
http://HOSTNAME/api/v3/organizations

Query Parameters

sinceinteger

An organization ID. Only return organizations with an ID greater than this ID.

per_pageinteger

Results per page (max 100)

Default:30

Response

application/json

Response

Organization Simple

loginstringrequired

Example:github

idintegerrequired

Example:1

node_idstringrequired

Example:MDEyOk9yZ2FuaXphdGlvbjE=

urlstring(uri)required

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

repos_urlstring(uri)required

Example:https://api.github.com/orgs/github/repos

events_urlstring(uri)required

Example:https://api.github.com/orgs/github/events

hooks_urlstringrequired

Example:https://api.github.com/orgs/github/hooks

issues_urlstringrequired

Example:https://api.github.com/orgs/github/issues

members_urlstringrequired

Example:https://api.github.com/orgs/github/members{/member}

public_members_urlstringrequired

Example:https://api.github.com/orgs/github/public_members{/member}

avatar_urlstringrequired

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

descriptionstring | nullrequired

Example:A great organization

get/organizations
 
application/json

Get an organization

To see many of the organization response values, you need to be an authenticated organization owner with the admin:org scope. When the value of two_factor_requirement_enabled is true, the organization requires all members, billing managers, and outside collaborators to enable two-factor authentication.

GitHub Apps with the Organization plan permission can use this endpoint to retrieve information about an organization’s GitHub Enterprise Server plan. See “Authenticating with GitHub Apps” for details. For an example response, see ‘Response with GitHub Enterprise Server plan information’ below."

get
http://HOSTNAME/api/v3/orgs/{org}

Path Parameters

orgstringrequired

Response

application/json

Response

Organization Full

Organization Full

loginstringrequired

Example:github

idintegerrequired

Example:1

node_idstringrequired

Example:MDEyOk9yZ2FuaXphdGlvbjE=

urlstring(uri)required

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

repos_urlstring(uri)required

Example:https://api.github.com/orgs/github/repos

events_urlstring(uri)required

Example:https://api.github.com/orgs/github/events

hooks_urlstringrequired

Example:https://api.github.com/orgs/github/hooks

issues_urlstringrequired

Example:https://api.github.com/orgs/github/issues

members_urlstringrequired

Example:https://api.github.com/orgs/github/members{/member}

public_members_urlstringrequired

Example:https://api.github.com/orgs/github/public_members{/member}

avatar_urlstringrequired

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

descriptionstring | nullrequired

Example:A great organization

namestring

Example:github

companystring

Example:GitHub

blogstring(uri)

Example:https://github.com/blog

locationstring

Example:San Francisco

emailstring(email)

Example:octocat@github.com

twitter_usernamestring | null

Example:github

is_verifiedboolean

Example:true

has_organization_projectsbooleanrequired

Example:true

has_repository_projectsbooleanrequired

Example:true

public_reposintegerrequired

Example:2

public_gistsintegerrequired

Example:1

followersintegerrequired

Example:20

followingintegerrequired

Example:0

html_urlstring(uri)required

Example:https://github.com/octocat

created_atstring(date-time)required

Example:2008-01-14T04:33:35Z

typestringrequired

Example:Organization

total_private_reposinteger

Example:100

owned_private_reposinteger

Example:100

private_gistsinteger | null

Example:81

disk_usageinteger | null

Example:10000

collaboratorsinteger | null

Example:8

billing_emailstring | null(email)

Example:org@example.com

planobject
Show Child Parameters
default_repository_permissionstring | null
members_can_create_repositoriesboolean | null

Example:true

two_factor_requirement_enabledboolean | null

Example:true

members_allowed_repository_creation_typestring

Example:all

members_can_create_public_repositoriesboolean

Example:true

members_can_create_private_repositoriesboolean

Example:true

members_can_create_internal_repositoriesboolean

Example:true

members_can_create_pagesboolean

Example:true

members_can_create_public_pagesboolean

Example:true

members_can_create_private_pagesboolean

Example:true

members_can_fork_private_repositoriesboolean | null

Example:false

updated_atstring(date-time)required
get/orgs/{org}
 
application/json