# Build and test before you go live.

With a test key, bubbl3 sends only to test numbers, through your workspace's sandbox number and the simulator. Messages follow the whole pipeline, including status changes, receipts and fallback, so your webhooks fire as they would live. You can reply as the contact, and when it works you swap in a live key.

In the API, each number is a `line` object, and your workspace's sandbox number is one of them.

## What a test key does

- It sends only to test numbers, `+1 NPA 555 01xx`, such as `+19175550142`. Any other number is refused.
- Messages go to your workspace's sandbox number and the simulator, never to a real person.
- Sandbox messages are marked `is_test: true` and never count towards number limits or health.
- In the dashboard, Developers, then Sandbox, shows sandbox traffic and can send simulated replies.

## Reply as the contact

`POST /v1/sandbox/inbound` records a text from a test number to a sandbox number, as if the contact had replied. The contact is matched or created, the conversation opens and `message.received` fires. STOP and START work as they would live.

## Send, then reply as the contact

Sandbox:

```
import { Bubbl3 } from "@bubbl3/sdk";

// With a test key (b3_test_…), every call stays in the sandbox
const b3 = new Bubbl3({ apiKey: process.env.BUBBL3_API_KEY });

await b3.messages.create(
  { to: "+19175550142", body: "Hi Maya, still good for Thursday at 4:30?" },
  { idempotencyKey: "confirm-4821" },
);

// Reply as the contact would, from the same test number
await b3.sandbox.simulateInbound({
  from: "+19175550142",
  body: "Yes, see you then",
});
// → your message.received webhook fires, as it would live
```

## In the documentation

- [Test with the sandbox](https://docs.bubbl3.com/quickstart/api#7-test-with-the-sandbox)
- [Sandbox calls in the API reference](https://docs.bubbl3.com/api/messages#sandbox-state)

Updated: 2026-10-15
