Webhook Testing
Test and debug webhook events locally without deploying to production using the AhaSend CLI.Overview
The CLI provides tools for:- Creating local webhook listeners
- Triggering test events
- Forwarding events to local endpoints
- Debugging webhook signatures and payloads
Local Webhook Listener
Basic Usage
Available Events
message.reception
- Email received by AhaSendmessage.delivered
- Email delivered to recipientmessage.transient_error
- Temporary delivery failuremessage.failed
- Permanent delivery failuremessage.bounced
- Email bouncedmessage.suppressed
- Email suppressedsuppression.created
- New suppression addeddomain.dns_error
- DNS resolution failuremessage.opened
- Email opened by recipientmessage.clicked
- Link clicked in email
Triggering Test Events
Development Testing
Event Simulation Scenarios
Integration Testing
Development Workflow
SSL Certificate Verification
Debugging
Output Options
Common Issues
Signature Verification Failed: The command automatically generates a webhook secret using the standard-webhooks specification Events Not Received: Check that the webhook URL is correct and the local server is running Connection Lost: The command handles disconnections with buffered event replay, automatically reconnecting when possibleBest Practices
- Start Simple: Test with single events before complex flows
- Use Sandbox Mode: Test with sandbox emails to avoid sending real messages
- Verify Signatures: Always validate webhook signatures in production
- Log Events: Keep detailed logs during development for debugging
- Test Error Cases: Simulate failures to ensure proper error handling