Skip to main content

webhook_config

Creates, updates, deletes, gets or lists a webhook_config resource.

Overview

Namewebhook_config
TypeResource
Idgithub.orgs.webhook_config

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
content_typestringThe media type used to serialize the payloads. Supported values include json and form. The default is form. (example: "json")
insecure_sslstringDetermines 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. (example: "0")
secretstringIf provided, the secret will be used as the key to generate the HMAC hex digest value for delivery signature headers. (example: "********")
urlstring (uri)The URL to which the payloads will be delivered. (example: https://example.com/webhook)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_webhook_config_for_orgselectorg, hook_idReturns the webhook configuration for an organization. To get more information about the webhook, including the active state and events, use "Get an organization webhook ."

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need admin:org_hook scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
update_webhook_config_for_orgupdateorg, hook_idUpdates the webhook configuration for an organization. To update more information about the webhook, including the active state and events, use "Update an organization webhook ."

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need admin:org_hook scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
hook_idintegerThe unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.
orgstringThe organization name. The name is not case sensitive.

SELECT examples

Returns the webhook configuration for an organization. To get more information about the webhook, including the active state and events, use "Get an organization webhook ."

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need admin:org_hook scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.

SELECT
content_type,
insecure_ssl,
secret,
url
FROM github.orgs.webhook_config
WHERE org = '{{ org }}' -- required
AND hook_id = '{{ hook_id }}' -- required
;

UPDATE examples

Updates the webhook configuration for an organization. To update more information about the webhook, including the active state and events, use "Update an organization webhook ."

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need admin:org_hook scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.

UPDATE github.orgs.webhook_config
SET
url = '{{ url }}',
content_type = '{{ content_type }}',
secret = '{{ secret }}',
insecure_ssl = '{{ insecure_ssl }}'
WHERE
org = '{{ org }}' --required
AND hook_id = '{{ hook_id }}' --required
RETURNING
content_type,
insecure_ssl,
secret,
url;