Skip to content

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.sent plus a synthetic message.status with delivered.
  • 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_limited with a Retry-After that runs to 00:00 UTC; real traffic is not affected.

Simulating a customer#

POST/v1/test/inboundscope send

Simulate a customer message on the workspace's sandbox channel

cURLbash
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"  }}'
200 OKjson
{  "event_id": "evt_sabr24pa3eywnyp266ssm8yw9pkrdvzr2hy4wwnsg1vrbbze92xg",  "workspace_id": "ws_01m74e503kmb73kwncxpsgwymm",  "channel_id": "ch_01m74e503q4nzfn8h6zkwqq7gq",  "conversation_id": "cnv_djF8Y2hfMDFtNzRlNTAzcTRuemZuOGg2emt3cXE3Z3F8c2FuZGJveC1tYXJpb3w"}
FieldTypeDescription
workspace_idws_ idoptionalRequired 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.
textstringoptional≤ 4,096 charsThe message text (required for text; caption for media).
fromobjectoptionalThe simulated contact.
from.idstringrequired≤ 128 charsTheir id; the same id keeps the same conversation.
from.namestring≤ 128 charsTheir display name.
interactive_replyobjectoptionalRequired for interactive_reply: the button or row the contact tapped.
interactive_reply.idstringrequiredThe button or row id.
interactive_reply.titlestringrequiredIts visible title.
interactive_reply.kind"button" | "list" | "postback" | "quick_reply"requiredbutton, list, postback or quick_reply.
attachmentsobject[]optional≤ 10 itemsRequired for media types.
attachments[].type"image" | "audio" | "video" | "document" | "sticker"requiredAttachment type.
attachments[].urlURLrequired≤ 2,048 charsPublic HTTPS URL of the file.
attachments[].mime_typestring≤ 255 charsMIME type of the file.
attachments[].filenamestring≤ 255 charsFile name.
attachments[].voicebooleandefault falseMark an audio file as a voice note.
FieldTypeDescription
event_idevt_ idThe message.received event that was produced.
workspace_idws_ idIts workspace.
channel_idch_ idThe workspace's sandbox channel.
conversation_idcnv_ 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

interactive_replyjson
{  "type": "interactive_reply",  "text": "Confirm",  "from": {    "id": "sandbox-mario",    "name": "Mario Rossi"  },  "interactive_reply": {    "id": "confirm",    "title": "Confirm",    "kind": "button"  }}

A photo

imagejson
{  "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#

sandbox.tstypescript
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.