GitHub v3 REST API

Update the username for a user

patch
{protocol}://{hostname}/api/v3/admin/users/{username}

Path Parameters

usernamestringrequired

Body

application/json
loginstringrequired

The user’s new username.

Response

202 application/json

Response

messagestring
urlstring
patch/admin/users/{username}

Body

{ "login": "thenewmonalisa" }
 
202 application/json

Delete a user

Deleting a user will delete all their repositories, gists, applications, and personal settings. Suspending a user is often a better option.

You can delete any user account except your own.

delete
{protocol}://{hostname}/api/v3/admin/users/{username}

Path Parameters

usernamestringrequired

Response

204

Response

delete/admin/users/{username}
 
204

Create an impersonation OAuth token

post
{protocol}://{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
post/admin/users/{username}/authorizations

Body

{}
 
201 application/json

Delete an impersonation OAuth token

delete
{protocol}://{hostname}/api/v3/admin/users/{username}/authorizations

Path Parameters

usernamestringrequired

Response

204

Response

delete/admin/users/{username}/authorizations
 
204

Get the global announcement banner

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

get
{protocol}://{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"

get/enterprise/announcement
 
200 application/json