{"meta":{"title":"REST API エンドポイント（gist 用）","intro":"REST API を使用して、GitHubのパブリック gists の一覧表示、作成、更新、削除を行います。","product":"REST API","breadcrumbs":[{"href":"/ja/enterprise-server@3.20/rest","title":"REST API"},{"href":"/ja/enterprise-server@3.20/rest/gists","title":"Gists"},{"href":"/ja/enterprise-server@3.20/rest/gists/gists","title":"Gists"}],"documentType":"article"},"body":"# REST API エンドポイント（gist 用）\n\nREST API を使用して、GitHubのパブリック gists の一覧表示、作成、更新、削除を行います。\n\n## Gistsについて\n\nREST API を使うと、gist を表示および変更できます。 gist の詳細については、「[Gist でコンテンツを編集・共有する](/ja/enterprise-server@3.20/get-started/writing-on-github/editing-and-sharing-content-with-gists)」を参照してください。\n\nこれらのステップを実行してください：\n\n### 認証\n\nパブリック gist を読んで、トークンを持たない匿名ユーザー向けに作成できます。ユーザーに代わって gist を読み書きするには、Gist OAuth スコープとトークンが必要です。 詳しくは、「[OAuth アプリのスコープ](/ja/enterprise-server@3.20/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 内の各ファイルに最大 1 メガバイトのコンテンツを提供します。 API から gist に対して返される各ファイルには、`truncated` というキーがあります。\n`truncated` が `true`は、ファイルが大きすぎるため、コンテンツの一部のみが `content` で返されました。\n\nファイルの完全なコンテンツが必要な場合は、`GET` で指定された URL に `raw_url` 要求を送信できます。 10 メガバイトを超えるファイルの場合、`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: 2022-11-28`. 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* `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`: `Simple User` (see above)\n* `truncated`: boolean\n* `forks`: array of object\n* `history`: array of object\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* `forks`: array of objects or null:\n  * `id`: string\n  * `url`: string, format: uri\n  * `user`: `Public User`:\n    * `login`: required, string\n    * `id`: required, integer, format: int64\n    * `user_view_type`: string\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    * `name`: required, string or null\n    * `company`: required, string or null\n    * `blog`: required, string or null\n    * `location`: required, string or null\n    * `email`: required, string or null, format: email\n    * `notification_email`: string or null, format: email\n    * `hireable`: required, boolean or null\n    * `bio`: required, string or null\n    * `twitter_username`: string or null\n    * `public_repos`: required, integer\n    * `public_gists`: required, integer\n    * `followers`: required, integer\n    * `following`: required, integer\n    * `created_at`: required, string, format: date-time\n    * `updated_at`: required, string, format: date-time\n    * `plan`: object:\n      * `collaborators`: required, integer\n      * `name`: required, string\n      * `space`: required, integer\n      * `private_repos`: required, integer\n    * `private_gists`: integer\n    * `total_private_repos`: integer\n    * `owned_private_repos`: integer\n    * `disk_usage`: integer\n    * `collaborators`: integer\n  * `created_at`: string, format: date-time\n  * `updated_at`: string, format: date-time\n* `history`: array of `Gist History` or null:\n  * `user`: 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  * `version`: string\n  * `committed_at`: string, format: date-time\n  * `change_status`: object:\n    * `total`: integer\n    * `additions`: integer\n    * `deletions`: integer\n  * `url`: string, format: uri\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** (see above)\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* `forks`: array of objects or null:\n  * `id`: string\n  * `url`: string, format: uri\n  * `user`: `Public User`:\n    * `login`: required, string\n    * `id`: required, integer, format: int64\n    * `user_view_type`: string\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    * `name`: required, string or null\n    * `company`: required, string or null\n    * `blog`: required, string or null\n    * `location`: required, string or null\n    * `email`: required, string or null, format: email\n    * `notification_email`: string or null, format: email\n    * `hireable`: required, boolean or null\n    * `bio`: required, string or null\n    * `twitter_username`: string or null\n    * `public_repos`: required, integer\n    * `public_gists`: required, integer\n    * `followers`: required, integer\n    * `following`: required, integer\n    * `created_at`: required, string, format: date-time\n    * `updated_at`: required, string, format: date-time\n    * `plan`: object:\n      * `collaborators`: required, integer\n      * `name`: required, string\n      * `space`: required, integer\n      * `private_repos`: required, integer\n    * `private_gists`: integer\n    * `total_private_repos`: integer\n    * `owned_private_repos`: integer\n    * `disk_usage`: integer\n    * `collaborators`: integer\n  * `created_at`: string, format: date-time\n  * `updated_at`: string, format: date-time\n* `history`: array of `Gist History` or null:\n  * `user`: 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  * `version`: string\n  * `committed_at`: string, format: date-time\n  * `change_status`: object:\n    * `total`: integer\n    * `additions`: integer\n    * `deletions`: integer\n  * `url`: string, format: uri\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** (see above)\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* `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`: `Simple User` (see above)\n* `truncated`: boolean\n* `forks`: array of object\n* `history`: array of object\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)."}