webhook_config
Creates, updates, deletes, gets or lists a webhook_config resource.
Overview
| Name | webhook_config |
| Type | Resource |
| Id | github.repos.webhook_config |
Fields
The following fields are returned by SELECT queries:
- get_webhook_config_for_repo
Response
| Name | Datatype | Description |
|---|---|---|
content_type | string | The media type used to serialize the payloads. Supported values include json and form. The default is form. (example: "json") |
insecure_ssl | string | 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. (example: "0") |
secret | string | If provided, the secret will be used as the key to generate the HMAC hex digest value for delivery signature headers. (example: "********") |
url | string (uri) | The URL to which the payloads will be delivered. (example: https://example.com/webhook) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_webhook_config_for_repo | select | owner, repo, hook_id | Returns the webhook configuration for a repository. To get more information about the webhook, including the active state and events, use "Get a repository webhook."OAuth app tokens and personal access tokens (classic) need the read:repo_hook or repo scope to use this endpoint. | |
update_webhook_config_for_repo | update | owner, repo, hook_id | Updates the webhook configuration for a repository. To update more information about the webhook, including the active state and events, use "Update a repository webhook."OAuth app tokens and personal access tokens (classic) need the write:repo_hook or repo scope to use this endpoint. |
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.
| Name | Datatype | Description |
|---|---|---|
hook_id | integer | The unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery. |
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
SELECT examples
- get_webhook_config_for_repo
Returns the webhook configuration for a repository. To get more information about the webhook, including the active state and events, use "Get a repository webhook."
OAuth app tokens and personal access tokens (classic) need the read:repo_hook or repo scope to use this endpoint.
SELECT
content_type,
insecure_ssl,
secret,
url
FROM github.repos.webhook_config
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND hook_id = '{{ hook_id }}' -- required
;
UPDATE examples
- update_webhook_config_for_repo
Updates the webhook configuration for a repository. To update more information about the webhook, including the active state and events, use "Update a repository webhook."
OAuth app tokens and personal access tokens (classic) need the write:repo_hook or repo scope to use this endpoint.
UPDATE github.repos.webhook_config
SET
url = '{{ url }}',
content_type = '{{ content_type }}',
secret = '{{ secret }}',
insecure_ssl = '{{ insecure_ssl }}'
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND hook_id = '{{ hook_id }}' --required
RETURNING
content_type,
insecure_ssl,
secret,
url;