Skip to main content
Every Test number has a simulated phone that acts as its main device. The Polymorfa API and Inspector connect to it as linked devices, the same way they connect to a real phone. Use the phone controls to check which devices are linked, send a message as the phone, or unlink a device as a person would from Linked devices on their phone. Phone controls work only for Test numbers (testMode: true). A request for any other number returns 400 Bad Request.

Before you start

  • Your team has Test numbers access. See What is Sandbox?.
  • You have a project key, or a team key, with the sandbox:read scope to read the phone and sandbox:write to send or unlink. Client tokens can’t use phone controls.
  • Sending and unlinking need the Test number to be running. Start it first if the phone is offline.

In the Console

Open the project’s Numbers page. Test numbers are listed under Test slots. Choose Phone controls beside a Test number to see its linked devices, unlink one, or send a message from the phone to another Test number in the project.

Read the phone

online is true while the simulated phone is running. devices lists the linked devices by device ID.

Send a message from the phone

The phone sends a text to another running Test number in the same project. The message travels the simulated WhatsApp network, so the sender’s linked devices receive the sent copy and the recipient receives an ordinary incoming message.
The API returns 202 Accepted with the WhatsApp message ID when the phone reports one:
Phone messages and test events share a limit of 30 requests per minute per project. Above it, the API returns 429 Too Many Requests with a Retry-After header. Unlinking logs the device out, as it would on a real phone. Device 0 is the phone itself and can’t be unlinked.
A device ID that is not linked returns 404 Not Found.

Errors

See the API reference for Get a Test number’s phone, Send a message from a Test number’s phone and Unlink a companion.