Skip to main content

Sandbox Magic Numbers Playbook

The sandbox inventory that drives simulated traffic is spread across the sandbox test mode walkthrough, the connect your first channel tutorial, the first SMS end-to-end recipe, and the sandbox API cookbook. This playbook sandwiches the whole inventory into one recipe: the magic-number chart, failure-mode rehearsal, inbound injection, and the checklist that takes you from a test key to a live key. Run it as a single script before you go live.

1. The big picture — a key that simulates without callers

Orbit sandbox activates on a dv_test_sk_ API key (or a sandbox organization, or the X-Test-Mode: true dashboard header). With that signal, every send short-circuits before a provider is resolved: no carrier is touched, no balance moves (cost_usd_cents: 0), and the recipient’s trailing digit decides the simulated outcome. Nothing about your request shape changes — you graduate by swapping the key, not the code. The three activation signals are listed on the sandbox overview. Public-form sandbox keys (dv_test_pk_) reach sandbox endpoints only and can be embedded in client-side test apps; rotation preserves the form, so a public key never flips into a secret one.

2. The magic test numbers chart

Send to any E.164 recipient and the trailing digit selects the delivery scenario. Each scenario replays the same intermediate → terminal sequence a real carrier produces, delivered as message.status webhooks to your sandbox webhook URL: Every webhook carries state_class (intermediate / terminal) and is_terminal, matching the tags production stamps. The same catalog is machine-readable from GET /api/v1/sandbox/numbers; the full semantics stay canonical at magic numbers.

WhatsApp window-status injection

The same trailing-digit convention drives WhatsApp sends in the sandbox. For the reply side, inject a synthetic inbound with channel: "whatsapp" — the recipient “replies,” Orbit opens the 24-hour customer-service window, and a follow-up free-form send then goes through. Check the state your composer checks: GET /api/v1/messages/whatsapp/window-status. That pair — inbound injection to open the window, then a free-form send — is the whole template-window rehearsal, with no Meta account involved.

3. Recipe: connect WhatsApp inside the sandbox without Meta signup

The sandbox gives you a full WhatsApp loop — template send, simulated receipt, injected reply, free-form follow-up — before you run Meta’s embedded signup in production.
  1. Mint a sandbox key with mode Test under Settings → API Keys (dv_test_sk_).
  2. Bulk-provision a deterministic fictional number from the reserved +1 555 01XX range:
  1. Send a WhatsApp message from one provisioned number to a magic recipient — the trailing digit picks the receipt:
  1. Inject the synthetic reply (below), then send a free-form type: "text" follow-up inside the window the injection opened.
When the same code goes to production, the connect-your-first-channel Recipe B walkthrough covers the real Meta signup, template approval, and the live window-status probe.

4. Perfecting the failure modes in the simulator

Rehearse the states your production handlers must survive. Aim each one at the magic number whose trailing digit emits exactly that state: Sandbox receipts never mutate stored message state — the stored message keeps its test_sent status, and the receipts exist only on the webhook stream. Your failure branch reads the same payload shape it would in production.

5. Pre-conditioning inbound replies

Drive the receive side by pushing synthetic replies into your agent queue and inbox — no forged provider webhook, no handset:
The injection lands exactly like a real inbound webhook: contact, conversation, and message rows are created, the unassigned-conversation notification fires, and your agent’s queue view refreshes. channel accepts sms, mms, or whatsapp; a repeated sender threads into the open conversation (created_conversation: false). Use it to rehearse auto-responders, STOP-keyword handling, inbox routing, and the 24-hour WhatsApp window from section 2. Endpoint bounds and error shapes are in the cookbook.

6. Graduating production — test key to live key

The go-live checklist handles the cut; this is what remains intact and what changes:
  1. Run the shared five-step gate — GET /api/v1/sandbox/pre-launch-checklist — until readyForLaunch: true. It is callably with either key and always evaluates your live workspace, so CI and the dashboard agree. Each item is covered on the pre-launch checklist page.
  2. Complete KYC and fund the balance — together they switch on live sending.
  3. Mint a live key (dv_live_sk_) under Settings → API Keys and swap it in. The request bodies stay identical; the sandbox signal rides on the key, not the code.
  4. Walk the human sign-off on the go-live checklist for numbers, webhooks, guardrails, and compliance.
Two pitfalls stay intact by design: magic recipients in live mode hit the real carrier (the trailing-digit convention is sandbox-only), and provisioned provider: "sandbox" numbers belong to the sandbox workspace only — re-register live numbers before cutting traffic. Both the sandbox test-mode guide and the cookbook repeat these rules; this playbook keeps them with the inventory they affect.