What Happens in Sandbox Mode?
AhaSend validates and parses your message, records it in the dashboard, and simulates the selected delivery outcome. It makes no connection to the recipient’s mail server. Use it for local development, staging, automated tests and checking message substitutions. Before testing, verify your sending domain and create the appropriate API key or SMTP credential.How Do I Enable Sandbox Mode?
Choose the surface your application uses. Dedicated sandbox credentials keep all sends from that credential in sandbox mode; request parameters or headers let a production credential make an individual sandbox send.- API v2
- SMTP
Create a send-only key from Credentials → Add → API Key v2 and choose Sandbox mode. See API credentials for the key setup steps. To change an existing sending credential, open it in Credentials, change Mode, and save. Switching it to Production enables real delivery.
Use the API v2 Parameters
For maximum flexibility, you can use production credentials and control sandbox behavior with API parameters:Sandbox Request Example
Add thesandbox parameter to your API v2 message request:Parameter Priority: When AhaSend sees the
"sandbox": true parameter, it processes the email in sandbox mode regardless of the credential type used for authentication.Choose an API Outcome
Test how your application handles different delivery scenarios by controlling the simulated outcome:Usesandbox_result to choose one of the simulated outcomes.Examples
Which Outcomes Can I Simulate?
Usesandbox_result in API v2 or AhaSend-Sandbox-Result in SMTP. See the special header reference for header parsing rules.
See the event reference for payloads. These are simulated delivery outcomes, not open or click events.
How Do I Test Webhooks Locally?
Use CLI webhook testing to forward events to your local handler. Sandbox sends trigger delivery, bounce, deferral, failure and suppression events. Opens and clicks require recipient interaction and are not simulated by sandbox sends; use CLI synthetic test events for those handlers. Delivery, deferral and bounce webhooks include a representativedelivery_attempt object. Its diagnostics are synthetic because no destination mail server was contacted. A sandbox classification may override the sample and may differ from its SMTP code or response text.
Verify signatures before processing a test event, and follow the retry policy when acknowledging deliveries.
Advanced Features
API v2 sandbox mode supports advanced features for comprehensive testing:Bulk Operations
Bulk Operations
Test bulk sending in sandbox mode:
Scheduled Sending
Scheduled Sending
Test scheduled emails in sandbox mode:
Template Variables
Template Variables
Test complex template substitutions:
Why Did My Test Not Work?
If an email was delivered, check that the credential is in Sandbox mode or the send includes the sandbox parameter or header.AhaSend-Sandbox accepts true or 1; use the result header only with sandbox mode.
If no event arrived, check your webhook URL, event filters and handler response. Use CLI webhook testing to inspect the event and the local response. Check the spelling of the five result values above if the outcome differs from the one you requested.

