Get started
Sandbox
Connecting a real WhatsApp number takes a client, a business and Meta's review. The sandbox lets you build, test and demo the whole flow today, through exactly the same events and endpoints.
On this page
The sandbox channel#
- Every workspace owns one virtual channel with provider
sandbox. It needs no connection and is not counted in your plan's channel limit or usage. - Its events go through the real fan-out: your webhook endpoints, the event buffer, the logs. They carry
"test": true. - Sends to sandbox conversations are accepted and validated like any other, never reach a provider, and come back as
message.sentplus a syntheticmessage.statuswithdelivered. - Test events are limited to 1,000 per organization per UTC day: a simulated customer message (API or console) and an endpoint test count 1, a send to a sandbox conversation 2. Above that the API answers
429 rate_limitedwith aRetry-Afterthat runs to 00:00 UTC; real traffic is not affected.
Simulating a customer#
POST
/v1/test/inboundscope sendSimulate a customer message on the workspace's sandbox channel
curl -X POST https://api.braidport.com/v1/test/inbound \ -H "Authorization: Bearer $BRAIDPORT_API_KEY" \ -H "Idempotency-Key: sandbox-1" \ -H "Content-Type: application/json" \ -d '{ "text": "Hi, can I book for tomorrow?", "from": { "id": "sandbox-mario", "name": "Mario Rossi" }}'{ "event_id": "evt_sabr24pa3eywnyp266ssm8yw9pkrdvzr2hy4wwnsg1vrbbze92xg", "workspace_id": "ws_01m74e503kmb73kwncxpsgwymm", "channel_id": "ch_01m74e503q4nzfn8h6zkwqq7gq", "conversation_id": "cnv_djF8Y2hfMDFtNzRlNTAzcTRuemZuOGg2emt3cXE3Z3F8c2FuZGJveC1tYXJpb3w"}| Field | Type | Description |
|---|---|---|
workspace_id | ws_ id | optionalRequired with an organization key: the workspace whose sandbox receives the message. |
type | "text" | "image" | "audio" | "video" | "document" | "interactive_reply" | optionaldefault "text"text, image, audio, video, document or interactive_reply. |
text | string | optional≤ 4,096 charsThe message text (required for text; caption for media). |
from | object | optionalThe simulated contact. |
from.id | string | required≤ 128 charsTheir id; the same id keeps the same conversation. |
from.name | string | ≤ 128 charsTheir display name. |
interactive_reply | object | optionalRequired for interactive_reply: the button or row the contact tapped. |
interactive_reply.id | string | requiredThe button or row id. |
interactive_reply.title | string | requiredIts visible title. |
interactive_reply.kind | "button" | "list" | "postback" | "quick_reply" | requiredbutton, list, postback or quick_reply. |
attachments | object[] | optional≤ 10 itemsRequired for media types. |
attachments[].type | "image" | "audio" | "video" | "document" | "sticker" | requiredAttachment type. |
attachments[].url | URL | required≤ 2,048 charsPublic HTTPS URL of the file. |
attachments[].mime_type | string | ≤ 255 charsMIME type of the file. |
attachments[].filename | string | ≤ 255 charsFile name. |
attachments[].voice | boolean | default falseMark an audio file as a voice note. |
| Field | Type | Description |
|---|---|---|
event_id | evt_ id | The message.received event that was produced. |
workspace_id | ws_ id | Its workspace. |
channel_id | ch_ id | The workspace's sandbox channel. |
conversation_id | cnv_ id | ≤ 2,048 charsReply to it with POST /v1/messages. |
With an organization key, workspace_id is required. Reusing the same from.id keeps the same conversation, so you can play a whole exchange.
A tapped button
{ "type": "interactive_reply", "text": "Confirm", "from": { "id": "sandbox-mario", "name": "Mario Rossi" }, "interactive_reply": { "id": "confirm", "title": "Confirm", "kind": "button" }}A photo
{ "type": "image", "text": "Is this the right form?", "from": { "id": "sandbox-mario" }, "attachments": [ { "type": "image", "url": "https://example.com/form.jpg", "mime_type": "image/jpeg" } ]}In the dashboard, the workspace's Console has a Simulate customer message button that does the same.
With the SDK#
const { conversation_id, event_id } = await braidport.sandbox.simulateInbound({ text: "Hi, can I book for tomorrow?", from: { id: "demo-user", name: "Mario Rossi" },});Then reply to conversation_id exactly as you would on a real channel (see Sending messages). When the client connects their accounts, nothing in your workflow changes except test turning false.