How Webhooks Work
- You provide a
webhookUrlwhen starting an execution - Doclo sends an HTTP POST to your URL when the execution completes
- Your server verifies the signature and processes the result
Webhook Payload
Doclo sends a JSON payload with the execution result:Signature Verification
Webhooks include a signature header to verify authenticity. Always verify signatures in production.Header Format
Verification with SDK
Manual Verification
If you need to verify without the SDK:Framework Examples
Next.js API Route
Express
Event Types
Retry Behavior
Doclo retries failed webhook deliveries:
A delivery is considered failed if:
- Your server returns a non-2xx status code
- Connection times out (30 seconds)
- Connection cannot be established
Timestamp Validation
The SDK validates webhook timestamps by default to prevent replay attacks:parseWebhookEvent throws an error.
Webhook Security
Best practices:- Always verify signatures in production
- Use HTTPS for your webhook endpoint
- Validate timestamps to prevent replay attacks
- Return 200 quickly and process asynchronously
- Store the secret securely in environment variables
Get Your Webhook Secret
- Log in to app.doclo.ai
- Navigate to Settings → Webhooks
- Copy your webhook signing secret
- Store it as
DOCLO_WEBHOOK_SECRETin your environment
Next Steps
Executing Flows
Learn about execution options
Authentication
API key management