{"meta":{"title":"Pontos de extremidade da API REST para webhooks globais","intro":"Use a API REST para gerenciar webhooks globais para sua empresa.","product":"API REST","breadcrumbs":[{"href":"/pt/enterprise-server@3.22/rest","title":"API REST"},{"href":"/pt/enterprise-server@3.22/rest/enterprise-admin","title":"Administração de empresas"},{"href":"/pt/enterprise-server@3.22/rest/enterprise-admin/global-webhooks","title":"Webhooks globais"}],"documentType":"article"},"body":"# Pontos de extremidade da API REST para webhooks globais\n\nUse a API REST para gerenciar webhooks globais para sua empresa.\n\n## Sobre webhooks globais\n\nEsses pontos de extremidade só estão disponíveis para administradores de site [autenticados](/pt/enterprise-server@3.22/rest/authentication/authenticating-to-the-rest-api) Os usuários normais receberão uma resposta `404`. Para saber como configurar webhooks globais, confira [Sobre os webhooks globais](/pt/enterprise-server@3.22/admin/monitoring-activity-in-your-enterprise/exploring-user-activity-in-your-enterprise/managing-global-webhooks).\n\nWebhooks globais são instalados automaticamente na sua empresa. Você pode usar webhooks globais para monitorar, responder ou aplicar regras automaticamente para usuários, organizações, equipes e repositórios na sua empresa.\n\nOs webhooks globais podem se inscrever nos tipos de eventos [organização](/pt/enterprise-server@3.22/webhooks/webhook-events-and-payloads#organization), [usuário](/pt/enterprise-server@3.22/webhooks/webhook-events-and-payloads#user), [repositório](/pt/enterprise-server@3.22/webhooks/webhook-events-and-payloads#repository), [equipe](/pt/enterprise-server@3.22/webhooks/webhook-events-and-payloads#team), [membro](/pt/enterprise-server@3.22/webhooks/webhook-events-and-payloads#member), [associação](/pt/enterprise-server@3.22/webhooks/webhook-events-and-payloads#membership), [fork](/pt/enterprise-server@3.22/webhooks/webhook-events-and-payloads#fork) e [ping](/pt/enterprise-server@3.22/webhooks/about-webhooks#ping-event).\n\n> \\[!NOTE]\n> Esses pontos de extremidade só dão suporte à autenticação por meio de um personal access token (classic). Para saber mais, confira [Gerenciar seus tokens de acesso pessoal](/pt/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):**"}