{"meta":{"title":"グローバル Webhook の REST API エンドポイント","intro":"この REST API を使い、企業のグローバル Webhook を管理します。","product":"REST API","breadcrumbs":[{"href":"/ja/enterprise-server@3.22/rest","title":"REST API"},{"href":"/ja/enterprise-server@3.22/rest/enterprise-admin","title":"企業管理"},{"href":"/ja/enterprise-server@3.22/rest/enterprise-admin/global-webhooks","title":"グローバルウェブフック"}],"documentType":"article"},"body":"# グローバル Webhook の REST API エンドポイント\n\nこの REST API を使い、企業のグローバル Webhook を管理します。\n\n## グローバルwebhookについて\n\nこれらのエンドポイントは[認証された](/ja/enterprise-server@3.22/rest/authentication/authenticating-to-the-rest-api)サイト管理者のみが利用できます。通常のユーザーには `404` 応答が届きます。 グローバル Webhook を構成する方法については、「[グローバル Webhook について](/ja/enterprise-server@3.22/admin/monitoring-activity-in-your-enterprise/exploring-user-activity-in-your-enterprise/managing-global-webhooks)」を参照してください。\n\nグローバル Webhook は企業に自動的にインストールされます。 グローバル webhook を使用して、エンタープライズのユーザ、組織、チーム、およびリポジトリに対するルールを自動的に監視、対応、または強制することができます。\n\nグローバル Webhook は、[Organization](/ja/enterprise-server@3.22/webhooks/webhook-events-and-payloads#organization)、[ユーザー](/ja/enterprise-server@3.22/webhooks/webhook-events-and-payloads#user)、[リポジトリ](/ja/enterprise-server@3.22/webhooks/webhook-events-and-payloads#repository)、[チーム](/ja/enterprise-server@3.22/webhooks/webhook-events-and-payloads#team)、[メンバー](/ja/enterprise-server@3.22/webhooks/webhook-events-and-payloads#member)、[メンバーシップ](/ja/enterprise-server@3.22/webhooks/webhook-events-and-payloads#membership)、[フォーク](/ja/enterprise-server@3.22/webhooks/webhook-events-and-payloads#fork)、および [ping](/ja/enterprise-server@3.22/webhooks/about-webhooks#ping-event) イベントの種類をサブスクライブできます。\n\n> \\[!NOTE]\n> これらのエンドポイントでは、personal access token (classic) を使う認証のみがサポートされます。 詳しくは、「[個人用アクセス トークンを管理する](/ja/enterprise-server@3.22/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic)」をご覧ください。\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 global webhooks\n\n```\nGET /admin/hooks\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* **`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### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/admin/hooks\n```\n\n**Response schema (Status: 200):**\n\nArray of objects:\n\n* `type`: string\n* `id`: integer\n* `name`: string\n* `active`: boolean\n* `events`: array of string\n* `config`: object:\n  * `url`: string\n  * `content_type`: string\n  * `insecure_ssl`: string\n  * `secret`: string\n* `updated_at`: string\n* `created_at`: string\n* `url`: string\n* `ping_url`: string\n\n## Create a global webhook\n\n```\nPOST /admin/hooks\n```\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* **`name`** (string) (required)\n  Must be passed as \"web\".\n\n* **`config`** (object) (required)\n  Key/value pairs to provide settings for this webhook.\n  * **`url`** (string) (required)\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 in the X-Hub-Signature header.\n  * **`insecure_ssl`** (string)\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  The events that trigger this webhook. A global webhook can be triggered by user and organization events. Default: user and organization.\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### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  http(s)://HOSTNAME/api/v3/admin/hooks \\\n  -d '{\n  \"name\": \"web\",\n  \"events\": [\n    \"organization\",\n    \"user\"\n  ],\n  \"config\": {\n    \"url\": \"https://example.com/webhook\",\n    \"content_type\": \"json\",\n    \"secret\": \"secret\"\n  }\n}'\n```\n\n**Response schema (Status: 201):**\n\n* `type`: string\n* `id`: integer\n* `name`: string\n* `active`: boolean\n* `events`: array of string\n* `config`: object:\n  * `url`: string\n  * `content_type`: string\n  * `insecure_ssl`: string\n  * `secret`: string\n* `updated_at`: string\n* `created_at`: string\n* `url`: string\n* `ping_url`: string\n\n## Get a global webhook\n\n```\nGET /admin/hooks/{hook_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* **`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  http(s)://HOSTNAME/api/v3/admin/hooks/HOOK_ID\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Create a global webhook](#create-a-global-webhook).\n\n## Update a global webhook\n\n```\nPATCH /admin/hooks/{hook_id}\n```\n\nParameters that are not provided will be overwritten with the default value or removed if no default exists.\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* **`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  Key/value pairs to provide settings for this webhook.\n  * **`url`** (string) (required)\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 in the X-Hub-Signature header.\n  * **`insecure_ssl`** (string)\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  The events that trigger this webhook. A global webhook can be triggered by user and organization events. Default: user and organization.\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### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  http(s)://HOSTNAME/api/v3/admin/hooks/HOOK_ID \\\n  -d '{\n  \"events\": [\n    \"organization\"\n  ],\n  \"config\": {\n    \"url\": \"https://example.com/webhook\"\n  }\n}'\n```\n\n**Response schema (Status: 200):**\n\n* `type`: string\n* `id`: integer\n* `name`: string\n* `active`: boolean\n* `events`: array of string\n* `config`: object:\n  * `url`: string\n  * `content_type`: string\n  * `insecure_ssl`: string\n* `updated_at`: string\n* `created_at`: string\n* `url`: string\n* `ping_url`: string\n\n## Delete a global webhook\n\n```\nDELETE /admin/hooks/{hook_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* **`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### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  http(s)://HOSTNAME/api/v3/admin/hooks/HOOK_ID\n```\n\n**Response schema (Status: 204):**\n\n## Ping a global webhook\n\n```\nPOST /admin/hooks/{hook_id}/pings\n```\n\nThis will trigger a ping event to be sent to 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* **`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### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  http(s)://HOSTNAME/api/v3/admin/hooks/HOOK_ID/pings\n```\n\n**Response schema (Status: 204):**"}