GitHub v3 REST API

Unsuspend a user

If your GitHub instance uses LDAP Sync with Active Directory LDAP servers, this API is disabled and will return a 403 response. Active Directory LDAP-authenticated users cannot be unsuspended using the API.

delete
http://HOSTNAME/api/v3/users/{username}/suspended

Path Parameters

usernamestringrequired

Body

application/json
reasonstring

The reason the user is being unsuspended. This message will be logged in the audit log. If you don’t provide a reason, it will default to “Unsuspended via API by SITE_ADMINISTRATOR”, where SITE_ADMINISTRATOR is the person who performed the action.

Response

204

Response

delete/users/{username}/suspended

Body

{}
 
204

List gists for the authenticated user

Lists the authenticated user’s gists or if called anonymously, this endpoint returns all public gists:

get
http://HOSTNAME/api/v3/gists

Query Parameters

sincestring(date-time)

Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Response

application/json

Response

Base Gist

urlstring(uri)required
forks_urlstring(uri)required
commits_urlstring(uri)required
idstringrequired
node_idstringrequired
git_pull_urlstring(uri)required
git_push_urlstring(uri)required
html_urlstring(uri)required
filesobjectrequired
publicbooleanrequired
created_atstring(date-time)required
updated_atstring(date-time)required
descriptionstring | nullrequired
commentsintegerrequired
userobject | nullrequired

Simple User

Show Child Parameters
comments_urlstring(uri)required
ownerobject

Simple User

Show Child Parameters
truncatedboolean
forksarray
historyarray
get/gists
 
application/json

Create a gist

Allows you to add a new gist with one or more files.

Note: Don’t name your files “gistfile” with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally.

post
http://HOSTNAME/api/v3/gists

Body

application/json
descriptionstring

Description of the gist

Example:Example Ruby script

filesobjectrequired

Names and content for the files that make up the gist

Example:{"hello.rb":{"content":"puts \"Hello, World!\""}}

publicOne Of
Variant 1boolean

Flag indicating whether the gist is public

Default:false

Example:true

Response

application/json

Response

Gist Simple

Gist Simple

forksarray | null[object]DEPRECATED
Show Child Parameters
historyarray | null[object]DEPRECATED

Gist History

Show Child Parameters
fork_ofobject | null

Gist

Show Child Parameters
urlstring
forks_urlstring
commits_urlstring
idstring
node_idstring
git_pull_urlstring
git_push_urlstring
html_urlstring
filesobject
publicboolean
created_atstring
updated_atstring
descriptionstring | null
commentsinteger
userstring | null
comments_urlstring
ownerobject

Simple User

Show Child Parameters
truncatedboolean
post/gists

Body

{ "files": { "hello.rb": { "content": "puts \"Hello, World!\"" } } }
 
application/json

List public gists

List public gists sorted by most recently updated to least recently updated.

Note: With pagination, you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page.

get
http://HOSTNAME/api/v3/gists/public

Query Parameters

sincestring(date-time)

Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Response

application/json

Response

Base Gist

urlstring(uri)required
forks_urlstring(uri)required
commits_urlstring(uri)required
idstringrequired
node_idstringrequired
git_pull_urlstring(uri)required
git_push_urlstring(uri)required
html_urlstring(uri)required
filesobjectrequired
publicbooleanrequired
created_atstring(date-time)required
updated_atstring(date-time)required
descriptionstring | nullrequired
commentsintegerrequired
userobject | nullrequired

Simple User

Show Child Parameters
comments_urlstring(uri)required
ownerobject

Simple User

Show Child Parameters
truncatedboolean
forksarray
historyarray
get/gists/public
 
application/json

List starred gists

List the authenticated user’s starred gists:

get
http://HOSTNAME/api/v3/gists/starred

Query Parameters

sincestring(date-time)

Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Response

application/json

Response

Base Gist

urlstring(uri)required
forks_urlstring(uri)required
commits_urlstring(uri)required
idstringrequired
node_idstringrequired
git_pull_urlstring(uri)required
git_push_urlstring(uri)required
html_urlstring(uri)required
filesobjectrequired
publicbooleanrequired
created_atstring(date-time)required
updated_atstring(date-time)required
descriptionstring | nullrequired
commentsintegerrequired
userobject | nullrequired

Simple User

Show Child Parameters
comments_urlstring(uri)required
ownerobject

Simple User

Show Child Parameters
truncatedboolean
forksarray
historyarray
get/gists/starred
 
application/json