Overview
Our webhook system enables real-time notifications for message events in your conversations. When a message is created or processed in your conversation, our system sends HTTP POST requests to your configured webhook URL with detailed message information.Quick Start
1. Configure Webhook
Add a webhook URL to your conversation configuration:2. Implement Webhook Handler
-
Django
-
FastAPI
-
Flask
-
Express.js
-
Spring Boot
-
PHP
Technical Specifications
Delivery System
- Protocol: HTTPS only (for security)
- Method: POST
- Content-Type: application/json
- Timeout: 30 seconds per request
- Retry Logic: 3 attempts with exponential backoff
Retry Configuration
- Maximum Attempts: 3
- Backoff Schedule:
- 1st retry: 4 seconds wait
- 2nd retry: 8 seconds wait
- 3rd retry: 10 seconds wait
- Retry Conditions:
- Network errors
- Timeouts
- Non-2xx responses
Security Requirements
- HTTPS protocol mandatory
- Valid SSL certificate
- Public endpoint accessibility
- 2xx status code response expected
- IP whitelist recommended
- Request signing (optional but recommended)
Webhook Payload
Structure
Field Reference
Field | Type | Required | Description |
---|---|---|---|
conversation_id | UUID | Yes | Unique identifier for the conversation |
data.id | UUID | Yes | Unique identifier for the message |
data.content | String | Yes | The actual message content |
data.content_type | Enum | Yes | Type of content (TEXT, IMAGE, VIDEO, DOCUMENT, AUDIO) |
data.filename | String | No | Present only for media messages |
data.type | Enum | Yes | Message type (USER_INPUT, SYSTEM, BOT) |
data.channel | Enum | Yes | Communication channel (API, WHATSAPP, SMS) |
data.status | Enum | Yes | Message status (RECEIVED, PROCESSED, FAILED) |
data.metadata | Object | No | Custom metadata for the message |
data.created_by | String | Yes | ID or name of the creator |
data.updated_by | String | Yes | ID or name of the last modifier |
data.created_at | ISO 8601 | Yes | Creation timestamp |
data.updated_at | ISO 8601 | Yes | Last update timestamp |
timestamp | ISO 8601 | Yes | Webhook event timestamp |
Best Practices
Performance
-
Quick Acknowledgment
- Return 2xx status immediately
- Process webhook data asynchronously
- Keep handler logic minimal
- Use background workers for processing
-
Idempotency Handling
Error Handling
-
Graceful Recovery
-
Logging Best Practices
Testing & Development
Local Testing
-
Using ngrok
-
Manual Testing
Webhook Testing Tools
-
webhook.site
- Quick webhook inspection
- Real-time request monitoring
- Headers and payload validation
- Response simulation
-
Custom Test Suite
Monitoring & Troubleshooting
Health Checks
-
Metrics to Monitor
- Webhook delivery success rate
- Average response time
- Retry attempt counts
- Error rates by type
- Processing time distribution
-
Alerting Rules
- High error rate threshold
- Response time degradation
- Retry count spikes
- Failed delivery clusters
Common Issues & Solutions
Issue | Possible Causes | Solution |
---|---|---|
Timeouts | Slow processing | Implement async processing |
Heavy payload | Optimize payload size | |
Network latency | Reduce processing time | |
SSL Errors | Invalid certificate | Update SSL certificate |
Expired certificate | Set up auto-renewal | |
Certificate mismatch | Verify domain matching | |
404 Errors | Invalid URL | Check webhook configuration |
URL changed | Update webhook URL | |
Service unavailable | Verify service status |
Debug Checklist
- Verify webhook URL configuration
- Check SSL certificate validity
- Monitor server logs for errors
- Validate payload format
- Test endpoint accessibility
- Verify network connectivity
- Check rate limiting
- Monitor system resources
Support
For webhook-related assistance, please provide:- Conversation ID
- Message ID
- Timestamp of issue
- Server logs
- Webhook configuration
- Error messages
- Retry attempt logs
Rate Limiting
- Maximum 10 concurrent webhook deliveries
- Maximum 100 webhooks per minute per endpoint
- Automatic back-pressure handling
- Rate limit headers included in responses