---
title: "Test connections"
description: "Manage test connections and review their limits, lifecycle and supported features."
canonical: "https://docs.polymorfa.com/testing/test-connections"
---
# Test connections

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

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](https://docs.polymorfa.com/testing). To create one, follow the
[quickstart](https://docs.polymorfa.com/testing/quickstart).

## Limits

| Limit | Value |
| --- | --- |
| Test connections per project | 5, or 50 when your team has the Simulation add-on |
| Credits per test connection | None. Test connections create no reservation, charge or usage record. |
| Test events and phone actions | 30 per minute per project, shared |
| Recipients | Active, 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 value | Amount |
| --- | --- |
| Throughput | 5 messages per second per Connection |
| Included data | 1 GB per Connection |
| Inbound and outbound calls | 5 each per month |
| Serverless calls | 1,000 per month |
| Campaigns | Not included |

See [Free and Pay-As-You-Go](https://docs.polymorfa.com/billing#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`:

```bash cURL
curl "https://api.polymorfa.com/platform/connections?projectId=$PROJECT_ID" \
  -H "Authorization: Bearer $POLYMORFA_KEY"
```

```typescript 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

| Stage | What happens |
| --- | --- |
| Reserved | Creating a test QuickLink reserves the Connection. No simulated account exists yet. |
| Connected | Completing the simulated setup creates the account and links the API-controlled device. The device stays linked across service and app restarts. |
| Stopped | Stopping pauses the API-controlled device and keeps the Connection, its settings and any Inspector device. |
| Removed | Removal 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](https://docs.polymorfa.com/testing/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.

```bash 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 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.

```bash
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](https://docs.polymorfa.com/testing#differences).

## See also

- [Simulated setup scenarios](https://docs.polymorfa.com/testing#simulated-setup-scenarios)
- [Phone controls](https://docs.polymorfa.com/testing/phone-controls)
- [Open test connections in Inspector](https://docs.polymorfa.com/testing/inspector/devices)
- [List Connections](https://docs.polymorfa.com/api/connections/list-connections)
- [Create testing history fixture](https://docs.polymorfa.com/api/testing/create-testing-history-fixture)
