# Send a business event

Sends a business event.

```http
POST https://api.pozy.ai/v1/accounts/{accountId}/business-agent/events
```

- Area: WhatsApp / Business Agent
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `accountId` (string, required)

## Request body

Content type: `application/json`

- `to`, string, required
- `type`, string, required: Up to 256 characters
- `description`, string, required: Up to 1024 characters
- `payload`, string, required: Up to 4096 characters

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/business-agent/events" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "+14155550123",
  "type": "string",
  "description": "A short description",
  "payload": "string"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/business-agent/events", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    to: "+14155550123",
    type: "string",
    description: "A short description",
    payload: "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/accounts/696e0b682d0a31188e7a2ba9/business-agent/events",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "to": "+14155550123",
        "type": "string",
        "description": "A short description",
        "payload": "string",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 202

- `status`, string, required
- `agent_event_id`, string

```json
{
  "status": "active",
  "agent_event_id": "6305e71fab938130cac3d22c"
}
```
