Show examples in:
Javascript HTTP

Content Management API > Webhook

Webhook

A webhook allows to make requests following certain Dato events. It is linked to a Role, which describes what actions can be performed.

Object payload

id string

ID of webhook

Example: "312"
type string

Must be exactly "webhook".

attributes.name string

Unique name for the webhook

Example: "Item type creation/update"
attributes.url string

The URL to be called

Example: "https://www.example.com/webhook"
attributes.enabled boolean

Whether the webhook is enabled and sending events or not

attributes.headers object

Additional headers that will be sent

Example: { "X-Foo": "Bar" }
attributes.events
Type: Array<object>
entity_type enum

The subject of webhook triggering

Example: "item"
item_type
item
upload
build_trigger
environment
maintenance_mode
sso_user
cda_cache_tags
event_types
Type: Array<string>
filters
Type: Array<object>, null
entity_type enum
item_type
item
build_trigger
environment
environment_type
entity_ids
Type: Array<string>
attributes.http_basic_user string, null

HTTP Basic Authorization username

Example: "user"
attributes.http_basic_password string, null

HTTP Basic Authorization password

Example: "password"
attributes.custom_payload string, null

A custom payload

Example: '{ "message": "{{event_type}} event triggered on {{entity_type}}!", "entity_id": "{{#entity}}{{id}}{{/entity}}"] }'
attributes.payload_api_version string

Specifies which API version to use when serializing entities in the webhook payload

Example: "3"
attributes.nested_items_in_payload boolean

Whether the you want records present in the payload to show blocks expanded or not

attributes.auto_retry boolean

If enabled, the system will attempt to retry the call several times when the webhook operation fails due to timeouts or errors.

Available endpoints