Skip to the page

Sandbox

The sandbox lets you try the API without sending real email. A test key simulates everything it sends, and a test address ends the way its name says.

Test keys

A test key starts with os_test_. Make one in API keys by choosing Test mode, or send mode as test when you create a key.

curl -X POST "$OPENSEND_API_URL/v1/api-keys" \  -H "Authorization: Bearer $OPENSEND_API_KEY" \  -H "Content-Type: application/json" \  -d '{  "name": "Marketing site",  "access": "sending"}'

For a test key, the body of that request is:

JSON
{  "name": "Continuous integration",  "mode": "test"}
  • Every email a test key sends is simulated. It reaches nobody and is never handed to the sending service.
  • The sender can be any address. A test key needs no verified domain, so you can try the API before your DNS records are in.
  • A test key only sends. It reads the emails of the sandbox and no others, and key_test_access refuses one with full access.

Test addresses

A test address reaches nobody, with any key. It is on opensend.test, a domain nobody can own, and the name before the @ says how the email ends.

Address
delivered@opensend.test
What happens
Sent, then delivered
Last status
delivered
Address
opened@opensend.test
What happens
Delivered, then opened
Last status
opened
Address
clicked@opensend.test
What happens
Delivered, opened, then a link is clicked
Last status
clicked
Address
delayed@opensend.test
What happens
Delayed once, then delivered
Last status
delivered
Address
complained@opensend.test
What happens
Delivered, then marked as spam
Last status
complained
Address
bounced@opensend.test
What happens
Sent, then refused for good
Last status
bounced
Address
suppressed@opensend.test
What happens
Held back before sending, as an address on the suppression list is
Last status
failed
Address
failed@opensend.test
What happens
Fails before it is sent
Last status
failed

A label after a plus sign tells your tests apart: bounced+signup@opensend.test ends like bounced@opensend.test.

  • With a live key every recipient of an email is a test address, or none is. A mix is refused with sandbox_mixed.
  • With a test key any mix is fine, and a real address counts as delivered.
  • sandbox_address: the name before the @ is not one of the test addresses.

Coming from Resend: delivered@resend.dev, bounced@resend.dev, complained@resend.dev, suppressed@resend.dev are test addresses here too, so tests written for Resend keep reaching nobody.

What a test email is

A test email has mode set to test. Everything before the hand-over is real: the input is checked, a template is filled in, an idempotency key works and a scheduled email waits for its time.

curl -X POST "$OPENSEND_API_URL/v1/emails" \  -H "Authorization: Bearer $OPENSEND_API_KEY" \  -H "Content-Type: application/json" \  -d '{  "from": "Acme <hello@mail.example.com>",  "to": "ada@example.com",  "subject": "Your receipt for November",  "html": "<p>Thanks for your order.</p>"}'

Sent with this body, the same request ends as a bounce and reaches nobody:

JSON
{  "from": "Acme <hello@mail.example.com>",  "to": "bounced@opensend.test",  "subject": "Your receipt",  "text": "Thanks for your order."}
  • The answer says queued. The events follow at once: sent, then what the address stands for.
  • Your webhooks get the same events as for a real email, with mode set to test in data, so one endpoint can tell the two apart.
  • A list takes mode: test for the sandbox, live for real email.
  • Test emails are left out of the metrics and never touch the suppression list.
  • A test email starts no automation, so a test never sets off real mail.
curl "$OPENSEND_API_URL/v1/emails?status=bounced&limit=20" \  -H "Authorization: Bearer $OPENSEND_API_KEY"

What it counts

Test emails do not count towards your plan and are never charged. They have an allowance of their own: each month a workspace may send as many test emails as its plan allows transactional ones. Past that a send is refused with sandbox_limit until the first of the month.

In broadcasts and automations

A contact with a test address is simulated too. Put bounced@opensend.test in an audience and a broadcast reaches everyone else, while that one copy ends as a bounce within a couple of minutes.