Sending

SendGrid sandbox mode: how to test without sending

Short answer

SendGrid sandbox mode is a setting on a v3 Mail Send request, not a separate account. Set mail_settings.sandbox_mode.enable to true and SendGrid validates the request without delivering the email, returning 200 OK instead of the usual 202 Accepted. No credits are used, but no events reach the Event Webhook or Email Activity either, so sandbox mode tests your request, not delivery or your webhook handling.

Last checked 16 November 2026

SendGrid’s sandbox mode is a switch on a single API request. Add "mail_settings": { "sandbox_mode": { "enable": true } } to a v3 Mail Send call and SendGrid checks the request without delivering the email. You get 200 OK back instead of 202 Accepted. There is no separate sandbox account, sandbox API key or sandbox environment. Everything below is from SendGrid’s sandbox mode docs, checked 16 November 2026.

How to turn on SendGrid sandbox mode

Add mail_settings.sandbox_mode.enable to the request body with a Boolean true:

curl https://api.sendgrid.com/v3/mail/send \
  -H "Authorization: Bearer $SENDGRID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "personalizations": [{ "to": [{ "email": "sam@example.com" }] }],
    "from": { "email": "hello@yourdomain.com" },
    "subject": "Sandbox test",
    "content": [{ "type": "text/plain", "value": "Hello" }],
    "mail_settings": { "sandbox_mode": { "enable": true } }
  }'

SendGrid’s docs warn not to put the Boolean in quotes. "enable": "true" is a string, and it returns an error.

If you use an SDK or a framework mailer, check that the request it builds contains that mail_settings block. That is what SendGrid looks at.

What sandbox mode tells you

Sandbox mode Normal send
Response on success 200 OK 202 Accepted
Email delivered No Yes
Credits consumed No Yes
Event Webhook events None Yes
Email Activity entry None Yes

So sandbox mode answers one question: is this request valid? It catches a bad API key, a malformed body, a missing field or an invalid address format before you send for real. That makes it useful in CI, where you want to know your code builds a request SendGrid accepts, without emailing anyone.

What sandbox mode does not test

Because no email is delivered and no events are generated, sandbox mode cannot tell you:

  • whether the email reaches the inbox or the spam folder,
  • whether your SPF, DKIM and DMARC records pass,
  • whether your Event Webhook endpoint parses delivered, bounce and spam report events correctly,
  • how the email renders in Gmail, Outlook or Apple Mail.

For those you need real sends to addresses you control, in a staging setup. Our guide to email testing in staging covers the options, from a local SMTP catcher to a dedicated test domain.

Common SendGrid sandbox mistakes

Leaving it on in production. If sandbox mode is set from a config value and that value is wrong in production, every send returns 200 and nothing is delivered. Your code sees success. Check for 200 versus 202 in your logs, or assert on the status code, so a silent sandbox is caught quickly.

Quoting the Boolean. "true" in quotes is an error, as above.

Expecting webhooks. Sandbox requests generate no events. If you are testing your webhook handler, send to a real address you own instead.

Expecting it on SMTP. The docs describe sandbox mode for the v3 Web API only. If your app sends through SMTP, use a separate test environment instead.

The free trial is not a sandbox

Some people search “SendGrid sandbox account” meaning the free trial. The trial is a real account with a 100 emails a day limit for 60 days, according to Twilio’s pricing page (checked 16 November 2026). Emails sent on it are delivered and count towards that cap. Our SendGrid sending limits page covers the trial and plan caps.

A safer way to wire sandbox mode into your app

The risk with a per-request flag is that it is controlled by your own config. A few habits keep it under control:

  1. Make it explicit per environment. Read a variable such as EMAIL_SANDBOX=true only in CI and local development, and fail to start in production if it is set.
  2. Log the status code. Record whether SendGrid answered 200 or 202 for every send. A run of 200s in production is an immediate red flag.
  3. Use a separate API key for tests. Give the CI key only the Mail Send permission, so a leaked test key cannot change your account settings.
  4. Do one real send in staging. Sandbox mode cannot exercise your Event Webhook, so send at least one real email per release to an address you own and confirm that the delivered event reaches your handler.
  5. Keep test addresses real. When you do send for real, send to mailboxes you control. Made-up addresses at real domains bounce, and bounces count against your sender reputation.

These habits apply to any provider with a dry-run option, not only SendGrid.

If you only remember one thing: sandbox mode proves your request is well formed, and nothing more. Delivery, authentication and webhook handling all need a real send to a mailbox you control.

How Mailcandor compares

Mailcandor has two testing tools that cover the same ground differently. POST /v1/emails/check runs the content checks on a subject and body without sending, and GET /v1/whoami confirms which team and permission a key has. New teams also start in a sandbox where emails can only go to team members, until the first domain is verified. Unlike a request flag, that sandbox cannot be left on by mistake in production. See the sandbox explained.

Mailcandor accepts SendGrid’s POST /v3/mail/send shape, so you can move code over by changing the host and key. SendGrid templates are not supported. See switching from SendGrid, the comparison and pricing. Access is currently by request.

Questions

Is there a SendGrid sandbox account?

No. Sandbox mode is a per-request setting on the v3 Mail Send API. Your normal account and API key are used, with mail_settings.sandbox_mode.enable set to true.

How do I know sandbox mode worked?

A valid sandbox request returns 200 OK, while a real send returns 202 Accepted. If you get 202, the email was queued for delivery.

Does SendGrid sandbox mode use credits?

No. SendGrid's docs say no credits are consumed by sandbox mode requests.

Do webhooks fire in SendGrid sandbox mode?

No. Sandbox requests do not generate events in the Event Webhook or Email Activity, so you cannot test delivery or bounce handling with them.

Does sandbox mode work over SMTP?

SendGrid's sandbox mode docs only describe it for the v3 Web API, so do not rely on it over SMTP.

Related

Send with someone on your side.

Unlimited domains on every plan, a person before any block, and 3,000 emails a month free. Tell us what you send and we set you up within one business day.