REST-API-Endpunkte für globale Webhooks
Verwende die REST-API, um globale Webhooks für dein Unternehmen zu verwalten.
Informationen zu globalen Webhooks
Diese Endpunkte sind nur für authentifizierte Websiteadministratorinnen verfügbar. Normale Benutzerinnen erhalten eine 404-Antwort. Eine Anleitung zum Konfigurieren globaler Webhooks findest du unter Informationen zu globalen Webhooks.
Globale Webhooks sind automatisch für dein Unternehmen installiert. Du kannst globale Webhooks verwenden, um automatisch Regeln für Benutzer, Organisationen, Teams und Repositorys in deinem Unternehmen zu überwachen, darauf zu reagieren oder sie zu erzwingen.
Globale Webhooks können die Ereignistypen Organisation, Benutzer, Repository, Team, Mitglied, Mitgliedschaft, Fork und Ping abonnieren.
Hinweis
Diese Endpunkte unterstützen nur die Authentifizierung über ein personal access token (classic). Weitere Informationen finden Sie unter Verwalten deiner persönlichen Zugriffstoken.
List global webhooks
Fine-grained access tokens for "List global webhooks"
This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.
Parameter für "List global webhooks"
| Name, Typ, BESCHREIBUNG |
|---|
accept string Setting to |
| Name, Typ, BESCHREIBUNG |
|---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Standard: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Standard: |
HTTP response status codes for "List global webhooks"
| Status code | BESCHREIBUNG |
|---|---|
200 | OK |
Code samples for "List global webhooks"
Request example
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
http(s)://HOSTNAME/api/v3/admin/hooksResponse
Status: 200[
{
"type": "Global",
"id": 1,
"name": "web",
"active": true,
"events": [
"organization",
"user"
],
"config": {
"url": "https://example.com",
"content_type": "json",
"insecure_ssl": "0",
"secret": "********"
},
"updated_at": "2017-12-07T00:14:59Z",
"created_at": "2017-12-07T00:14:59Z",
"url": "https://HOSTNAME/admin/hooks/1",
"ping_url": "https://HOSTNAME/admin/hooks/1/pings"
}
]Create a global webhook
Fine-grained access tokens for "Create a global webhook"
This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.
Parameter für "Create a global webhook"
| Name, Typ, BESCHREIBUNG |
|---|
accept string Setting to |
| Name, Typ, BESCHREIBUNG | |||||
|---|---|---|---|---|---|
name string ErforderlichMust be passed as "web". | |||||
config object ErforderlichKey/value pairs to provide settings for this webhook. | |||||
Properties of |
| Name, Typ, BESCHREIBUNG |
|---|
url string ErforderlichThe URL to which the payloads will be delivered. |
content_type string The media type used to serialize the payloads. Supported values include |
secret string If provided, the |
insecure_ssl string Determines whether the SSL certificate of the host for |
events array of strings The events that trigger this webhook. A global webhook can be triggered by user and organization events. Default: user and organization.
active boolean Determines if notifications are sent when the webhook is triggered. Set to true to send notifications.
Standard: true
HTTP response status codes for "Create a global webhook"
| Status code | BESCHREIBUNG |
|---|---|
201 | Created |
Code samples for "Create a global webhook"
Request example
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
http(s)://HOSTNAME/api/v3/admin/hooks \
-d '{"name":"web","events":["organization","user"],"config":{"url":"https://example.com/webhook","content_type":"json","secret":"secret"}}'Response
Status: 201{
"type": "Global",
"id": 1,
"name": "web",
"active": true,
"events": [
"organization",
"user"
],
"config": {
"url": "https://example.com",
"content_type": "json",
"insecure_ssl": "0",
"secret": "********"
},
"updated_at": "2017-12-07T00:14:59Z",
"created_at": "2017-12-07T00:14:59Z",
"url": "https://HOSTNAME/admin/hooks/1",
"ping_url": "https://HOSTNAME/admin/hooks/1/pings"
}Get a global webhook
Fine-grained access tokens for "Get a global webhook"
This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.
Parameter für "Get a global webhook"
| Name, Typ, BESCHREIBUNG |
|---|
accept string Setting to |
| Name, Typ, BESCHREIBUNG |
|---|
hook_id integer ErforderlichThe unique identifier of the hook. You can find this value in the |
HTTP response status codes for "Get a global webhook"
| Status code | BESCHREIBUNG |
|---|---|
200 | OK |
Code samples for "Get a global webhook"
Request example
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
http(s)://HOSTNAME/api/v3/admin/hooks/HOOK_IDResponse
Status: 200{
"type": "Global",
"id": 1,
"name": "web",
"active": true,
"events": [
"organization",
"user"
],
"config": {
"url": "https://example.com",
"content_type": "json",
"insecure_ssl": "0",
"secret": "********"
},
"updated_at": "2017-12-07T00:14:59Z",
"created_at": "2017-12-07T00:14:59Z",
"url": "https://HOSTNAME/admin/hooks/1",
"ping_url": "https://HOSTNAME/admin/hooks/1/pings"
}Update a global webhook
Parameters that are not provided will be overwritten with the default value or removed if no default exists.
Fine-grained access tokens for "Update a global webhook"
This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.
Parameter für "Update a global webhook"
| Name, Typ, BESCHREIBUNG |
|---|
accept string Setting to |
| Name, Typ, BESCHREIBUNG |
|---|
hook_id integer ErforderlichThe unique identifier of the hook. You can find this value in the |
| Name, Typ, BESCHREIBUNG | |||||
|---|---|---|---|---|---|
config object Key/value pairs to provide settings for this webhook. | |||||
Properties of |
| Name, Typ, BESCHREIBUNG |
|---|
url string ErforderlichThe URL to which the payloads will be delivered. |
content_type string The media type used to serialize the payloads. Supported values include |
secret string If provided, the |
insecure_ssl string Determines whether the SSL certificate of the host for |
events array of strings The events that trigger this webhook. A global webhook can be triggered by user and organization events. Default: user and organization.
active boolean Determines if notifications are sent when the webhook is triggered. Set to true to send notifications.
Standard: true
HTTP response status codes for "Update a global webhook"
| Status code | BESCHREIBUNG |
|---|---|
200 | OK |
Code samples for "Update a global webhook"
Request example
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
http(s)://HOSTNAME/api/v3/admin/hooks/HOOK_ID \
-d '{"events":["organization"],"config":{"url":"https://example.com/webhook"}}'Response
Status: 200{
"type": "Global",
"id": 1,
"name": "web",
"active": true,
"events": [
"organization"
],
"config": {
"url": "https://example.com",
"content_type": "form",
"insecure_ssl": "0"
},
"updated_at": "2017-12-07T00:14:59Z",
"created_at": "2017-12-07T00:14:59Z",
"url": "https://HOSTNAME/admin/hooks/1",
"ping_url": "https://HOSTNAME/admin/hooks/1/pings"
}Delete a global webhook
Fine-grained access tokens for "Delete a global webhook"
This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.
Parameter für "Delete a global webhook"
| Name, Typ, BESCHREIBUNG |
|---|
accept string Setting to |
| Name, Typ, BESCHREIBUNG |
|---|
hook_id integer ErforderlichThe unique identifier of the hook. You can find this value in the |
HTTP response status codes for "Delete a global webhook"
| Status code | BESCHREIBUNG |
|---|---|
204 | No Content |
Code samples for "Delete a global webhook"
Request example
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
http(s)://HOSTNAME/api/v3/admin/hooks/HOOK_IDResponse
Status: 204Ping a global webhook
This will trigger a ping event to be sent to the webhook.
Fine-grained access tokens for "Ping a global webhook"
This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.
Parameter für "Ping a global webhook"
| Name, Typ, BESCHREIBUNG |
|---|
accept string Setting to |
| Name, Typ, BESCHREIBUNG |
|---|
hook_id integer ErforderlichThe unique identifier of the hook. You can find this value in the |
HTTP response status codes for "Ping a global webhook"
| Status code | BESCHREIBUNG |
|---|---|
204 | No Content |
Code samples for "Ping a global webhook"
Request example
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
http(s)://HOSTNAME/api/v3/admin/hooks/HOOK_ID/pingsResponse
Status: 204