Skip to content
Shortcut: /, ⌘K or Ctrl+K

Test connections

Manage test connections and review their limits, lifecycle and supported features.

View as Markdown

A test connection is a simulated WhatsApp Connection that belongs to one project. It has a generated phone number, a simulated phone and a linked device that the API controls. This page covers how many you can have, how to find, stop, start and remove them, and which features they support.

Test connections require access; see Testing. To create one, follow the quickstart.

Limits #

LimitValue
Test connections per project5, or 50 when your team has the Simulation add-on
Credits per test connectionNone. Test connections create no reservation, charge or usage record.
Test events and phone actions30 per minute per project, shared
RecipientsActive, connected test connections in the same project

The project limit counts test connections that are not removed. It is separate from the limit on real Connections, and it applies on Free and Pay-As-You-Go teams. The Simulation add-on is a separate purchase; test connections themselves use no credits.

Throughput, included data and call allowances follow the Connection tier, as for a real Connection. On the Free tier these values are:

Free tier valueAmount
Throughput5 messages per second per Connection
Included data1 GB per Connection
Inbound and outbound calls5 each per month
Serverless calls1,000 per month
CampaignsNot included

See Free and Pay-As-You-Go for the other tiers.

Find your test connections#

Console

Open the project's Connections page. Test connections are listed under Test slots, separately from real Connections.

API

List the project's Connections with a team key or project token that has connections:read:

cURL
curl "https://api.polymorfa.com/platform/connections?projectId=$PROJECT_ID" \
  -H "Authorization: Bearer $POLYMORFA_KEY"
TypeScript
const connections = await platform.connections.list({ projectId: "<project-id>" });
const testNumbers = connections.data.data.filter(connection => connection.testMode);

Test connections have testMode: true. Use the returned identifier and phone number rather than assuming a count or a number format.

TypeScript:

Use the returned identifier and phone number rather than assuming a count or a number format.

Lifecycle #

StageWhat happens
ReservedCreating a test QuickLink reserves the Connection. No simulated account exists yet.
ConnectedCompleting the simulated setup creates the account and links the API-controlled device. The device stays linked across service and app restarts.
StoppedStopping pauses the API-controlled device and keeps the Connection, its settings and any Inspector device.
RemovedRemoval closes any open Inspector session, unlinks every device and clears the simulated account. Removal is permanent.

Stop, start or remove a test connection with a team key or project token that has connections:manage. The project's Test key can also stop, start and restart its test connections, but not remove them. $CONNECTION_ID is the Connection's identifier from the list.

cURL
# Stop
curl -X POST "https://api.polymorfa.com/platform/connections/$CONNECTION_ID/stop" \
  -H "Authorization: Bearer $POLYMORFA_KEY"

# Start again
curl -X POST "https://api.polymorfa.com/platform/connections/$CONNECTION_ID/start" \
  -H "Authorization: Bearer $POLYMORFA_KEY"

# Remove
curl -X DELETE "https://api.polymorfa.com/platform/connections/$CONNECTION_ID" \
  -H "Authorization: Bearer $POLYMORFA_KEY"
TypeScript
// Stop
await platform.connections.stop("<connection-id>", { projectId: "<project-id>" });

// Start again
await platform.connections.start("<connection-id>", { projectId: "<project-id>" });

// Remove
await platform.connections.delete("<connection-id>");

Start, stop and restart responses acknowledge the request. Check the Connection's status before treating the action as complete. Repeating a pending start or restart keeps the same attempt. If cleanup remains unconfirmed, resolve it before starting a new attempt.

If a removal can't close the Connection, the request fails and leaves the Connection in place so you can retry. In the Console, remove test connections from Test connections on the Connections page.

Add simulated history #

A history fixture gives a new test connection earlier chats to retrieve. Upload the fixture first, then reference it when you create the test connection. A fixture belongs to the project, not to a Connection, because you upload it before the test connection exists. You can reuse it for several test connections.

Console

In the new test connection form, under Configuration, select Upload test history and choose a JSON file with up to 100 messages.

API

Upload the messages with a project token or team key that has sandbox:write. The Test key can't upload fixtures.

Shell
curl -X POST "https://api.polymorfa.com/messaging/projects/$PROJECT_ID/test-history-fixtures" \
  -H "Authorization: Bearer $POLYMORFA_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      { "id": "m1", "senderPhone": "+15550100002", "text": "Is my order on its way?", "timestamp": 1760000000, "fromMe": false },
      { "id": "m2", "senderPhone": "+15550100001", "text": "Yes, it ships today.", "timestamp": 1760000060, "fromMe": true }
    ]
  }'

The API returns 201 Created with a fixtureId. Pass it as configuration.testing.configuration.historyFixtureId when you create the test QuickLink.

A fixture holds at most 100 messages in a request smaller than 512 KiB. Each message needs a unique id, a senderPhone that belongs to a test connection in the project, text of up to 4,096 characters, a Unix timestamp in seconds that is not in the future, and fromMe. Uploading a fixture publishes no message events.

What test connections can do #

A test connection behaves like a real linked-device Connection. Messages, media, message edits and reactions, receipts, contacts, groups, channels, presence, privacy, profiles, labels and business catalogs work through the same API methods and produce the same events and webhooks.

The API-controlled device and Inspector share one simulated account, so a change in one appears in the other. A message sent while the recipient's Inspector is closed is delivered when it reconnects. Removing the recipient cancels its pending messages.

What test connections can't do #

  • Reach anyone outside the project. Recipients must be test connections in the same project.
  • Use real-phone or Meta Cloud API setup. A test QuickLink can't prefill a phone number, offer Meta Cloud API setup, or turn on observation. Official API methods on a test connection are simulated and never reach Meta.
  • Keep Hosted Message Storage history. Test connections have no retained history.
  • Send campaigns without a campaign tier. Campaign senders need a Connection tier that includes campaigns; Free and Standard don't. A campaign can select test connections as senders and can run drip sequences on them, but a campaign uses one kind of sender: real Connections, Meta Cloud API Connections or test connections.
  • Send weighted message variations. A campaign with weighted message variations sends only from real linked-device Connections.
  • Count toward billing, Usage or BanSafe scoring. See How test connections differ from real Connections.

See also#