> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wadial.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Start a live call

> Start an audio call and stream PCM audio over WebSocket.

Use live calls when your app needs to speak with a WhatsApp contact in real time. Version 1 supports audio-only calls over a WebSocket media stream.

## Start the call

The token must be paired and connected.

```http theme={null}
POST /api/v1/sessions/{sessionId}/calls
Authorization: Bearer <api_key>
Content-Type: application/json
```

```json theme={null}
{
  "to": "15551234567@s.whatsapp.net"
}
```

Save the returned `callId`.

## Open the media stream

Upgrade the media endpoint to a WebSocket:

```http theme={null}
GET /api/v1/sessions/{sessionId}/calls/{callId}/media
Authorization: Bearer <api_key>
Upgrade: websocket
```

Send outbound audio as binary frames:

| Setting     | Value       |
| ----------- | ----------- |
| Encoding    | `Float32LE` |
| Sample rate | `16000` Hz  |
| Channels    | `1` mono    |

Server binary frames contain inbound peer audio in the same format.

## Handle backpressure

WADial sends `buffer` events with `bufferedMs`, `pauseMs`, and `resumeMs`.

Pause your audio producer when `bufferedMs` reaches `pauseMs`. Resume when it drains near `resumeMs`.

## End the call

End the call when your workflow finishes:

```http theme={null}
POST /api/v1/sessions/{sessionId}/calls/{callId}/end
Authorization: Bearer <api_key>
```
