Test keys (sandbox)

A test key is a full sandbox — build and test your integration with realistic responses, but nothing real happens and nothing is charged.

A key created in test mode (afn_test_…) is a sandbox. Sends and verifications behave exactly like production — same responses, same message IDs, same webhooks — but no real email is sent, no SMTP probe runs, and nothing is charged. Use it to build your whole integration with confidence before switching to a live key.

Free monthly limits

Test traffic never touches your paid quota or verification credits. Instead each account has a free, capped monthly allowance (staff can raise it):

ParameterTypeRequiredDescription
Test sends10,000 / monthOptionalSimulated sends from test keys. No real email leaves.
Test verifications100 / monthOptionalSimulated verifications from test keys. No SMTP probe runs.

When an allowance is exhausted the API returns 429 — switch to a live key for production volume.

Choosing outcomes

When you create a test key you set an outcome mix — the odds of each simulated result. Every request rolls the mix and fires the matching webhook.

jsonPOST /v3/keys
{
  "name": "sandbox",
  "env": "test",
  "test_outcomes": {
    "send":   { "delivered": 90, "bounce": 8, "complaint": 2 },
    "verify": { "valid": 70, "invalid": 20, "catch_all": 5, "unknown": 5 }
  }
}

Magic addresses

To force a specific result (overriding the mix), name the outcome in the recipient local-part:

ParameterTypeRequiredDescription
Sendingdelivered@ · bounce@ · complaint@Optionale.g. bounce@example.com always produces a hard bounce + bounce webhook.
Verificationvalid@ · invalid@ · catchall@ · unknown@Optionale.g. invalid@example.com always returns invalid.