Get a raw file from a gist
GET
/gists/{uuid}/files/{sha}/{filename}Returns the raw bytes of filename as committed at sha. The
Content-Type is derived from the detected mime type (embeddable types
keep their type, other text is served as text/plain, everything else
as application/octet-stream); X-Content-Type-Options: nosniff is
always set, and SVG/PDF responses carry a restrictive
Content-Security-Policy.
Visibility rules match the gist endpoint: public and unlisted gists are
readable by anyone, while a private gist resolves only for its owner
with a gist:read-capable token.
Request
Headers
| Name | Type | Scopes |
|---|---|---|
Authorizationoptional | string |
Path parameters
| Name | Type | Description |
|---|---|---|
uuidrequired | string | The gist's UUID. |
sharequired | string | A full or partial commit SHA (hex, 4–40 characters). (pattern: ^[0-9a-fA-F]{4,40}$) |
filenamerequired | string | Name of the file within the gist. |
Responses
| Status | Body | Description |
|---|---|---|
200 | string <binary> | The raw file content. |
400 | Error | The request was malformed. |
404 | Error | The requested resource does not exist (or is not visible to the caller). |