Webhooks are the recommended way to receive asynchronous notifications about Business API operations. They are driven by the task system and delivered by the WebhookService with retry and detailed audit logging.Documentation Index
Fetch the complete documentation index at: https://docs.dragdropdo.com/llms.txt
Use this file to discover all available pages before exploring further.
Webhook lifecycle
The webhook flow is:- Trigger event – a file task or main task transitions state.
- Prepare payload – the system builds a JSON payload and HMAC signature headers.
- Send to client – an HTTP request is made to your registered
webhook_url. - Log to audit table – each attempt is recorded with status, payload, response, and error.
- Retry (optional) – failed deliveries are retried until the configured limit is reached.
WEBHOOK_AUDIT_LOGS table, including status, attempt number, response status, and any error message.
Registering webhooks
Webhooks are registered and managed through the D3 dashboard:- Sign in to your account at dragdropdo.com/auth/signin
- Navigate to your Account section
- Go to the Register Webhook section
- Enter your webhook URL and optional webhook secret
- Save your webhook configuration
Events
From the Business API design, the main events are:operation.completed– main task finished (all file tasks completed or partially completed).operation.failed– main task failed (all file tasks failed).fileTask.completed– individual file task completed.fileTask.failed– individual file task failed.
operation.completed / partially completed
operation.failed
fileTask.completed
fileTask.failed
Receiving webhooks
Your webhook endpoint must accept POST requests with a JSON body. D3 sends the event payload along with anX-Webhook-Signature header (when a webhook_secret is configured). Your server should:
- Read the raw request body.
- Verify the HMAC-SHA256 signature.
- Parse the JSON payload and handle the event.
- Return a 2xx status code to acknowledge receipt.
Webhook handler example
Verifying signatures
When awebhook_secret is configured, every webhook request includes an X-Webhook-Signature header containing the HMAC-SHA256 hex digest of the raw request body, keyed with your secret.
Always verify signatures before processing events. Use a constant-time comparison function to prevent timing attacks.
Signature verification example
Delivery & retries
The webhook audit and retry flow (simplified from the design docs):- On each attempt, a row is inserted into
WEBHOOK_AUDIT_LOGSwith:event_typetarget_urlpayloadresponse_statusattempt_numberstatus(success/failed)error_messagesent_at
- If retries are enabled, failed attempts are rescheduled until either:
- A retry succeeds.
- The max retry count is reached.
Security
Recommended best practices:- Verify signatures – always validate the
X-Webhook-Signatureheader using yourwebhook_secretand a constant-time comparison. - Use HTTPS – only register HTTPS endpoints to protect payloads in transit.
- Respond quickly – return a
2xxwithin a few seconds; offload heavy processing to a background queue. - Idempotency – webhooks may be retried, so deduplicate using the event
type+timestampor track processed event IDs. - Treat as notifications – fetch sensitive data (like download URLs) via the Business API rather than relying solely on webhook payloads.