GitHub v3 REST API

Create an impersonation OAuth token

post
http://HOSTNAME/api/v3/admin/users/{username}/authorizations

Path Parameters

usernamestringrequired

Body

application/json
scopesarray[string]

A list of scopes.

Response

201 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
 
201 application/json

Delete an impersonation OAuth token

delete
http://HOSTNAME/api/v3/admin/users/{username}/authorizations

Path Parameters

usernamestringrequired

Response

204

Response

 
204

Get the global announcement banner

Gets the current message and expiration date of the global announcement banner in your enterprise.

get
http://HOSTNAME/api/v3/enterprise/announcement

Response

200 application/json

Response

Enterprise Announcement

Enterprise global announcement

announcementstringrequired

The announcement text in GitHub Flavored Markdown. For more information about GitHub Flavored Markdown, see “Basic writing and formatting syntax.”

Example:Very **important** announcement about _nothing_.

expires_atstring | null(date-time)

The time at which the announcement expires. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. To set an announcement that never expires, omit this parameter, set it to null, or set it to an empty string.

Example:"2021-01-01T00:00:00.000-07:00"

 
200 application/json

Set the global announcement banner

Sets the message and expiration time for the global announcement banner in your enterprise.

patch
http://HOSTNAME/api/v3/enterprise/announcement

Body

application/json

Enterprise Announcement

Enterprise global announcement

announcementstringrequired

The announcement text in GitHub Flavored Markdown. For more information about GitHub Flavored Markdown, see “Basic writing and formatting syntax.”

Example:Very **important** announcement about _nothing_.

expires_atstring | null(date-time)

The time at which the announcement expires. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. To set an announcement that never expires, omit this parameter, set it to null, or set it to an empty string.

Example:"2021-01-01T00:00:00.000-07:00"

Response

200 application/json

Response

Enterprise Announcement

Enterprise global announcement

announcementstringrequired

The announcement text in GitHub Flavored Markdown. For more information about GitHub Flavored Markdown, see “Basic writing and formatting syntax.”

Example:Very **important** announcement about _nothing_.

expires_atstring | null(date-time)

The time at which the announcement expires. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. To set an announcement that never expires, omit this parameter, set it to null, or set it to an empty string.

Example:"2021-01-01T00:00:00.000-07:00"

 
200 application/json

Remove the global announcement banner

Removes the global announcement banner in your enterprise.

delete
http://HOSTNAME/api/v3/enterprise/announcement

Response

204

Response

 
204