Skip to main content
A Number is one connected WhatsApp account. Messaging methods take its ID as their first argument. A QuickLink is a hosted page where the account owner links their WhatsApp. Create one and send its URL to the person holding the phone:
externalId is your own reference. It appears on the new Number and in its webhook events. With a project credential, omit projectId. Follow progress until the status is connected:
The status moves through pending, opened, linked, and connected, or ends as failed or cancelled. Call quickLinks.cancel(id) to withdraw a link that has not connected. Page text, branding, and callback URLs are saved settings. Read and change them with platform.quickLinkSettings. See QuickLink.

List your Numbers

Omit projectId to list every Number in the team. Keep Number IDs as strings. Use testMode to tell Test Numbers apart from real ones.

Check a Number’s status

The session.status webhook reports status changes as they happen. See Webhooks. Read the linked WhatsApp account with messaging.sessions.account("<number-id>"). Get session returns newChatCapping for a linked-device number, with the limit, usage and reset time WhatsApp reported. It is null until Polymorfa has observed the number. The NewChatCapping SDK type is available in the release that follows this API change. See WhatsApp new-chat cap.

Start and stop a Number

start confirms that the start was accepted, not that the Number connected. Watch the status to see it connect. Starting a paid Number reserves credit first. If the team cannot pay, start throws PolymorfaPaymentRequiredError. See Errors. platform.sessions.stopMany({ sessionIds }) stops up to 100 Numbers at once.

Restart or log out a Number

logout unlinks the WhatsApp account and returns an operation in the same way. See Wait for an operation.

Change a Number’s configuration

Configuration covers history sync, hosted message storage, and observation of presence, typing, labels, and quick replies. Read the current revision, then send your change with it:
set overrides a value for this Number. reset removes the override, so the Number follows the project and team defaults again. A stale revision fails with 409 state_conflict. Change defaults with platform.sessionConfiguration and project.sessionConfiguration. See Session configuration.

Set Safe Mode for one Number

inherit removes the Number’s override and uses the project setting.

Change a Number’s tier

A tier change is a quote followed by a confirmation:
Show the quoted charge before you confirm it. amountCents is in credits and can have up to six decimal places. A quote expires after ten minutes. A queued change has not been applied yet; read it again until it is applied or rejected. Quote tierOverride: null to return the Number to the project’s tier. See Billing.

Delete a Test Number

delete and deleteMany remove Test Numbers only. A real Number returns 409.