New WhatsApp voice calling is now available Learn more →

Maytapi/Docs//call/dial

/call/dialClosed beta · free in December 2026

WhatsApp Voice Calling API

Answer incoming WhatsApp voice calls and place outgoing ones with real two-way audio. The call audio reaches your application over a standard WebRTC connection, so you can play it, record it or connect it to a voice bot.

  • two-way audio
  • incoming and outgoing calls
  • outgoing group calls
  • any WebRTC client
curl -X POST "https://api.maytapi.com/api/$PID/$PHONE_ID/call/dial" \
  -H "x-maytapi-key: $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "to_number": "1415xxxxx67",
    "duration": 45
  }'
How it works

From ringing to talking in four steps

Your server controls the call over HTTPS. The audio flows over WebRTC through turn.maytapi.com.

  • call/ringing

    A call arrives or you dial

    You get the call/ringing webhook for an incoming call, or you start one with call/dial.

  • webrtc-config

    Get the WebRTC settings

    Your server fetches short-lived TURN settings (iceServers) for the connection.

  • accept + webrtc

    Answer and connect

    Answer the call, send your WebRTC offer and set the returned answer. The audio itself needs no HTTP requests.

  • call/end

    End the call

    End it yourself, or it ends when the other party hangs up or a time limit is reached. The call/end webhook reports the duration.

Outgoing

Place a call that stays open

Unlike the ring-only call/start, a call started with call/dial stays open when it is answered. Poll call/status and connect the audio once the status is connected.

  • ✓to_number with country code, without + or spaces
  • ✓duration: how long to ring, 45 seconds by default, 60 at most
  • ✓Group calls: pass the group ID with @g.us. All members are called and heard on one audio track
curl -X POST "https://api.maytapi.com/api/$PID/$PHONE_ID/call/dial" \
  -H "x-maytapi-key: $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "to_number": "1415xxxxx67",
    "duration": 45
  }'
Incoming

Answer incoming calls from your app

The call/ringing webhook gives you the callId. Answer the call with accept and connect the audio within 20 seconds, otherwise the call is ended.

  • ✓One-to-one incoming calls can be answered
  • ✓Incoming group calls cannot be answered
  • ✓One call at a time per phone
{
  "type": "message",
  "phone_id": 12345,
  "message": {
    "id": "00A1B2C3D4E5F60718293A4B5C6D7E8F",
    "type": "info",
    "subtype": "call/ringing",
    "callId": "00A1B2C3D4E5F60718293A4B5C6D7E8F",
    "isVideo": false,
    "fromMe": false
  },
  "user": {
    "id": "1415xxxxx68@c.us",
    "name": "John Doe",
    "phone": "1415xxxxx68"
  }
}
Audio

Real audio over standard WebRTC

Create an RTCPeerConnection with the settings from webrtc-config, add your audio track and send the offer. The caller's voice arrives as a remote audio track, and the audio you add is heard by the caller.

  • ✓Works in a browser or with server libraries such as aiortc (Python), werift (Node.js) and pion (Go)
  • ✓Only outbound TCP 443 to turn.maytapi.com is needed
  • ✓Audio only, video is not supported
  • ✓Keep your API token on your server; send only iceServers and the SDP to the browser
// cfg = response of webrtc-config (from your server)
const pc = new RTCPeerConnection({ iceServers: cfg.iceServers, iceTransportPolicy: "relay" });

const mic = await navigator.mediaDevices.getUserMedia({ audio: true });
mic.getTracks().forEach((t) => pc.addTrack(t, mic));

const audio = new Audio();
audio.autoplay = true;
pc.ontrack = (e) => { audio.srcObject = e.streams[0]; };

await pc.setLocalDescription(await pc.createOffer());
await new Promise((resolve) => {
  if (pc.iceGatheringState === "complete") return resolve();
  pc.onicegatheringstatechange = () => pc.iceGatheringState === "complete" && resolve();
});

// your server sends the offer to /call/{callId}/webrtc with your token
const answer = await yourServer.connectCall(callId, pc.localDescription.sdp);
await pc.setRemoteDescription({ type: "answer", sdp: answer.sdp });
Endpoints

Six endpoints for the whole call

Everything from answering to hanging up is a single HTTPS request. Calls have clear time limits:

  • ✓Maximum call length: 10 minutes by default, can be changed per phone on request
  • ✓Answered but audio not connected: the call ends after 20 seconds
  • ✓Connection drops: waits 25 seconds for it to recover, then ends the call
MethodEndpointPurpose
GET/call/webrtc-configWebRTC (TURN) settings for the call
POST/call/{callId}/acceptAnswer an incoming call
POST/call/dialStart an outgoing call
POST/call/{callId}/webrtcConnect the audio (offer → answer)
POST/call/{callId}/endEnd the call
GET/call/statusThe call that is ringing or in progress
Use cases

What you can build with voice calls

  • Voice bots

    Connect the call audio to speech-to-text, an AI model and text-to-speech to answer callers automatically.

  • Calls in the browser

    Let your team answer and place WhatsApp calls from a web app instead of the phone.

  • Call recording

    Record the call audio in your own application for quality checks and records.

FAQ

Voice calling FAQ

Ask our support team anything by email or through the help center. Average response time is under 24 hours.

Help center →
How do I get access?

Voice calls with audio are in closed beta and are enabled per phone. Email info@maytapi.com with the phone ID you want to enable. On phones without the feature these endpoints, except call/status, return an error.

Does it cost extra?

The beta is free during December 2026. The endpoints may change during the beta.

Is video supported?

No. Only audio is supported.

How long can a call last?

10 minutes by default. The limit can be changed per phone on request.

How is this different from call/start?

call/start is a ring-only call: it rings the recipient and ends when they answer, with no audio. A call started with call/dial stays open with two-way audio.

Start using the WhatsApp API

Get your key, send your first message in ten minutes

No approval, no templates, no card. Every endpoint is open for three days.