Testing
Simulate WhatsApp conversations to test your integration without a real connection.
A test connection is a simulated WhatsApp Connection in one of your projects. It behaves like a real linked-device Connection, so the same API methods, events, receipts and webhooks apply. It talks only to other test connections in the same project over a simulated WhatsApp network. It never reaches a real WhatsApp user or Meta.
Use test connections to develop and check an integration before you connect a real phone. To see the other side of a conversation, open a test connection in Polymorfa Inspector.
You can simulate:
- Messages between test connections in the same project, including replies, media, groups and receipts.
- Webhook events for inbound messages, receipts, failed sends, calls, connection changes, restrictions and template reviews.
- The phone itself: its linked devices, a message sent from the phone, and unlinking a device.
- Setup choices: the profile, account type, automatic echo replies, rejected sends and earlier chat history.
Use test connections for functional tests, not load tests. Each project holds a small number of them, and test events and phone actions share a limit of 30 per minute per project.
Create a test connection#
You create a test connection through a QuickLink: from the Console's Connections page, or with API Create quick link and a configuration.testing object. Opening the link and completing its simulated setup creates the account. The quickstart walks through both ways and sends a first message.
The POST /platform/connections/testing method is retired. It returns 410 resource_gone; use a QuickLink instead.
Limits #
| Limit | Value |
|---|---|
| Test connections per project | 5, or 50 when your team has the Simulation add-on |
| Test events and phone actions | 30 per minute per project, shared |
| Credits and billing | None: test connections use no credits and create no usage records |
Removed test connections don't count toward the project limit. The limit is separate from the limit on real Connections, and test connections keep working when a project moves to production. Throughput, included data and call allowances follow the Connection tier; see Test connections.
Who can message whom #
A test connection can message only active, connected test connections in the same project. Test connections in another project of the same team, real Connections and phone numbers outside your project are not on the simulated network.
Sending a message to such a recipient returns 404 resource_not_found and creates no chat, contact or message. Group and channel activity reaches only the test connections in that group or channel.
How test connections differ from real Connections #
A test connection behaves like a linked-device Connection on every API method, with four intentional differences:
| Difference | What it means for your tests |
|---|---|
| No billing or usage | Test connections use no credits and add nothing to Usage. |
| Same-project recipients only | A phone number outside the project looks like a connection that is not on WhatsApp. |
| Relaxed BanSafe | BanSafe doesn't score test connections or apply its daily sending allowance to them. |
| Simulated Meta Cloud API | Official API methods on a test connection are simulated and never reach Meta. |
Some features are limited on test connections; see What test connections can't do.
Connection method and account type #
Every test connection uses the Linked Devices connection method. A test QuickLink doesn't offer the Meta Cloud API or Hybrid Link methods.
The accountType you choose changes how the account looks on the simulated network and in Inspector. It doesn't change the connection method:
| Account type | What you can test |
|---|---|
whatsapp_app, business_app | The account looks like the WhatsApp app or the WhatsApp Business app. |
meta_cloud | The account looks like an Official API business. Inspector can't open it. |
meta_coexistence | The account looks like a Business app number that also uses the Official API. |
A test connection with the meta_cloud or meta_coexistence account type still uses Linked Devices. Its Official API (Graph) sends travel the simulated network like any other send, and receipts come from the recipient test connection. You can't hold a message or choose why it fails. To test send errors, use the reject-send failure scenario or a message.failed test event.
Simulated setup scenarios #
Choose these values when you create the test connection's QuickLink, under configuration.testing.configuration. In the Console they appear under Configuration in the new test connection form.
| Field | Values | Result |
|---|---|---|
profile.name | 1 to 128 characters | The account's display name. |
profile.status | Up to 139 characters | The account's profile status (about text). |
accountType | whatsapp_app, business_app, meta_cloud, meta_coexistence | The configured account type: WhatsApp app, Business app, Official API or Business app with Official API. |
primaryPlatform | android, ios | The primary phone platform. Defaults to android; omit it for meta_cloud. |
replyBehavior | off, echo | With echo, a text message from another test connection in the project is sent back to that sender. |
failureScenario | none, reject-send | With reject-send, sending a message, button message or list message from this test connection fails. Use it to test your send error handling. |
historyFixtureId | A fixture ID | Loads earlier chat history from an uploaded fixture. |
configuration.testing.country sets the country of the generated phone number, as an ISO 3166-1 alpha-2 code. List up to three fields in configuration.testing.editable to let the person who opens the link change them before setup starts. An empty list keeps every value fixed.
{
"projectId": "00000000-0000-4000-8000-000000000001",
"configuration": {
"testing": {
"country": "BR",
"configuration": {
"profile": { "name": "Demo support" },
"accountType": "business_app",
"replyBehavior": "echo",
"failureScenario": "none"
},
"editable": ["profile.name", "replyBehavior"]
}
}
}A test QuickLink can't prefill a phone number, offer Meta Cloud API setup or turn on observation.
Test events #
A test event delivers a signed webhook event for a test connection without any WhatsApp activity. Each fixture name is the event type it produces.
| Fixture | Simulates |
|---|---|
message.received | An inbound text or media message |
message.ack | A delivery, read or played receipt, or a receipt error |
message.failed | An outbound send that failed |
call.received, call.missed, call.ended | An incoming, unanswered or finished call |
connection.status | A connection status change |
connection.restriction_updated | A WhatsApp restriction starting or ending |
template.status | A template approval or rejection |
Trigger one with API Trigger test event, where connection is the test connection. List the fixtures with API List test event fixtures. Both work with the project's Test key. Test events reach your webhooks and event history only; they don't change the test connection. See Trigger test events for overrides and defaults.
Start testing#
Create two test connections and send a message between them.
Test connectionsReview limits, lifecycle and what test connections can do.
Phone controlsAct as a test connection's phone.
Trigger test eventsSend signed test events to your webhooks.
Install InspectorSee the other side of a conversation.
Open test connections in InspectorOpen a test connection as a linked device.