What changes in sandbox
No live traffic
Messages and OTP flows can be simulated without real carrier delivery.
Explicit signaling
Responses, events, logs, and deliveries expose
sandbox: true whenever that field is part of the public contract.Predictable OTP
Sandbox OTP verification uses deterministic behavior for automated tests.
Real webhooks
Events still use Svix signing and the same retry semantics as production.
Important rules
- Sandbox does not allow scheduled messages.
- API keys must match the current project mode. When they do not, the API can return
403 API_KEY_MODE_MISMATCH. - The magic numbers set lets you force
FAILED,QUEUED,SENT, andDELIVEREDoutcomes.
Where the mode shows up
POST /messagesandPOST /messages/batchreturnsandboxin the create result.- Message webhook payloads include
sandbox. - The webhook event envelope includes
sandbox. - Request logs and webhook deliveries exposed by the API include
sandbox.
Recommended workflow
- Enable sandbox for the project in the appropriate test environment.
- Send messages or OTP requests normally.
- Use magic numbers to force specific outcomes.
- Validate emitted webhooks, especially
message.sent,message.delivered,message.failed,message.queued,sms.otp, andmessage.received. - Only then promote the flow to live mode.