{"meta":{"title":"Puntos de conexión de la API de REST para los webhooks globales","intro":"Usa la API de REST para administrar webhooks globales para tu empresa.","product":"REST API","breadcrumbs":[{"href":"/es/enterprise-server@3.22/rest","title":"REST API"},{"href":"/es/enterprise-server@3.22/rest/enterprise-admin","title":"Administración empresarial"},{"href":"/es/enterprise-server@3.22/rest/enterprise-admin/global-webhooks","title":"Webhooks globales"}],"documentType":"article"},"body":"# Puntos de conexión de la API de REST para los webhooks globales\n\nUsa la API de REST para administrar webhooks globales para tu empresa.\n\n## Acerca de los webhooks globales\n\nEstos puntos de conexión solo están disponibles para los administradores de sitios [autenticados](/es/enterprise-server@3.22/rest/authentication/authenticating-to-the-rest-api). Los usuarios normales recibirán una respuesta `404`. Para obtener información sobre cómo configurar webhooks globales, vea [Acerca de los webhooks globales](/es/enterprise-server@3.22/admin/monitoring-activity-in-your-enterprise/exploring-user-activity-in-your-enterprise/managing-global-webhooks).\n\nLos webhooks globales se instalan automáticamente en tu empresa. Puede utilizar los webhooks globales para monitorear, responder a, o requerir las reglas para los usuarios, organizaciones, equipos y repositorios en su empresa.\n\nLos webhooks globales se pueden suscribir a los tipos de eventos de [organización](/es/enterprise-server@3.22/webhooks/webhook-events-and-payloads#organization), [ usuario](/es/enterprise-server@3.22/webhooks/webhook-events-and-payloads#user), [repositorio](/es/enterprise-server@3.22/webhooks/webhook-events-and-payloads#repository), [equipo](/es/enterprise-server@3.22/webhooks/webhook-events-and-payloads#team), [miembro](/es/enterprise-server@3.22/webhooks/webhook-events-and-payloads#member), [pertenencia](/es/enterprise-server@3.22/webhooks/webhook-events-and-payloads#membership), [bifurcación](/es/enterprise-server@3.22/webhooks/webhook-events-and-payloads#fork) y [ping](/es/enterprise-server@3.22/webhooks/about-webhooks#ping-event).\n\n> \\[!NOTE]\n> Estos puntos de conexión solo admiten la autenticación mediante personal access token (classic). Para más información, consulta [Administración de tokens de acceso personal](/es/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):**"}