{"meta":{"title":"リポジトリ ウェブフック の REST API エンドポイント","intro":"REST API を使って、リポジトリ用に Webhook を作成および管理できます。","product":"REST API","breadcrumbs":[{"href":"/ja/rest","title":"REST API"},{"href":"/ja/rest/repos","title":"リポジトリ"},{"href":"/ja/rest/repos/webhooks","title":"ウェブフック"}],"documentType":"article"},"body":"# リポジトリ ウェブフック の REST API エンドポイント\n\nREST API を使って、リポジトリ用に Webhook を作成および管理できます。\n\n## リポジトリ Webhook について\n\nリポジトリ Webhook を使用すると、リポジトリで特定のイベントが発生した場合に、サーバーが必ず HTTP `POST` ペイロードを受け取ることができます。 詳しくは、「[Webhook ドキュメント](/ja/webhooks)」をご覧ください。\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 repository webhooks\n\n```\nGET /repos/{owner}/{repo}/hooks\n```\n\nLists webhooks for a repository. last response may return null if there have not been any deliveries within 30 days.\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* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\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* **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/repos/OWNER/REPO/hooks\n```\n\n**Response schema (Status: 200):**\n\nArray of `Webhook`:\n\n* `type`: required, string\n* `id`: required, integer\n* `name`: required, string\n* `active`: required, boolean\n* `events`: required, array of string\n* `config`: required, `Webhook Configuration`:\n  * `url`: string, format: uri\n  * `content_type`: string\n  * `secret`: string\n  * `insecure_ssl`: one of:\n    * **string**\n    * **number**\n* `updated_at`: required, string, format: date-time\n* `created_at`: required, string, format: date-time\n* `url`: required, string, format: uri\n* `test_url`: required, string, format: uri\n* `ping_url`: required, string, format: uri\n* `deliveries_url`: string, format: uri\n* `last_response`: required, `Hook Response`:\n  * `code`: required, integer or null\n  * `status`: required, string or null\n  * `message`: required, string or null\n\n## Create a repository webhook\n\n```\nPOST /repos/{owner}/{repo}/hooks\n```\n\nRepositories can have multiple webhooks installed. Each webhook should have a unique config. Multiple webhooks can\nshare the same config as long as those webhooks do not have any events that overlap.\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* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n#### Body parameters\n\n* **`name`** (string)\n  Use web to create a webhook. Default: web. This parameter only accepts the value web.\n\n* **`config`** (object)\n  Key/value pairs to provide settings for this webhook.\n  * **`url`** (string)\n    The URL to which the payloads will be delivered.\n  * **`content_type`** (string)\n    The media type used to serialize the payloads. Supported values include json and form. The default is form.\n  * **`secret`** (string)\n    If provided, the secret will be used as the key to generate the HMAC hex digest value for delivery signature headers.\n  * **`insecure_ssl`** (string or number)\n    Determines whether the SSL certificate of the host for url will be verified when delivering payloads. Supported values include 0 (verification is performed) and 1 (verification is not performed). The default is 0. We strongly recommend not setting this to 1 as you are subject to man-in-the-middle and other attacks.\n\n* **`events`** (array of strings)\n  Determines what events the hook is triggered for.\n  Default: `push`\n\n* **`active`** (boolean)\n  Determines if notifications are sent when the webhook is triggered. Set to true to send notifications.\n  Default: `true`\n\n### HTTP response status codes\n\n* **201** - Created\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  https://api.github.com/repos/OWNER/REPO/hooks \\\n  -d '{\n  \"name\": \"web\",\n  \"active\": true,\n  \"events\": [\n    \"push\",\n    \"pull_request\"\n  ],\n  \"config\": {\n    \"url\": \"https://example.com/webhook\",\n    \"content_type\": \"json\",\n    \"insecure_ssl\": \"0\"\n  }\n}'\n```\n\n**Response schema (Status: 201):**\n\n* `type`: required, string\n* `id`: required, integer\n* `name`: required, string\n* `active`: required, boolean\n* `events`: required, array of string\n* `config`: required, `Webhook Configuration`:\n  * `url`: string, format: uri\n  * `content_type`: string\n  * `secret`: string\n  * `insecure_ssl`: one of:\n    * **string**\n    * **number**\n* `updated_at`: required, string, format: date-time\n* `created_at`: required, string, format: date-time\n* `url`: required, string, format: uri\n* `test_url`: required, string, format: uri\n* `ping_url`: required, string, format: uri\n* `deliveries_url`: string, format: uri\n* `last_response`: required, `Hook Response`:\n  * `code`: required, integer or null\n  * `status`: required, string or null\n  * `message`: required, string or null\n\n## Get a repository webhook\n\n```\nGET /repos/{owner}/{repo}/hooks/{hook_id}\n```\n\nReturns a webhook configured in a repository. To get only the webhook config properties, see \"Get a webhook configuration for a repository.\"\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* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`hook_id`** (integer) (required)\n  The unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.\n\n### HTTP response status codes\n\n* **200** - OK\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/repos/OWNER/REPO/hooks/HOOK_ID\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create a repository webhook](#create-a-repository-webhook).\n\n## Update a repository webhook\n\n```\nPATCH /repos/{owner}/{repo}/hooks/{hook_id}\n```\n\nUpdates a webhook configured in a repository. If you previously had a secret set, you must provide the same secret or set a new secret or the secret will be removed. If you are only updating individual webhook config properties, use \"Update a webhook configuration for a repository.\"\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* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`hook_id`** (integer) (required)\n  The unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.\n\n#### Body parameters\n\n* **`config`** (object)\n  Configuration object of the webhook\n  * **`url`** (string)\n    The URL to which the payloads will be delivered.\n  * **`content_type`** (string)\n    The media type used to serialize the payloads. Supported values include json and form. The default is form.\n  * **`secret`** (string)\n    If provided, the secret will be used as the key to generate the HMAC hex digest value for delivery signature headers.\n  * **`insecure_ssl`** (string or number)\n    Determines whether the SSL certificate of the host for url will be verified when delivering payloads. Supported values include 0 (verification is performed) and 1 (verification is not performed). The default is 0. We strongly recommend not setting this to 1 as you are subject to man-in-the-middle and other attacks.\n\n* **`events`** (array of strings)\n  Determines what events the hook is triggered for. This replaces the entire array of events.\n  Default: `push`\n\n* **`add_events`** (array of strings)\n  Determines a list of events to be added to the list of events that the Hook triggers for.\n\n* **`remove_events`** (array of strings)\n  Determines a list of events to be removed from the list of events that the Hook triggers for.\n\n* **`active`** (boolean)\n  Determines if notifications are sent when the webhook is triggered. Set to true to send notifications.\n  Default: `true`\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#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID \\\n  -d '{\n  \"active\": true,\n  \"add_events\": [\n    \"pull_request\"\n  ]\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create a repository webhook](#create-a-repository-webhook).\n\n## Delete a repository webhook\n\n```\nDELETE /repos/{owner}/{repo}/hooks/{hook_id}\n```\n\nDelete a webhook for an organization.\nThe authenticated user must be a repository owner, or have admin access in the repository, to delete the webhook.\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* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`hook_id`** (integer) (required)\n  The unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.\n\n### HTTP response status codes\n\n* **204** - No Content\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/repos/OWNER/REPO/hooks/HOOK_ID\n```\n\n**Response schema (Status: 204):**\n\n## Get a webhook configuration for a repository\n\n```\nGET /repos/{owner}/{repo}/hooks/{hook_id}/config\n```\n\nReturns the webhook configuration for a repository. To get more information about the webhook, including the active state and events, use \"Get a repository webhook.\"\nOAuth app tokens and personal access tokens (classic) need the read:repo\\_hook or repo scope to use this endpoint.\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* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`hook_id`** (integer) (required)\n  The unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID/config\n```\n\n**Response schema (Status: 200):**\n\n* `url`: string, format: uri\n* `content_type`: string\n* `secret`: string\n* `insecure_ssl`: one of:\n  * **string**\n  * **number**\n\n## Update a webhook configuration for a repository\n\n```\nPATCH /repos/{owner}/{repo}/hooks/{hook_id}/config\n```\n\nUpdates the webhook configuration for a repository. To update more information about the webhook, including the active state and events, use \"Update a repository webhook.\"\nOAuth app tokens and personal access tokens (classic) need the write:repo\\_hook or repo scope to use this endpoint.\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* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`hook_id`** (integer) (required)\n  The unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.\n\n#### Body parameters\n\n* **`url`** (string)\n  The URL to which the payloads will be delivered.\n\n* **`content_type`** (string)\n  The media type used to serialize the payloads. Supported values include json and form. The default is form.\n\n* **`secret`** (string)\n  If provided, the secret will be used as the key to generate the HMAC hex digest value for delivery signature headers.\n\n* **`insecure_ssl`** (string or number)\n  Determines whether the SSL certificate of the host for url will be verified when delivering payloads. Supported values include 0 (verification is performed) and 1 (verification is not performed). The default is 0. We strongly recommend not setting this to 1 as you are subject to man-in-the-middle and other attacks.\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example of updating content type and URL\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID/config \\\n  -d '{\n  \"content_type\": \"json\",\n  \"url\": \"https://example.com/webhook\"\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Get a webhook configuration for a repository](#get-a-webhook-configuration-for-a-repository).\n\n## List deliveries for a repository webhook\n\n```\nGET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\n```\n\nReturns a list of webhook deliveries for a webhook configured in a repository.\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* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`hook_id`** (integer) (required)\n  The unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.\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* **`cursor`** (string)\n  Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the link header for the next and previous page cursors.\n\n* **`status`** (string)\n  Returns webhook deliveries filtered by delivery outcome classification based on status\\_code range. A status of success returns deliveries with a status\\_code in the 200-399 range (inclusive). A status of failure returns deliveries with a status\\_code in the 400-599 range (inclusive).\n  Can be one of: `success`, `failure`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **400** - Bad Request\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  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID/deliveries\n```\n\n**Response schema (Status: 200):**\n\nArray of `Simple webhook delivery`:\n\n* `id`: required, integer, format: int64\n* `guid`: required, string\n* `delivered_at`: required, string, format: date-time\n* `redelivery`: required, boolean\n* `duration`: required, number\n* `status`: required, string\n* `status_code`: required, integer\n* `event`: required, string\n* `action`: required, string or null\n* `installation_id`: required, integer or null, format: int64\n* `repository_id`: required, integer or null, format: int64\n* `throttled_at`: string or null, format: date-time\n\n## Get a delivery for a repository webhook\n\n```\nGET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}\n```\n\nReturns a delivery for a webhook configured in a repository.\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* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`hook_id`** (integer) (required)\n  The unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.\n\n* **`delivery_id`** (integer) (required)\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **400** - Bad Request\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  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID/deliveries/DELIVERY_ID\n```\n\n**Response schema (Status: 200):**\n\n* `id`: required, integer\n* `guid`: required, string\n* `delivered_at`: required, string, format: date-time\n* `redelivery`: required, boolean\n* `duration`: required, number\n* `status`: required, string\n* `status_code`: required, integer\n* `event`: required, string\n* `action`: required, string or null\n* `installation_id`: required, integer or null\n* `repository_id`: required, integer or null\n* `throttled_at`: string or null, format: date-time\n* `url`: string\n* `request`: required, object:\n  * `headers`: required, object or null, additional properties allowed\n  * `payload`: required, object or null, additional properties allowed\n* `response`: required, object:\n  * `headers`: required, object or null, additional properties allowed\n  * `payload`: required, string or null, additional properties allowed\n\n## Redeliver a delivery for a repository webhook\n\n```\nPOST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\n```\n\nRedeliver a webhook delivery for a webhook configured in a repository.\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* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`hook_id`** (integer) (required)\n  The unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.\n\n* **`delivery_id`** (integer) (required)\n\n### HTTP response status codes\n\n* **202** - Accepted\n\n* **400** - Bad Request\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  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID/deliveries/DELIVERY_ID/attempts\n```\n\n**Response schema (Status: 202):**\n\nobject\n\n## Ping a repository webhook\n\n```\nPOST /repos/{owner}/{repo}/hooks/{hook_id}/pings\n```\n\nThis will trigger a ping event to be sent to the hook.\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* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`hook_id`** (integer) (required)\n  The unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID/pings\n```\n\n**Response schema (Status: 204):**\n\n## Test the push repository webhook\n\n```\nPOST /repos/{owner}/{repo}/hooks/{hook_id}/tests\n```\n\nThis will trigger the hook with the latest push to the current repository if the hook is subscribed to push events. If the hook is not subscribed to push events, the server will respond with 204 but no test POST will be generated.\nNote\n\nPreviously /repos/:owner/:repo/hooks/:hook\\_id/test\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* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`hook_id`** (integer) (required)\n  The unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID/tests\n```\n\n**Response schema (Status: 204):**"}