Skip to content
Get started
Esc
Write as a customer

Testing

POST /v1/test/inbound

Test keys only

Test keys only. A made-up customer writes on the simulator: the message.received webhook arrives, and until its free_text_until you can answer this number with text. With type voice, audio, image or video instead of text, the customer sends a sample file, a photo or a video with the caption from caption, which ⁠GET /v1/media/{id} downloads.

Returns the incoming message.

Body

from string required
The made-up customer's number in E.164, up to 32 characters.
type string
text when left out, or voice, audio, image or video for a sample file.
text.body string
What the customer writes, up to 4,096 characters. Required unless type names a file.
name string
The customer's name, up to 120 characters, or null.
caption string
A caption for a sample photo or video, up to 1,024 characters, or null.

Errors

CodeHTTPWhat it means
test_key_required403This works with a test key only.
invalid_request422The request is not filled in correctly.
invalid_phone422Give the number in international format, for example +77011234567.

Any request can also get the codes on Errors, such as unauthenticated and rate_limited.

Code language
// npm install @airboxhq/api
// AIRBOX_API_KEY=YOUR_API_KEY node test_inbound.mjs
import { Airbox } from "@airboxhq/api";

const client = new Airbox(process.env.AIRBOX_API_KEY);

const { data, error } = await client.test.inbound({
  from: "+77011234567",
  text: { body: "Hello! When will my order be ready?" },
  name: "Asel",
});

if (error) {
  throw new Error(`${error.code}: ${error.message} (${error.requestId})`);
}

console.log(data);
Response 201
{
    "id": "0199c5e2-6a29-7b40-8e0d-2f1c3a4b5d6e",
    "contact_id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
    "from": "+77011234567",
    "name": "Asel",
    "channel": "simulator",
    "type": "text",
    "text": {
        "body": "Hello! When will my order be ready?"
    },
    "received_at": "2026-10-09T09:30:00+00:00",
    "free_text_until": "2026-10-10T09:30:00+00:00"
}