Introduction

A webhook delivers data to your application as it happens within Duda. Unlike our APIs where you would need to request data very frequently in order for your system to know the status of data within the Duda system.

Webhooks are HTTP requests which can be enabled to send notifications when specific events occur in Duda or on a site. Then, your application performs whatever logic you feel necessary - read/write from a database, integrate with another API, or perform a computation. This allows external systems to react in real-time to your events as they happen.

Receiving and Retrying Webhook Notifications

Webhook notifications are sent as an HTTP POST request. The notification data is sent as JSON in the POST body.

Duda uses a random exponential backoff policy with a max of 4 retries. The first retry will be after 20-40 seconds, after the initial attempt, the second retry will be 40-80 seconds after the first retry, the third retry will be 80-160 seconds after the second retry, and the fourth retry will be 160-240 seconds after the third retry.

JSON Format

Below is an example JSON data structure for a webhook. Each event includes specific information relevant to that event.

{
  "event_type": "",
  "event_timestamp": "",
  "resource_type": "",
  "data": { ... },
  "resource_data": { ... },
  "source": { ... }
}
NameIncludedDescription
event_typealwaysdescribes the type of event
event_timestampalwaysepoch timestamp of the event occurrence in milliseconds
resource_typenot alwaysdescribes what event relates to
datanot alwaysadditional data related to an event
resource_dataalwaysdata on the resource (ex. site_name, external_id)
sourcenot alwayswhere the event was triggered (ex. API, EDITOR)

What’s Next