# Initiate outbound call

Initiates an outbound call.

```http
POST https://api.pozy.ai/v1/whatsapp/calls
```

- Area: WhatsApp / WhatsApp Calling
- Auth: Authorization: Bearer pz_live_...

## Header parameters

- `Idempotency-Key` (string)

## Request body

Content type: `application/json`

- `accountId`, string, required
- `to`, string, required
- `action`, string: One of `send_call_permission_request`
- `bodyText`, string: Up to 1024 characters
- `forwardTo`, string
- `recordOverride`, boolean
- `biz_opaque_callback_data`, string: Up to 512 characters

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/whatsapp/calls" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9",
  "to": "+14155550123"
}'
```

```ts
import { randomUUID } from "node:crypto";

const res = await fetch("https://api.pozy.ai/v1/whatsapp/calls", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Idempotency-Key": randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    accountId: "696e0b682d0a31188e7a2ba9",
    to: "+14155550123"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.post(
    "https://api.pozy.ai/v1/whatsapp/calls",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "accountId": "696e0b682d0a31188e7a2ba9",
        "to": "+14155550123",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `success`, boolean
- `callId`, string
- `carrierCallControlId`, string
- `status`, string: One of `dialing`
- `direction`, string: One of `outbound`
- `to`, string
- `forwardTo`, string: Can be null
- `recordingEnabled`, boolean

```json
{
  "success": true,
  "callId": "6f502e3f20741dfe2abae39e",
  "carrierCallControlId": "6c367f42f99a6851724a1342",
  "status": "dialing",
  "direction": "outbound",
  "to": "+14155550123",
  "forwardTo": "string",
  "recordingEnabled": true
}
```
