Sandbox Mode
The Email Gateway API's (Marketing and Transactional) includes a Sandbox Mode feature designed to validate email integrity without actual delivery. This functionality allows you to verify whether your message meets our service requirements and will be accepted for processing.
Key Validation Features:
- Data validation
- Email size verification
- Attachment validation
- Message format compliance
Implementation:
To enable Sandbox Mode, include the header "Sandbox-Mode: true" in your API request. When activated, our service performs comprehensive email validation testing without delivering messages to recipients.
Default value for sandbox mode header is false.
curl -X POST "https://api.cm.com/email/gateway/v1/marketing" \
-H "Content-Type: application/json" \
-H "X-CM-PRODUCTTOKEN: your-product-token" \
-H "Sandbox-Mode: true" \
-d '{
"fromAddress": "[email protected]",
"fromName": "string",
"replyToAddress": "[email protected]",
"replyToName": "string",
"toAddresses": [
{
"toAddress": "[email protected]",
"toName": "string"
}
],
"ccs": [],
"bccs": [],
"subject": "Sandbox mode example",
"htmlBody": "This is an example request for sandbox mode",
"textBody": "string",
"attachments": [],
"customerReference": "ref-1"
}'
Api Response
- Valid Request Body: For a valid request you will receive a
200 OK
response (as opposed to the202 Accepted
response that is returned for successful non-sandbox requests).

- Invalid Request Body: If you submit a request with sandbox mode enabled, but your request body is invalid, you will receive one or more error messages with error codes.
The following is an invalid request body intended to demonstrate the validation behaviour of sandbox mode for a bad request
{
"fromAddress": "lucymailtest.com",
"fromName": "string",
"replyToAddress": "[email protected]",
"replyToName": "string",
"toAddresses": [
{
"toAddress": "[email protected]",
"toName": "string"
}
],
"ccs": [],
"bccs": [],
"subject": "Sandbox mode example",
"htmlBody": "This is an example request for sandbox mode with a invalid from address.",
"textBody": "string",
"attachments": [],
"customerReference": "ref-1"
}

Important Notes:
- Emails processed in Sandbox Mode do not count toward your total email quota.
- No delivery logs are generated for sandbox requests
- This feature is intended solely for testing and validation purposes
This mode provides a reliable method to ensure your email campaigns will function correctly before deploying them to your actual recipient lists.
Updated 1 day ago