webhook_delivery
Creates, updates, deletes, gets or lists a webhook_delivery resource.
Overview
| Name | webhook_delivery |
| Type | Resource |
| Id | github.orgs.webhook_delivery |
Fields
The following fields are returned by SELECT queries:
- get_webhook_delivery
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | Unique identifier of the delivery. |
installation_id | integer | The id of the GitHub App installation associated with this event. |
repository_id | integer | The id of the repository associated with this event. |
action | string | The type of activity for the event that triggered the delivery. (example: opened) |
delivered_at | string (date-time) | Time when the delivery was delivered. (example: 2021-05-12T20:33:44Z) |
duration | number | Time spent delivering. |
event | string | The event that triggered the delivery. (example: issues) |
guid | string | Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). (example: 58474f00-b361-11eb-836d-0e4f3503ccbe) |
redelivery | boolean | Whether the delivery is a redelivery. |
request | object | |
response | object | |
status | string | Description of the status of the attempted delivery (example: failed to connect) |
status_code | integer | Status code received when delivery was made. |
throttled_at | string (date-time) | Time when the webhook delivery was throttled. (example: 2021-05-12T20:33:44Z) |
url | string | The URL target of the delivery. (example: https://www.example.com) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_webhook_delivery | select | org, hook_id, delivery_id | Returns a delivery for a webhook configured in an organization. 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 editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. | |
redeliver_webhook_delivery | exec | org, hook_id, delivery_id | Redeliver a delivery for a webhook configured in an organization. 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 editwebhooks 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.
| Name | Datatype | Description |
|---|---|---|
delivery_id | integer | |
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. |
org | string | The organization name. The name is not case sensitive. |
SELECT examples
- get_webhook_delivery
Returns a delivery for a webhook configured in an organization.
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
id,
installation_id,
repository_id,
action,
delivered_at,
duration,
event,
guid,
redelivery,
request,
response,
status,
status_code,
throttled_at,
url
FROM github.orgs.webhook_delivery
WHERE org = '{{ org }}' -- required
AND hook_id = '{{ hook_id }}' -- required
AND delivery_id = '{{ delivery_id }}' -- required
;
Lifecycle Methods
- redeliver_webhook_delivery
Redeliver a delivery for a webhook configured in an organization.
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.
EXEC github.orgs.webhook_delivery.redeliver_webhook_delivery
@org='{{ org }}' --required,
@hook_id='{{ hook_id }}' --required,
@delivery_id='{{ delivery_id }}' --required
;