{"meta":{"title":"글로벌 웹후크에 대한 REST API 엔드포인트","intro":"REST API를 사용하여 엔터프라이즈의 글로벌 웹후크를 관리합니다.","product":"REST API","breadcrumbs":[{"href":"/ko/enterprise-server@3.19/rest","title":"REST API"},{"href":"/ko/enterprise-server@3.19/rest/enterprise-admin","title":"기업 관리자"},{"href":"/ko/enterprise-server@3.19/rest/enterprise-admin/global-webhooks","title":"글로벌 웹후크"}],"documentType":"article"},"body":"# 글로벌 웹후크에 대한 REST API 엔드포인트\n\nREST API를 사용하여 엔터프라이즈의 글로벌 웹후크를 관리합니다.\n\n## 글로벌 웹후크 정보\n\n이러한 엔드포인트는 [인증된](/ko/enterprise-server@3.19/rest/authentication/authenticating-to-the-rest-api) 사이트 관리자만 사용할 수 있습니다. 일반 사용자는 `404` 응답을 받습니다. 전역 웹후크를 구성하는 방법을 알아보려면 [전역 웹후크 정보](/ko/enterprise-server@3.19/admin/monitoring-activity-in-your-enterprise/exploring-user-activity-in-your-enterprise/managing-global-webhooks)를 참조하세요.\n\n전역 웹후크는 자동적으로 엔터프라이즈에 설치됩니다. 전역 웹후크를 사용하여 엔터프라이즈의 사용자, 조직, 팀 및 리포지토리에 대한 규칙을 자동으로 모니터링하거나 적용하고 대응할 수 있습니다.\n\n전역 웹후크는 [조직](/ko/enterprise-server@3.19/webhooks/webhook-events-and-payloads#organization), [사용자](/ko/enterprise-server@3.19/webhooks/webhook-events-and-payloads#user), [리포지토리](/ko/enterprise-server@3.19/webhooks/webhook-events-and-payloads#repository), [팀](/ko/enterprise-server@3.19/webhooks/webhook-events-and-payloads#team), [구성원](/ko/enterprise-server@3.19/webhooks/webhook-events-and-payloads#member), [멤버 자격](/ko/enterprise-server@3.19/webhooks/webhook-events-and-payloads#membership), [포크](/ko/enterprise-server@3.19/webhooks/webhook-events-and-payloads#fork) 및 [ping](/ko/enterprise-server@3.19/webhooks/about-webhooks#ping-event) 이벤트 유형을 구독할 수 있습니다.\n\n> \\[!NOTE]\n> 이러한 엔드포인트는 personal access token (classic)을(를) 사용하는 인증만 지원합니다. 자세한 내용은 [개인용 액세스 토큰 관리](/ko/enterprise-server@3.19/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: 2022-11-28`. 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):**"}