Skip to main content

webhooks

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

Overview

Namewebhooks
TypeResource
Iddatadog.integrations.webhooks

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the webhook. It corresponds with <WEBHOOK_NAME>. Learn more on how to use it in [monitor notifications](https:​//docs.datadoghq.com/monitors/notify). (example: WEBHOOK_NAME)
custom_headersstringIf null, uses no header. If given a JSON payload, these will be headers attached to your webhook.
encode_asstringEncoding type. Can be given either json or form. (json, form) (default: json)
payloadstringIf null, uses the default payload. If given a JSON payload, the webhook returns the payload specified by the given payload. [Webhooks variable usage](https:​//docs.datadoghq.com/integrations/webhooks/#usage).
urlstringURL of the webhook. (example: https:​//example.com/webhook)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_webhooks_integrationselectwebhook_nameGets the content of the webhook with the name <WEBHOOK_NAME>.
create_webhooks_integrationinsertname, urlCreates an endpoint with the name <WEBHOOK_NAME>.
update_webhooks_integrationreplacewebhook_nameUpdates the endpoint with the name <WEBHOOK_NAME>.
delete_webhooks_integrationdeletewebhook_nameDeletes the endpoint with the name &lt;WEBHOOK NAME&gt;. This action cannot be undone.

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
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.
webhook_namestringThe name of the webhook.

SELECT examples

Gets the content of the webhook with the name <WEBHOOK_NAME>.

SELECT
name,
custom_headers,
encode_as,
payload,
url
FROM datadog.integrations.webhooks
WHERE webhook_name = '{{ webhook_name }}' -- required
;

INSERT examples

Creates an endpoint with the name <WEBHOOK_NAME>.

INSERT INTO datadog.integrations.webhooks (
custom_headers,
encode_as,
name,
payload,
url
)
SELECT
'{{ custom_headers }}',
'{{ encode_as }}',
'{{ name }}' /* required */,
'{{ payload }}',
'{{ url }}' /* required */
RETURNING
name,
custom_headers,
encode_as,
payload,
url
;

REPLACE examples

Updates the endpoint with the name <WEBHOOK_NAME>.

REPLACE datadog.integrations.webhooks
SET
custom_headers = '{{ custom_headers }}',
encode_as = '{{ encode_as }}',
name = '{{ name }}',
payload = '{{ payload }}',
url = '{{ url }}'
WHERE
webhook_name = '{{ webhook_name }}' --required
RETURNING
name,
custom_headers,
encode_as,
payload,
url;

DELETE examples

Deletes the endpoint with the name &lt;WEBHOOK NAME&gt;. This action cannot be undone.

DELETE FROM datadog.integrations.webhooks
WHERE webhook_name = '{{ webhook_name }}' --required
;