webhooks
Creates, updates, deletes, gets or lists a webhooks resource.
Overview
| Name | webhooks |
| Type | Resource |
| Id | datadog.integrations.webhooks |
Fields
The following fields are returned by SELECT queries:
- get_webhooks_integration
| Name | Datatype | Description |
|---|---|---|
name | string | The 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_headers | string | If null, uses no header. If given a JSON payload, these will be headers attached to your webhook. |
encode_as | string | Encoding type. Can be given either json or form. (json, form) (default: json) |
payload | string | If 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). |
url | string | URL of the webhook. (example: https://example.com/webhook) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_webhooks_integration | select | webhook_name | Gets the content of the webhook with the name <WEBHOOK_NAME>. | |
create_webhooks_integration | insert | name, url | Creates an endpoint with the name <WEBHOOK_NAME>. | |
update_webhooks_integration | replace | webhook_name | Updates the endpoint with the name <WEBHOOK_NAME>. | |
delete_webhooks_integration | delete | webhook_name | Deletes the endpoint with the name <WEBHOOK NAME>. 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.
| Name | Datatype | Description |
|---|---|---|
site | string | The 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_name | string | The name of the webhook. |
SELECT examples
- get_webhooks_integration
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
- create_webhooks_integration
- Manifest
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
;
# Description fields are for documentation purposes
- name: webhooks
props:
- name: custom_headers
value: "{{ custom_headers }}"
description: |
If `null`, uses no header.
If given a JSON payload, these will be headers attached to your webhook.
- name: encode_as
value: "{{ encode_as }}"
description: |
Encoding type. Can be given either `json` or `form`.
valid_values: ['json', 'form']
default: json
- name: name
value: "{{ name }}"
description: |
The 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).
- name: payload
value: "{{ payload }}"
description: |
If `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).
- name: url
value: "{{ url }}"
description: |
URL of the webhook.
REPLACE examples
- update_webhooks_integration
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
- delete_webhooks_integration
Deletes the endpoint with the name <WEBHOOK NAME>. This action cannot be undone.
DELETE FROM datadog.integrations.webhooks
WHERE webhook_name = '{{ webhook_name }}' --required
;