Webhook notification - Results sent to your callback URL
Better scalability - Handle high volumes without blocking
Fault tolerance - Automatic retries and error recovery
This recipe shows complete webhook implementations in 4 languages (Node.js, PHP, Java, and testing with curl).
What You'll Learn
When to use async vs sync mode
How to enable async dispatch
Implementing webhook handlers
Webhook security and verification
Handling retries and idempotency
Complete working examples
Prerequisites
Docs-Dispatcher account with email and password
HTTPS webhook endpoint (required)
Provider configured
Template created
Basic understanding of webhooks
HTTPS Required: Webhook URLs must use HTTPS (not HTTP). HTTP webhooks will be rejected for security reasons.
When to Use Async Mode
Use Async When:
Scenario
Why Async
Long-running operations
Operations taking > 30 seconds
High volume
Processing hundreds/thousands of requests
Background jobs
Batch processing, scheduled tasks
Non-interactive
No user waiting for immediate result
Better UX
Don't block UI while processing
Resilience
Automatic retries on failures
Use Sync When:
Scenario
Why Sync
Quick operations
Expected completion < 10 seconds
Interactive workflows
User waiting for result
Simple error handling
Immediate error feedback needed
Testing/development
Easier debugging
Low volume
Few requests per minute
Async vs Sync Comparison
Aspect
Sync Mode
Async Mode
Response Time
2-30 seconds
< 200ms
Timeout
120 seconds
No timeout
Result
Immediate in response
Via webhook
Scalability
Limited
High
User Experience
Blocks until complete
Instant acknowledgment
Error Handling
Immediate
Via webhook
Use Case
Interactive
Background/Batch
Step 1: Authentication
Dispatcher API uses HTTP Basic Authentication. You'll need your Dispatcher account email and password for all API calls.
Setup Credentials
No token management needed! Unlike JWT-based APIs, Basic Auth doesn't require separate authentication endpoints or token refresh. Your credentials are sent with each request.