GitHub v3 REST API

Get a gist

get
http://HOSTNAME/api/v3/gists/{gist_id}

Path Parameters

gist_idstringrequired

gist_id parameter

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
get/gists/{gist_id}
 
application/json

Update a gist

Allows you to update or delete a gist file and rename gist files. Files from the previous version of the gist that aren’t explicitly changed during an edit are unchanged.

patch
http://HOSTNAME/api/v3/gists/{gist_id}

Path Parameters

gist_idstringrequired

gist_id parameter

Body

application/json
Any Of

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
patch/gists/{gist_id}

Body

{}
 
application/json

Delete a gist

delete
http://HOSTNAME/api/v3/gists/{gist_id}

Path Parameters

gist_idstringrequired

gist_id parameter

Response

Response

delete/gists/{gist_id}
 

List gist comments

get
http://HOSTNAME/api/v3/gists/{gist_id}/comments

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

gist_idstringrequired

gist_id parameter

Response

application/json

Response

A comment made to a gist.

idintegerrequired

Example:1

node_idstringrequired

Example:MDExOkdpc3RDb21tZW50MQ==

urlstring(uri)required

Example:https://api.github.com/gists/a6db0bec360bb87e9418/comments/1

bodystringrequired

The comment text.

<= 65535 characters

Example:Body of the attachment

userobject | nullrequired

Simple User

Show Child Parameters
created_atstring(date-time)required

Example:2011-04-18T23:23:56Z

updated_atstring(date-time)required

Example:2011-04-18T23:23:56Z

author_associationstringrequired

How the author is associated with the repository.

Allowed values:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER

Example:OWNER

get/gists/{gist_id}/comments
 
application/json

Create a gist comment

post
http://HOSTNAME/api/v3/gists/{gist_id}/comments

Path Parameters

gist_idstringrequired

gist_id parameter

Body

application/json
bodystringrequired

The comment text.

<= 65535 characters

Example:Body of the attachment

Response

application/json

Response

Gist Comment

A comment made to a gist.

idintegerrequired

Example:1

node_idstringrequired

Example:MDExOkdpc3RDb21tZW50MQ==

urlstring(uri)required

Example:https://api.github.com/gists/a6db0bec360bb87e9418/comments/1

bodystringrequired

The comment text.

<= 65535 characters

Example:Body of the attachment

userobject | nullrequired

Simple User

Show Child Parameters
created_atstring(date-time)required

Example:2011-04-18T23:23:56Z

updated_atstring(date-time)required

Example:2011-04-18T23:23:56Z

author_associationstringrequired

How the author is associated with the repository.

Allowed values:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER

Example:OWNER

post/gists/{gist_id}/comments

Body

{ "body": "Body of the attachment" }
 
application/json