{"meta":{"title":"Конечные точки REST API для комментариев gist","intro":"Используйте REST API для просмотра и изменения комментариев в gist.","product":"REST API","breadcrumbs":[{"href":"/ru/rest","title":"REST API"},{"href":"/ru/rest/gists","title":"Gist"},{"href":"/ru/rest/gists/comments","title":"Комментарии"}],"documentType":"article"},"body":"# Конечные точки REST API для комментариев gist\n\nИспользуйте REST API для просмотра и изменения комментариев в gist.\n\n## О комментариях gist\n\nRest API можно использовать для просмотра и изменения комментариев в gist. Дополнительные сведения о gists см. в разделе [Изменение и совместное использование содержимого с помощью gist](/ru/get-started/writing-on-github/editing-and-sharing-content-with-gists).\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 gist comments\n\n```\nGET /gists/{gist_id}/comments\n```\n\nLists the comments on a 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* **`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  https://api.github.com/gists/GIST_ID/comments\n```\n\n**Response schema (Status: 200):**\n\nArray of `Gist Comment`:\n\n* `id`: required, integer\n* `node_id`: required, string\n* `url`: required, string, format: uri\n* `body`: required, string, maxLength: 65535\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* `created_at`: required, string, format: date-time\n* `updated_at`: required, string, format: date-time\n* `author_association`: required, string, enum: `COLLABORATOR`, `CONTRIBUTOR`, `FIRST_TIMER`, `FIRST_TIME_CONTRIBUTOR`, `MANNEQUIN`, `MEMBER`, `NONE`, `OWNER`\n\n## Create a gist comment\n\n```\nPOST /gists/{gist_id}/comments\n```\n\nCreates a comment on a 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#### Body parameters\n\n* **`body`** (string) (required)\n  The comment text.\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### Code examples\n\n#### Creating a comment in a gist\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/gists/GIST_ID/comments \\\n  -d '{\n  \"body\": \"This is a comment to a gist\"\n}'\n```\n\n**Response schema (Status: 201):**\n\n* `id`: required, integer\n* `node_id`: required, string\n* `url`: required, string, format: uri\n* `body`: required, string, maxLength: 65535\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* `created_at`: required, string, format: date-time\n* `updated_at`: required, string, format: date-time\n* `author_association`: required, string, enum: `COLLABORATOR`, `CONTRIBUTOR`, `FIRST_TIMER`, `FIRST_TIME_CONTRIBUTOR`, `MANNEQUIN`, `MEMBER`, `NONE`, `OWNER`\n\n## Get a gist comment\n\n```\nGET /gists/{gist_id}/comments/{comment_id}\n```\n\nGets a comment on a 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* **`comment_id`** (integer) (required)\n  The unique identifier of the comment.\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  https://api.github.com/gists/GIST_ID/comments/COMMENT_ID\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create a gist comment](#create-a-gist-comment).\n\n## Update a gist comment\n\n```\nPATCH /gists/{gist_id}/comments/{comment_id}\n```\n\nUpdates a comment on a 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* **`comment_id`** (integer) (required)\n  The unique identifier of the comment.\n\n#### Body parameters\n\n* **`body`** (string) (required)\n  The comment text.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Updating a comment in a gist\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  https://api.github.com/gists/GIST_ID/comments/COMMENT_ID \\\n  -d '{\n  \"body\": \"This is an update to a comment in a gist\"\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create a gist comment](#create-a-gist-comment).\n\n## Delete a gist comment\n\n```\nDELETE /gists/{gist_id}/comments/{comment_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* **`comment_id`** (integer) (required)\n  The unique identifier of the comment.\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  https://api.github.com/gists/GIST_ID/comments/COMMENT_ID\n```\n\n**Response schema (Status: 204):**"}