# How to Send Phone Broadcast via Route

The `/kw/api/broadcast/route` API endpoint allows sending messages by broadcast template via external call. This is useful for automating broadcasts from your systems.

---

## Endpoint

```
POST https://engine-{{instance_name}}.connectiveone.io/kw/api/broadcast/route
```

---

## Authorization

Using `x-auth-token` in headers, make a POST request.

**Example headers:**

```http
Content-Type: application/json
x-auth-token: YOUR_TOKEN
```

> ⚠️ **Important:** The `x-auth-token` token must be valid for your instance. Contact the support team to obtain the token.

---

## Request Parameters

In the request body, pass the following data:

| Parameter | Type | Required | Description |
|-----------|------|:--------:|-------------|
| `bot_id` | integer | ✅ | Bot ID that will perform the broadcast |
| `phone` | string | ✅ | User phone number in international format (without `+` sign) |
| `template_id` | integer | ✅ | Broadcast template ID on the instance |

---

## Example Request

```json
{
  "phone": "380662094811",
  "bot_id": 69,
  "template_id": 1
}
```

**Example curl request:**

```bash
curl -X POST \
  https://engine-instancename.connectiveone.io/kw/api/broadcast/route \
  -H "Content-Type: application/json" \
  -H "x-auth-token: YOUR_TOKEN" \
  -d '{
    "phone": "380662094811",
    "bot_id": 69,
    "template_id": 1
  }'
```

---

## Response Format

### 200 - Success

Request successfully processed, broadcast should go through.

**Example response:**

```json
{
  "status": "success",
  "message": "Broadcast scheduled"
}
```

### 404 - Not Found

User not found or broadcast template doesn't exist.

**Example response:**

```json
{
  "status": "error",
  "message": "User not found or template does not exist"
}
```

### 422 - Validation Error

Invalid token or some data in the request body is incorrect.

**Example response:**

```json
{
  "status": "error",
  "message": "Invalid token or request data"
}
```

---

## Limitations

- Phone number must be in international format (without `+` sign)
- `bot_id` must match an existing bot
- `template_id` must match an existing broadcast template
- User must be registered in the system and have subscription to notifications

---

## Related Articles

- [Subscribe user to notifications](/en/integrations/how-to/data-transfer/subscribe-user-to-notifications.md)
- [What are integrations](/en/integrations/explanation/what-are-integrations.md)

