Skip to main content
Webhooks notify your application when flow executions complete, eliminating the need for polling.

How Webhooks Work

  1. You provide a webhookUrl when starting an execution
  2. Doclo sends an HTTP POST to your URL when the execution completes
  3. Your server verifies the signature and processes the result

Webhook Payload

Doclo sends a JSON payload with the execution result:
Example payload:

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
Always return a 200 response quickly. Process webhooks asynchronously (e.g., queue the work) if processing takes time.

Timestamp Validation

The SDK validates webhook timestamps by default to prevent replay attacks:
If a webhook is too old, parseWebhookEvent throws an error.

Webhook Security

Never commit your webhook secret to version control.
Best practices:
  1. Always verify signatures in production
  2. Use HTTPS for your webhook endpoint
  3. Validate timestamps to prevent replay attacks
  4. Return 200 quickly and process asynchronously
  5. Store the secret securely in environment variables

Get Your Webhook Secret

  1. Log in to app.doclo.ai
  2. Navigate to Settings → Webhooks
  3. Copy your webhook signing secret
  4. Store it as DOCLO_WEBHOOK_SECRET in your environment

Next Steps

Executing Flows

Learn about execution options

Authentication

API key management