Sandbox
Test on WhatsApp without a real phone
Test numbers are WhatsApp accounts on a simulated network. They pair, send and receive on the same runtime as real numbers, through the same API and webhooks, and never reach a real person.
- Test numbers per project
- 5
- With the Simulation add-on
- 50
- Per online test number-day
- 0 credits
- Test event fixtures
- 9
Test numbers
A real runtime on a simulated network.
Each test number is an ordinary Linked Devices session. It connects to a simulated WhatsApp network instead of WhatsApp's servers, so your code runs the path a real number runs.
- Project-only recipients. Direct messages reach other test numbers in the project. Any other recipient returns 404.
- Ready on creation. A new test number is connected at once and stays linked across restarts.
- 243 countries. Pick a country and get a number in its local format.
Inspector and phone controls
Both ends of the conversation.
Open a test number in the Polymorfa Inspector desktop app, and act as its phone from the Console or the API.
Scenarios
Test the paths that break in production.
Choose how a test number replies and whether its sends fail, and start it with chat history.
Test events
Every webhook, on demand.
Fire an event for a test number. It reaches your webhooks and the events API in the production format, marked as a test.
- Real round trips. Set fromSession and another test number sends the message, so you can reply to it.
- Safe to retry. Repeat a trigger with the same Idempotency-Key and you get the same event.
- Audited. Every trigger is recorded in your team's audit log.
In your code
Tests that run in CI.
Create test numbers, act as the phone and fire events from your test suite.
import { MessagingClient } from "@polymorfa/sdk";
const messaging = new MessagingClient({
credential: { type: "apiKey", value: process.env.POLYMORFA_KEY! },
});
const link = await messaging.quickLinks.create({
projectId,
configuration: {
testing: {
country: "BR",
configuration: {
accountType: "business",
replyBehavior: "echo",
failureScenario: "none",
},
},
},
});API surface
The Sandbox API.
Test numbers use the regular Messaging API. These routes add setup, phone controls and test events.
Test numbers
- POST
/Reserve a test number with configuration.testingmessaging/ quicklinks - POST
/Start the reserved simulated accountquicklink/ {token}/ testing/ start - POST
/Upload chat historymessaging/ testing/ {project}/ history-fixtures
Phone controls
- GET
/Read the phone and its linked devicesmessaging/ testing/ {project}/ numbers/ {session}/ phone - POST
…/Send a message as the phonenumbers/ {session}/ phone/ messages - POST
…/Unlink a companion devicenumbers/ {session}/ phone/ devices/ {deviceId}/ unlink
Test events
- POST
/Fire a signed test eventmessaging/ testing/ {project}/ events - GET
/List fixtures and their overridesmessaging/ testing/ {project}/ events/ fixtures
Fixtures
- Event
message.receivedAn inbound message - Event
message.failedA send that failed - Event
call.missedA call nobody answered - Event
session.restriction_updatedA restriction change
Start with a free number
Your first real number is free. Add more numbers on Pay-As-You-Go.