{"meta":{"title":"Gist에 대한 REST API 엔드포인트","intro":"REST API를 사용하여 GitHub 공개 요지를 나열, 만들기, 업데이트 및 삭제합니다.","product":"REST API","breadcrumbs":[{"href":"/ko/enterprise-server@3.21/rest","title":"REST API"},{"href":"/ko/enterprise-server@3.21/rest/gists","title":"지스트 (Gists)"},{"href":"/ko/enterprise-server@3.21/rest/gists/gists","title":"지스트 (Gists)"}],"documentType":"article"},"body":"# Gist에 대한 REST API 엔드포인트\n\nREST API를 사용하여 GitHub 공개 요지를 나열, 만들기, 업데이트 및 삭제합니다.\n\n## gist에 대하여\n\nREST API를 사용하여 gist를 보고 수정할 수 있습니다. gist에 대한 자세한 내용은 [Gist가 있는 콘텐츠의 편집 및 공유](/ko/enterprise-server@3.21/get-started/writing-on-github/editing-and-sharing-content-with-gists)을(를) 참조하세요.\n\n### 인증\n\n토큰이 없는 익명 사용자를 위해 퍼블릭 gist를 읽고 만들 수 있습니다. 사용자를 대신하여 gist를 읽거나 쓰려면 gist OAuth 범위와 토큰이 필요합니다. 자세한 내용은 [OAuth 앱에 대한 범위](/ko/enterprise-server@3.21/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps)을(를) 참조하세요.\n\n<!-- When an OAuth client does not have the gists scope, the API will return a 404 \"Not Found\" response regardless of the validity of the credentials. The API will return a 401 \"Bad credentials\" response if the gists scope was given to the application but the credentials are invalid. -->\n\n### 잘림\n\nAPI는 gist의 각 파일에 대해 최대 1MB의 콘텐츠를 제공합니다. API를 통해 gist용으로 반환된 각 파일에는 `truncated`라는 키가 있습니다.\n`truncated`가 `true`인 경우 파일이 너무 커서 내용의 일부만 `content`에 반환된 것입니다.\n\n파일의 전체 내용이 필요한 경우 `GET`에서 지정한 URL에 대해 `raw_url` 요청을 만들 수 있습니다. 10MB보다 큰 파일의 경우 `git_pull_url`에서 제공하는 URL을 통해 gist를 복제해야 합니다.\n\n특정 파일의 내용이 잘리는 것 외에도 총 파일 수가 300개를 초과하면 전체 파일 목록이 잘릴 수 있습니다. 최상위 `truncated` 키가 `true`경우 처음 300개 파일만 파일 목록에 반환됩니다. gist의 파일을 모두 가져와야 하는 경우 `git_pull_url`에서 제공하는 URL을 통해 gist를 복제해야 합니다.\n\n> \\[!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.\n\n## List gists for the authenticated user\n\n```\nGET /gists\n```\n\nLists the authenticated user's gists or if called anonymously, this endpoint returns all public gists:\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`since`** (string)\n  Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **304** - Not modified\n\n* **403** - Forbidden\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/gists\n```\n\n**Response schema (Status: 200):**\n\nArray of `Base Gist`:\n\n* `url`: required, string, format: uri\n* `forks_url`: required, string, format: uri\n* `commits_url`: required, string, format: uri\n* `id`: required, string\n* `node_id`: required, string\n* `git_pull_url`: required, string, format: uri\n* `git_push_url`: required, string, format: uri\n* `html_url`: required, string, format: uri\n* `files`: required, object, additional properties: object\n* `public`: required, boolean\n* `created_at`: required, string, format: date-time\n* `updated_at`: required, string, format: date-time\n* `description`: required, string or null\n* `comments`: required, integer\n* `comments_enabled`: boolean\n* `comments_url`: required, string, format: uri\n* `owner`: `Simple User`:\n  * `name`: string or null\n  * `email`: string or null\n  * `login`: required, string\n  * `id`: required, integer, format: int64\n  * `node_id`: required, string\n  * `avatar_url`: required, string, format: uri\n  * `gravatar_id`: required, string or null\n  * `url`: required, string, format: uri\n  * `html_url`: required, string, format: uri\n  * `followers_url`: required, string, format: uri\n  * `following_url`: required, string\n  * `gists_url`: required, string\n  * `starred_url`: required, string\n  * `subscriptions_url`: required, string, format: uri\n  * `organizations_url`: required, string, format: uri\n  * `repos_url`: required, string, format: uri\n  * `events_url`: required, string\n  * `received_events_url`: required, string, format: uri\n  * `type`: required, string\n  * `site_admin`: required, boolean\n  * `starred_at`: string\n  * `user_view_type`: string\n* `truncated`: boolean\n\n## Create a gist\n\n```\nPOST /gists\n```\n\nAllows you to add a new gist with one or more files.\nNote\n\nDon't name your files \"gistfile\" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Body parameters\n\n* **`description`** (string)\n  Description of the gist\n\n* **`files`** (object) (required)\n  Names and content for the files that make up the gist\n  * **`key`** (object)\n    A user-defined key to represent an item in files.\n    * **`content`** (string) (required)\n      Content of the file\n\n* **`public`** (boolean or string)\n  Flag indicating whether the gist is public\n\n### HTTP response status codes\n\n* **201** - Created\n\n* **304** - Not modified\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n* **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Creating a gist\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  http(s)://HOSTNAME/api/v3/gists \\\n  -d '{\n  \"description\": \"Example of a gist\",\n  \"public\": false,\n  \"files\": {\n    \"README.md\": {\n      \"content\": \"Hello World\"\n    }\n  }\n}'\n```\n\n**Response schema (Status: 201):**\n\n* `fork_of`: `Gist`:\n  * `url`: required, string, format: uri\n  * `forks_url`: required, string, format: uri\n  * `commits_url`: required, string, format: uri\n  * `id`: required, string\n  * `node_id`: required, string\n  * `git_pull_url`: required, string, format: uri\n  * `git_push_url`: required, string, format: uri\n  * `html_url`: required, string, format: uri\n  * `files`: required, object, additional properties: object\n  * `public`: required, boolean\n  * `created_at`: required, string, format: date-time\n  * `updated_at`: required, string, format: date-time\n  * `description`: required, string or null\n  * `comments`: required, integer\n  * `comments_enabled`: boolean\n  * `user`: required, any of:\n    * **null**\n    * **Simple User**\n      * `name`: string or null\n      * `email`: string or null\n      * `login`: required, string\n      * `id`: required, integer, format: int64\n      * `node_id`: required, string\n      * `avatar_url`: required, string, format: uri\n      * `gravatar_id`: required, string or null\n      * `url`: required, string, format: uri\n      * `html_url`: required, string, format: uri\n      * `followers_url`: required, string, format: uri\n      * `following_url`: required, string\n      * `gists_url`: required, string\n      * `starred_url`: required, string\n      * `subscriptions_url`: required, string, format: uri\n      * `organizations_url`: required, string, format: uri\n      * `repos_url`: required, string, format: uri\n      * `events_url`: required, string\n      * `received_events_url`: required, string, format: uri\n      * `type`: required, string\n      * `site_admin`: required, boolean\n      * `starred_at`: string\n      * `user_view_type`: string\n  * `comments_url`: required, string, format: uri\n  * `owner`: any of:\n    * **null**\n    * **Simple User** (see above)\n  * `truncated`: boolean\n  * `forks`: array of object\n  * `history`: array of object\n* `url`: string\n* `forks_url`: string\n* `commits_url`: string\n* `id`: string\n* `node_id`: string\n* `git_pull_url`: string\n* `git_push_url`: string\n* `html_url`: string\n* `files`: object, additional properties: object or null\n* `public`: boolean\n* `created_at`: string\n* `updated_at`: string\n* `description`: string or null\n* `comments`: integer\n* `comments_enabled`: boolean\n* `user`: string or null\n* `comments_url`: string\n* `owner`: `Simple User` (see above)\n* `truncated`: boolean\n\n## List public gists\n\n```\nGET /gists/public\n```\n\nList public gists sorted by most recently updated to least recently updated.\nNote: 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`since`** (string)\n  Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **304** - Not modified\n\n* **403** - Forbidden\n\n* **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/gists/public\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List gists for the authenticated user](#list-gists-for-the-authenticated-user).\n\n## List starred gists\n\n```\nGET /gists/starred\n```\n\nList the authenticated user's starred gists:\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`since`** (string)\n  Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **304** - Not modified\n\n* **401** - Requires authentication\n\n* **403** - Forbidden\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/gists/starred\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List gists for the authenticated user](#list-gists-for-the-authenticated-user).\n\n## Get a gist\n\n```\nGET /gists/{gist_id}\n```\n\nGets a specified gist.\nThis endpoint supports the following custom media types. For more information, see \"Media types.\"\n\napplication/vnd.github.raw+json: Returns the raw markdown. This is the default if you do not pass any specific media type.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`gist_id`** (string) (required)\n  The unique identifier of the gist.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **304** - Not modified\n\n* **403** - Forbidden Gist\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/gists/GIST_ID\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create a gist](#create-a-gist).\n\n## Update a gist\n\n```\nPATCH /gists/{gist_id}\n```\n\nAllows you to update a gist's description and to update, delete, or rename gist files. Files\nfrom the previous version of the gist that aren't explicitly changed during an edit\nare unchanged.\nAt least one of description or files is required.\nThis endpoint supports the following custom media types. For more information, see \"Media types.\"\n\napplication/vnd.github.raw+json: Returns the raw markdown. This is the default if you do not pass any specific media type.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`gist_id`** (string) (required)\n  The unique identifier of the gist.\n\n#### Body parameters\n\n* **`description`** (string)\n  The description of the gist.\n\n* **`files`** (object)\n  The gist files to be updated, renamed, or deleted. Each key must match the current filename\n  (including extension) of the targeted gist file. For example: hello.py.\n  To delete a file, set the whole file to null. For example: hello.py : null. The file will also be\n  deleted if the specified object does not contain at least one of content or filename.\n  * **`key`** (object)\n    A user-defined key to represent an item in files.\n    * **`content`** (string)\n      The new content of the file.\n    * **`filename`** (string or null)\n      The new filename for the file.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **404** - Resource not found\n\n* **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Updating a gist\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  http(s)://HOSTNAME/api/v3/gists/GIST_ID \\\n  -d '{\n  \"description\": \"An updated gist description\",\n  \"files\": {\n    \"README.md\": {\n      \"content\": \"Hello World from GitHub\"\n    }\n  }\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create a gist](#create-a-gist).\n\n#### Deleting a gist file\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  http(s)://HOSTNAME/api/v3/gists/GIST_ID \\\n  -d '{\n  \"files\": {\n    \"hello.py\": null\n  }\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create a gist](#create-a-gist).\n\n#### Renaming a gist file\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  http(s)://HOSTNAME/api/v3/gists/GIST_ID \\\n  -d '{\n  \"files\": {\n    \"hello.py\": {\n      \"filename\": \"goodbye.py\"\n    }\n  }\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create a gist](#create-a-gist).\n\n## Delete a gist\n\n```\nDELETE /gists/{gist_id}\n```\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`gist_id`** (string) (required)\n  The unique identifier of the gist.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **304** - Not modified\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  http(s)://HOSTNAME/api/v3/gists/GIST_ID\n```\n\n**Response schema (Status: 204):**\n\n## List gist commits\n\n```\nGET /gists/{gist_id}/commits\n```\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`gist_id`** (string) (required)\n  The unique identifier of the gist.\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **304** - Not modified\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/gists/GIST_ID/commits\n```\n\n**Response schema (Status: 200):**\n\nArray of `Gist Commit`:\n\n* `url`: required, string, format: uri\n* `version`: required, string\n* `user`: required, any of:\n  * **null**\n  * **Simple User**\n    * `name`: string or null\n    * `email`: string or null\n    * `login`: required, string\n    * `id`: required, integer, format: int64\n    * `node_id`: required, string\n    * `avatar_url`: required, string, format: uri\n    * `gravatar_id`: required, string or null\n    * `url`: required, string, format: uri\n    * `html_url`: required, string, format: uri\n    * `followers_url`: required, string, format: uri\n    * `following_url`: required, string\n    * `gists_url`: required, string\n    * `starred_url`: required, string\n    * `subscriptions_url`: required, string, format: uri\n    * `organizations_url`: required, string, format: uri\n    * `repos_url`: required, string, format: uri\n    * `events_url`: required, string\n    * `received_events_url`: required, string, format: uri\n    * `type`: required, string\n    * `site_admin`: required, boolean\n    * `starred_at`: string\n    * `user_view_type`: string\n* `change_status`: required, object:\n  * `total`: integer\n  * `additions`: integer\n  * `deletions`: integer\n* `committed_at`: required, string, format: date-time\n\n## List gist forks\n\n```\nGET /gists/{gist_id}/forks\n```\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`gist_id`** (string) (required)\n  The unique identifier of the gist.\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **304** - Not modified\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/gists/GIST_ID/forks\n```\n\n**Response schema (Status: 200):**\n\nArray of `Gist Simple`:\n\n* `fork_of`: `Gist`:\n  * `url`: required, string, format: uri\n  * `forks_url`: required, string, format: uri\n  * `commits_url`: required, string, format: uri\n  * `id`: required, string\n  * `node_id`: required, string\n  * `git_pull_url`: required, string, format: uri\n  * `git_push_url`: required, string, format: uri\n  * `html_url`: required, string, format: uri\n  * `files`: required, object, additional properties: object\n  * `public`: required, boolean\n  * `created_at`: required, string, format: date-time\n  * `updated_at`: required, string, format: date-time\n  * `description`: required, string or null\n  * `comments`: required, integer\n  * `comments_enabled`: boolean\n  * `user`: required, any of:\n    * **null**\n    * **Simple User**\n      * `name`: string or null\n      * `email`: string or null\n      * `login`: required, string\n      * `id`: required, integer, format: int64\n      * `node_id`: required, string\n      * `avatar_url`: required, string, format: uri\n      * `gravatar_id`: required, string or null\n      * `url`: required, string, format: uri\n      * `html_url`: required, string, format: uri\n      * `followers_url`: required, string, format: uri\n      * `following_url`: required, string\n      * `gists_url`: required, string\n      * `starred_url`: required, string\n      * `subscriptions_url`: required, string, format: uri\n      * `organizations_url`: required, string, format: uri\n      * `repos_url`: required, string, format: uri\n      * `events_url`: required, string\n      * `received_events_url`: required, string, format: uri\n      * `type`: required, string\n      * `site_admin`: required, boolean\n      * `starred_at`: string\n      * `user_view_type`: string\n  * `comments_url`: required, string, format: uri\n  * `owner`: any of:\n    * **null**\n    * **Simple User** (see above)\n  * `truncated`: boolean\n  * `forks`: array of object\n  * `history`: array of object\n* `url`: string\n* `forks_url`: string\n* `commits_url`: string\n* `id`: string\n* `node_id`: string\n* `git_pull_url`: string\n* `git_push_url`: string\n* `html_url`: string\n* `files`: object, additional properties: object or null\n* `public`: boolean\n* `created_at`: string\n* `updated_at`: string\n* `description`: string or null\n* `comments`: integer\n* `comments_enabled`: boolean\n* `user`: string or null\n* `comments_url`: string\n* `owner`: `Simple User` (see above)\n* `truncated`: boolean\n\n## Fork a gist\n\n```\nPOST /gists/{gist_id}/forks\n```\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`gist_id`** (string) (required)\n  The unique identifier of the gist.\n\n### HTTP response status codes\n\n* **201** - Created\n\n* **304** - Not modified\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n* **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  http(s)://HOSTNAME/api/v3/gists/GIST_ID/forks\n```\n\n**Response schema (Status: 201):**\n\n* `url`: required, string, format: uri\n* `forks_url`: required, string, format: uri\n* `commits_url`: required, string, format: uri\n* `id`: required, string\n* `node_id`: required, string\n* `git_pull_url`: required, string, format: uri\n* `git_push_url`: required, string, format: uri\n* `html_url`: required, string, format: uri\n* `files`: required, object, additional properties: object\n* `public`: required, boolean\n* `created_at`: required, string, format: date-time\n* `updated_at`: required, string, format: date-time\n* `description`: required, string or null\n* `comments`: required, integer\n* `comments_enabled`: boolean\n* `comments_url`: required, string, format: uri\n* `owner`: `Simple User`:\n  * `name`: string or null\n  * `email`: string or null\n  * `login`: required, string\n  * `id`: required, integer, format: int64\n  * `node_id`: required, string\n  * `avatar_url`: required, string, format: uri\n  * `gravatar_id`: required, string or null\n  * `url`: required, string, format: uri\n  * `html_url`: required, string, format: uri\n  * `followers_url`: required, string, format: uri\n  * `following_url`: required, string\n  * `gists_url`: required, string\n  * `starred_url`: required, string\n  * `subscriptions_url`: required, string, format: uri\n  * `organizations_url`: required, string, format: uri\n  * `repos_url`: required, string, format: uri\n  * `events_url`: required, string\n  * `received_events_url`: required, string, format: uri\n  * `type`: required, string\n  * `site_admin`: required, boolean\n  * `starred_at`: string\n  * `user_view_type`: string\n* `truncated`: boolean\n\n## Check if a gist is starred\n\n```\nGET /gists/{gist_id}/star\n```\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`gist_id`** (string) (required)\n  The unique identifier of the gist.\n\n### HTTP response status codes\n\n* **204** - Response if gist is starred\n\n* **304** - Not modified\n\n* **403** - Forbidden\n\n* **404** - Not Found if gist is not starred\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/gists/GIST_ID/star\n```\n\n**Response schema (Status: 204):**\n\n## Star a gist\n\n```\nPUT /gists/{gist_id}/star\n```\n\nNote that you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see \"HTTP method.\"\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`gist_id`** (string) (required)\n  The unique identifier of the gist.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **304** - Not modified\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  http(s)://HOSTNAME/api/v3/gists/GIST_ID/star\n```\n\n**Response schema (Status: 204):**\n\n## Unstar a gist\n\n```\nDELETE /gists/{gist_id}/star\n```\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`gist_id`** (string) (required)\n  The unique identifier of the gist.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **304** - Not modified\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  http(s)://HOSTNAME/api/v3/gists/GIST_ID/star\n```\n\n**Response schema (Status: 204):**\n\n## Get a gist revision\n\n```\nGET /gists/{gist_id}/{sha}\n```\n\nGets a specified gist revision.\nThis endpoint supports the following custom media types. For more information, see \"Media types.\"\n\napplication/vnd.github.raw+json: Returns the raw markdown. This is the default if you do not pass any specific media type.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`gist_id`** (string) (required)\n  The unique identifier of the gist.\n\n* **`sha`** (string) (required)\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n* **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/gists/GIST_ID/SHA\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create a gist](#create-a-gist).\n\n## List gists for a user\n\n```\nGET /users/{username}/gists\n```\n\nLists public gists for the specified user:\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n* **`since`** (string)\n  Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/users/USERNAME/gists\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List gists for the authenticated user](#list-gists-for-the-authenticated-user)."}