Add sandbox mode to the request body:
{
"personalizations": [{"to": [{"email": "[RECIPIENT_EMAIL]"}]}],
"from": {"email": "[YOUR_VERIFIED_SENDER]"},
"subject": "test",
"content": [{"type": "text/plain", "value": "body"}],
"mail_settings": {"sandbox_mode": {"enable": true}}
}
Rules:
1. enable must be a real boolean true/false. The string "true" gives you: The sandbox mode enable param should be a boolean value.
2. A valid sandbox request returns 200 OK, not the 202 you get for a real send. Assert on 200 in tests.
3. Nothing is delivered, no Event Webhook events fire, no email activity is logged, and no credits are consumed. It validates form, type, and shape of the request.
4. If you include a template_id, SendGrid assumes the template carries the subject and body and does not validate them. A sandbox 200 with a bad template_id can still fail in production.
5. An invalid request returns the same errors array as a real send, with codes and doc links. That is the whole point: run your full payload through sandbox mode in CI.