# Send a test message

Sends a test message.

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

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

## Path parameters

- `accountId` (string, required)

## Request body

Content type: `application/json`

- `message`, string, required: Up to 4096 characters
- `conversationId`, string

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/business-agent/test-messages" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "message": "Hello from Pozy"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/business-agent/test-messages", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    message: "Hello from Pozy"
  }),
});
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/test-messages",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "message": "Hello from Pozy",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `message_id`, string, required
- `agent_response`, string, required
- `conversation_id`, string, required
- `timestamp`, integer
- `handoff_reason`, string
- `no_response_reason`, string
- `quick_replies`, array of string
- `product_variant_ids`, array of string

```json
{
  "message_id": "68fa713eb12c02cd1b5b5f8d",
  "agent_response": "string",
  "conversation_id": "6c0c59452238e0c7d5a35100",
  "timestamp": 1,
  "handoff_reason": "string",
  "no_response_reason": "string",
  "quick_replies": [
    "string"
  ],
  "product_variant_ids": [
    "string"
  ]
}
```
