Preview. WhatsApp calling is rolling out per deployment. The API below is
final; ask us to enable it on your org.
How it fits together
Meta signals the call to PyAI (calls webhook) and streams the audio over
WebRTC. PyAI answers, converts the audio, and opens an Omni session for the
agent bound to the number. You never touch SDP, ICE, or Opus.
Before you start
- A WhatsApp Business number on Meta’s Cloud API with a messaging limit of at least 2,000 conversations per day (Meta’s prerequisite for calling).
- A system-user access token for that WhatsApp Business Account with the
whatsapp_business_messagingpermission. - A PyAI live API key with the
telephony:managescope.
1. Point Meta’s webhooks at PyAI
In your Meta app: WhatsApp → Configuration → Webhooks. Set the callback URL tohttps://api.pyai.com/public/whatsapp/webhook, use the verify token PyAI
gave you, and subscribe to calls and messages (the second one
carries call-permission replies).
2. Register the number and bind an agent
POST /v1/whatsapp/numbers/{id}/assign.
3. Turn calling on
Calling a user (business-initiated)
Meta requires the user’s permission before you can call them. Ask for it:GET /v1/whatsapp/call-permissions?number_id=…&user=….
Then place the call:
call_permission_required.
Permission requests are rate-limited by Meta (one per 24 hours, two per 7 days
per user), and business-initiated calls are not offered in every country.
Call records
GET /v1/whatsapp/calls lists calls newest first with direction, status,
connect and end times, and duration. Hang up from your side with
POST /v1/whatsapp/calls/{id}/terminate.
What’s different from a phone call
- No DTMF. WhatsApp users speak; keypad tones are not delivered to the agent.
- No transfer to a human. There is no phone leg to transfer; end the call and follow up in the chat instead.
- Audio is wideband on WhatsApp’s side; the agent hears it at telephony quality today.
Reference
- The
WhatsApptag in the OpenAPI contract lists every endpoint and schema. - Telephony audio for what the agent hears on a call leg.
- Meta’s Cloud API Calling docs for number prerequisites and regional availability.