Webhooks
Receive real-time notifications on job completion
If you have set a webhook URL while making the create job request, Murf Dub Automation API will send a webhook response to the specified URL when the job is completed, failed, or partially completed. The request to the webhook will contain the following information:
Headers
The timestamp of when the request was sent to the webhook URL.
The HMAC signature of the payload.
Response
The name of the event associated with the webhook response. This will be “DUB_JOB” for dubbing job endpoints.
The data payload of the webhook response. The response structure will be similar to the response received from Job Status API endpoint.
Webhook Authentication and Validation
To ensure secure communication, all webhook requests sent by Murf Dub Automation API should be authenticated. The webhook payload includes an HMAC signature and a timestamp header that you can use to validate the request.
Validating the Webhook
Use the following steps to validate the webhook:
- Extract the
X-Signature-Timestamp
andX-HMAC-Signature
headers from the request. - Concatenate the payload and the timestamp to form the data to be signed.
- Compute the HMAC using the secret you included while sending the create job request and compare it with the
X-HMAC-Signature
header. - Ensure the timestamp is within an acceptable tolerance window to prevent replay attacks.
If validation fails, reject the webhook request and log the incident for further investigation.
This is how you can validate the webhook request using Murf Python SDK:
If you’re not using python SDK, you can use the following python function to validate the webhook: