# Send flow message

Sends a flow message.

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

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

## Request body

Content type: `application/json`

- `accountId`, string, required
- `to`, string, required
- `flow_id`, string, required
- `flow_cta`, string, required: Up to 20 characters
- `flow_action`, string: One of `navigate`, `data_exchange`. Default `navigate`
- `flow_token`, string: Up to 200 characters
- `flow_action_payload`, object
  - `screen`, string
  - `data`, object
- `body`, string, required
- `header`, object
  - `type`, string: One of `text`
  - `text`, string
- `footer`, string
- `draft`, boolean

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/whatsapp/flows/send" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9",
  "to": "+14155550123",
  "flow_id": "6b3aa235a01c0fe058cfaf00",
  "flow_cta": "string",
  "body": "string"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/whatsapp/flows/send", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    accountId: "696e0b682d0a31188e7a2ba9",
    to: "+14155550123",
    flow_id: "6b3aa235a01c0fe058cfaf00",
    flow_cta: "string",
    body: "string"
  }),
});
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/flows/send",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "accountId": "696e0b682d0a31188e7a2ba9",
        "to": "+14155550123",
        "flow_id": "6b3aa235a01c0fe058cfaf00",
        "flow_cta": "string",
        "body": "string",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `success`, boolean
- `messageId`, string

```json
{
  "success": true,
  "messageId": "62d191e7089bc48b8ea56b35"
}
```
