Webhook Overview
Request Events
Get notified when requests are claimed, completed, cancelled, or time out.
Loop Events
Receive updates when members join loops or when loop settings change.
Real-time Updates
Eliminate polling with instant push notifications to your endpoints.
Secure Delivery
All webhook payloads are signed with HMAC-SHA256 for verification.
Webhook Configuration
Setting Up Webhooks
Configure webhook endpoints in your API settings or through the dashboard:Supported Events
Request Events
Request Events
request.created
- New request createdrequest.claimed
- Request claimed by reviewerrequest.completed
- Request completed with responserequest.cancelled
- Request cancelled by creatorrequest.timeout
- Request timed out
Loop Events
Loop Events
loop.created
- New loop createdloop.updated
- Loop settings changedloop.deleted
- Loop deletedloop.member_joined
- New member joined looploop.member_left
- Member left loop
System Events
System Events
api_key.limit_exceeded
- API rate limit exceededapi_key.quota_warning
- Approaching usage limit
Webhook Payloads
Request Completed
Sent when a reviewer completes a request:Request Claimed
Sent when a reviewer claims a pending request:Request Cancelled
Sent when a request creator cancels a request:Request Timeout
Sent when a request exceeds its timeout period:Loop Member Joined
Sent when a new member joins a loop:Webhook Security
HMAC Signature Verification
All webhook payloads include an HMAC-SHA256 signature for verification:Webhook Implementation
Express.js Webhook Server
Complete webhook server implementation:Flask Webhook Server
Python webhook server implementation:Webhook Testing
Webhook Testing Tools
Test your webhook implementation:Webhook Best Practices
Reliability and Error Handling
Idempotency
Idempotency
Design webhook handlers to be idempotent - multiple deliveries of the same event should have the same effect.
Retry Logic
Retry Logic
HITL.sh will retry failed webhook deliveries with exponential backoff:
- Immediate retry
- 15 seconds
- 1 minute
- 5 minutes
- 30 minutes
- 2 hours
- 12 hours
- 24 hours (final attempt)
200-299
: Success (no retry)400-499
: Client error (no retry except 408, 429)500-599
: Server error (will retry)
Timeout Handling
Timeout Handling
Webhook endpoints should respond within 30 seconds. Use background processing for long operations:
Security Considerations
Always Verify Signatures
Always Verify Signatures
Never process webhooks without signature verification:
Use HTTPS Endpoints
Use HTTPS Endpoints
Always use HTTPS URLs for webhook endpoints to ensure payload encryption in transit.
Rotate Webhook Secrets
Rotate Webhook Secrets
Periodically rotate your webhook secrets and update the configuration:
Troubleshooting
Common Issues
Webhook Not Receiving Events
Webhook Not Receiving Events
- Check webhook URL is publicly accessible
- Verify SSL certificate is valid
- Ensure endpoint returns HTTP 200 for successful processing
- Check webhook configuration includes desired event types
Signature Verification Failing
Signature Verification Failing
- Ensure you’re using the correct secret key
- Verify payload is used as-is (no modifications)
- Check header name is exactly
X-HITL-Signature-256
- Confirm signature format is
sha256=<hash>
Webhook Timeouts
Webhook Timeouts
- Optimize webhook handler performance
- Move long operations to background processing
- Return 200 status immediately after validation
- Check for network connectivity issues
Debug Webhook Issues
Next Steps
Test Integration
Create test requests to verify your webhook implementation receives events correctly.
Monitor Performance
Track webhook delivery success rates and response times in your monitoring system.
Scale Webhook Processing
Learn about scaling webhook processing for high-volume applications.