Webhook API
The Webhook API provides comprehensive webhook management with reliable delivery, detailed logging, dead-letter queue handling, and intelligent retry mechanisms. Webhooks enable real-time notifications and event-driven integrations with external systems.Authentication
All webhook endpoints require authentication with API key:Rate Limits
Webhook Management
Create Webhook
Create a new webhook subscription. Endpoint:POST /webhooks
Request Body:
name(string, required): Webhook namedescription(string, optional): Webhook descriptionurl(string, required): Webhook callback URLevents(array, required): List of events to subscribe tofilters(object, optional): Event filtering criteriadelivery_config(object, optional): Delivery configurationtimeout_ms(integer): Request timeoutretry_count(integer): Number of retry attemptsretry_delay_ms(integer): Delay between retriessignature_header(string): Signature header nameinclude_metadata(boolean): Include metadata in payloadinclude_payload(boolean): Include full payload
secret(string, optional): Secret for signature verificationmetadata(object, optional): Additional metadata
List Webhooks
Retrieve all webhooks with optional filtering. Endpoint:GET /webhooks
Query Parameters:
status(string): Filter by status (active, inactive, paused)event(string): Filter by specific eventlimit(integer, default: 20, max: 100): Results per pageoffset(integer, default: 0): Pagination offset
Get Webhook
Retrieve a specific webhook by ID. Endpoint:GET /webhooks/{id}
Response:
Update Webhook
Update an existing webhook configuration. Endpoint:PUT /webhooks/{id}
Request Body:
Delete Webhook
Permanently delete a webhook. Endpoint:DELETE /webhooks/{id}
Response:
Webhook Testing
Test Webhook
Test webhook delivery with sample payload. Endpoint:POST /webhooks/{id}/test
Request Body:
event(string, required): Event to testtest_payload(object, optional): Custom test payloadinclude_signature(boolean, default: true): Include signature in test
Webhook Delivery Logging
Get Delivery Logs
Retrieve webhook delivery logs. Endpoint:GET /webhooks/delivery-logs
Query Parameters:
webhook_id(string): Filter by webhook IDstatus(string): Filter by delivery status (success, failed, pending)event(string): Filter by event typestart_time(string): Start time filterend_time(string): End time filterlimit(integer, default: 50, max: 200): Results per pageoffset(integer, default: 0): Pagination offset
Get Delivery Statistics
Retrieve webhook delivery statistics. Endpoint:GET /webhooks/delivery-stats
Response:
Dead Letter Queue
Get Dead Letter Queue
Retrieve failed webhook deliveries. Endpoint:GET /webhooks/dead-letter
Query Parameters:
limit(integer, default: 50, max: 200): Results per pageoffset(integer, default: 0): Pagination offsetolder_than(string): Filter entries older than timestamp
Retry Dead Letter Entry
Retry a specific failed delivery. Endpoint:POST /webhooks/dead-letter/{id}/retry
Response:
Delete Dead Letter Entry
Remove an entry from the dead letter queue. Endpoint:DELETE /webhooks/dead-letter/{id}
Purge Dead Letter Queue
Remove all entries from the dead letter queue. Endpoint:DELETE /webhooks/dead-letter
Request Body:
confirm(boolean, required): Confirmation flagolder_than(string, optional): Only remove entries older than timestamp
Webhook Events
Available Events
Event Payload Structure
Memory Event Payload
Signature Verification
Webhook signatures are included for security verification:Verification Process
- Extract Signature: Get signature from header
- Compute Signature: HMAC with using webhook secret
- Compare: Verify computed signature matches header
Example Verification (Python)
Error Handling
Common Error Responses
Error Codes
Best Practices
Webhook Configuration
- HTTPS Only: Use HTTPS URLs for webhook endpoints
- Unique URLs: Use unique URLs for different webhook subscriptions
- Event Filtering: Use filters to reduce unnecessary notifications
- Secret Management: Store webhook secrets securely
- Timeout Configuration: Set appropriate timeouts for your endpoint
Delivery Reliability
- Retry Configuration: Configure appropriate retry attempts and delays
- Monitoring: Monitor webhook delivery statistics
- Dead Letter Queue: Monitor and manage the dead letter queue
- Performance Testing: Test webhook endpoint under load
- Failover: Implement failover endpoints for critical webhooks
Security
- Signature Verification: Always verify webhook signatures
- IP Whitelisting: Consider IP whitelisting for Hystersis IPs
- Rate Limiting: Implement rate limiting on your webhook endpoint
- Data Validation: Validate webhook payload structure
- Secure Storage: Store webhook secrets securely
Performance
- Fast Responses: Return webhook responses quickly
- Async Processing: Use asynchronous processing for webhook handling
- Payload Optimization: Minimize webhook payload size
- Connection Reuse: Use HTTP connection pooling
- Batch Processing: Process multiple related events together
Monitoring
- Delivery Metrics: Track success rates and delivery times
- Error Tracking: Monitor and track delivery failures
- Performance Monitoring: Monitor webhook endpoint performance
- Alerts: Set up alerts for delivery failures
- Regular Audits: Regularly audit webhook configuration and delivery