Verify webhook
Confirm a webhook is coming from Duplo
Validating webhook signature
When enabling your webhook, you have the option to set a verify_hash
. Since webhook URLs are publicly accessible, the verify_hash
lets you verify incoming requests are from us. You can specify any value as your secret hash, but we recommend using something random.
You should store your verify_hash
as an environment variable on your server.
If you specify a verify_hash
, we'll include it in our request to your webhook URL, in a header called DP_HASH_VERIFY
or DP-HASH-VERIFY.
In the webhook endpoint, check if the DP_HASH_VERIFY
or DP-HASH-VERIFY
header is present and it matches the verify_hash
you set. If the header is missing, or the value doesn't match, you can discard the request, as it isn't from us.
An example of the verify hash header
Responding to webhook request
You must respond with a 200 OK
status code. Any other response codes outside of the 2xx
range will be considered a failure. We don't care about the response body or headers.
If we don't get a 200 OK status code, we'll retry the webhook every one minute for the next 24 hours.
Example
We currently support the following event notifications.
Last updated