Sample - GitHub REST API
GET/gists/{gist_id}/commits

List gist commits

Lists the commit history for a specific gist. Use per_page and page to control the result set, and use page and per_page to paginate the results. Each returned commit includes its version, author, change summary, and commit timestamp.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters
gist_idstringrequired
The unique identifier of the gist whose commits to list.
per_pageintegeroptional
Number of commits per page, up to 100. Defaults to 30 when omitted.
Default:30
pageintegeroptional
Page number of the commit results to fetch. Defaults to 1 when omitted.
Default:1

4 status codes
200Returns an array of gist commit objects containing the commit URL, version, author, change summary, and commit timestamp.
urlstringrequired
versionstringrequired
userobjectrequired
A GitHub user.
change_statusobjectrequired
committed_atstringrequired
304Returned when the gist commit history has not changed since the request's conditional cache value.
403Returned when the authenticated user is forbidden from accessing the gist's commits.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
404Returned when no accessible gist exists with the specified `gist_id`.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 403 is returned when the authenticated user is forbidden from accessing the gist's commits. A 404 is returned when gist_id does not identify an accessible gist; per_page must not exceed 100 and page defaults to 1 when omitted.