# Send a broadcast

> Sends one text to up to 500 people: contacts with any of tags, the contacts in contact_ids, or a list in recipients (people who aren’t contacts yet are added).

`POST /v1/broadcasts`

Sends one text to up to 500 people: contacts with any of `tags`, the contacts in `contact_ids`, or a list in `recipients` (people who aren’t contacts yet are added). Each person’s `{{variables}}` are filled in from their contact and their row.

Texts go through your sending rules like any other: your pace, quiet hours, the daily limit for new people and BlueBot’s daily limit. BlueBot feeds them into the queue a few at a time, so a long broadcast never sits in the queue long enough to expire. People on your stop list are skipped. `estimate` says when the last text should go.

Only send to people who asked to hear from you.

Needs a key with the `messages:send` scope. [Keys and scopes](https://usebluebot.com/docs/concepts/api-keys)

Send an `Idempotency-Key` so a retry never acts twice. [Idempotency](https://usebluebot.com/docs/concepts/idempotency)

## Headers

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | string | No | Any string of up to 255 characters, new for each request. A retry with the same key gets the first answer back for 24 hours, with `Idempotent-Replayed: true`. Up to 255 characters |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | Yes | Up to 120 characters |
| `text` | string | No | The words. `{{first_name}}`, `{{first_name\|there}}` and any variable your list brings are filled in for each person. Up to 2,000 characters |
| `template_id` | string | No | A saved template to use instead of `text`. Starts with `tpl_` |
| `tags` | array of strings | No | Send to your contacts with any of these tags. Up to 20 items |
| `contact_ids` | array of strings | No | Send to these contacts. Up to 500 items |
| `recipients` | array of object | No | Send to these people, adding any who aren’t contacts yet, each with their own variables. Up to 500 items |
| `recipients[].to` | string | Yes | A phone number (US numbers may leave off +1; `(555) 555-0123` works) or an email address an Apple ID uses. 3 to 320 characters |
| `recipients[].first_name` | string | No | Up to 100 characters |
| `recipients[].last_name` | string | No | Up to 100 characters |
| `recipients[].variables` | map of string | No | Values for this person’s `{{variables}}`. |
| `service` | string | No | One of `auto`, `imessage`, `sms`. Default `"auto"` |
| `send_at` | timestamp | No | Start later. Leave it out to start now. |

## Example

```bash
curl -X POST "https://usebluebot.com/api/v1/broadcasts" \
  -H "Authorization: Bearer $BLUEBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 0f6d8c2e-5b1a-4c7e-9d3f-2a8b6e1c4d70" \
  -d '{
    "name": "Open house Saturday",
    "text": "Hi {{first_name|there}}, open house at 412 Oak St this Saturday 1–4. Reply STOP to opt out.",
    "tags": [
      "buyer"
    ],
    "send_at": "2026-11-14T15:00:00.000Z"
  }'
```

```ts
import BlueBot from '@usebluebot/sdk';

const client = new BlueBot({ apiKey: process.env.BLUEBOT_API_KEY });

const broadcast = await client.broadcasts.create({
  name: 'Open house Saturday',
  text: 'Hi {{first_name|there}}, open house at 412 Oak St this Saturday 1–4. Reply STOP to opt out.',
  tags: ['buyer'],
  sendAt: '2026-11-14T15:00:00.000Z',
}, { idempotencyKey: '0f6d8c2e-5b1a-4c7e-9d3f-2a8b6e1c4d70' });
console.log(broadcast);
```

```python
import os
from bluebot import BlueBot

client = BlueBot(api_key=os.environ["BLUEBOT_API_KEY"])

broadcast = client.broadcasts.create(
    name="Open house Saturday",
    text="Hi {{first_name|there}}, open house at 412 Oak St this Saturday 1–4. Reply STOP to opt out.",
    tags=["buyer"],
    send_at="2026-11-14T15:00:00.000Z",
    idempotency_key="0f6d8c2e-5b1a-4c7e-9d3f-2a8b6e1c4d70",
)
print(broadcast)
```

## Response

`201`: The broadcast, started or scheduled.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | A bc_ id. Starts with `bc_` |
| `object` | "broadcast" | Yes |   |
| `name` | string | Yes |   |
| `text` | string or null | Yes | The words, with `{{variables}}`, as you wrote them. Each person’s filled-in text is on their message. Null once they’re deleted, 30 days after the broadcast finished. |
| `text_deleted` | boolean | Yes | True once the words, and the values each person’s list row brought, were deleted 30 days after the broadcast finished. |
| `template_id` | string or null | Yes | The template the words came from, when one did. |
| `audience` | any | Yes | Who the broadcast goes to. |
| `service` | string | Yes | One of `auto`, `imessage`, `sms` |
| `state` | string | Yes | `draft`, `scheduled` (waiting for `send_at`), `sending`, `completed` or `canceled`. One of `draft`, `scheduled`, `sending`, `completed`, `canceled` |
| `send_at` | timestamp or null | Yes | When it starts, for a scheduled broadcast. |
| `started_at` | timestamp or null | Yes | When the first text was queued. |
| `completed_at` | timestamp or null | Yes | When every text had settled. |
| `canceled_at` | timestamp or null | Yes | When the rest was canceled. |
| `recipient_count` | integer | Yes | How many people it goes to, up to 500. |
| `counts` | map of integer | Yes | How many recipients are in each state: `pending`, `queued`, `sent`, `delivered`, `read`, `failed`, `skipped` and so on. |
| `estimate` | BroadcastEstimate or null | Yes | For a scheduled or sending broadcast, when the rest should go. Worked out on `GET /v1/broadcasts/{id}` and when it is made; null in lists. |
| `estimate.first_at` | timestamp or null | Yes | When the first text should go. |
| `estimate.last_at` | timestamp or null | Yes | When the last text should go, given your pace, quiet hours and daily limits. |
| `estimate.days` | integer | Yes | How many days the sending spans in your time zone. |
| `estimate.waits_for` | array of strings | Yes | Holds the texts will meet on the way: `quiet_hours`, `daily_new_people_limit`, `platform_daily_limit`. |
| `estimate.blocked_by` | string or null | Yes | A hold with no end that stops the broadcast from going, such as `plan_lapsed`. |
| `estimate.mac_online` | boolean | Yes | Whether your Mac is online now. The estimate assumes it stays on. |
| `created_via` | string | Yes | One of `dashboard`, `api`, `assistant`, `mcp`, `zapier`, `cli` |
| `created_at` | timestamp | Yes | When it was made. |

The answer, `201`:

```json
{
  "id": "bc_1Hq2LxW9cVbN3mKpRtYs0a",
  "object": "broadcast",
  "name": "Open house Saturday",
  "text": "Hi {{first_name|there}}, open house at 412 Oak St this Saturday 1–4. Reply STOP to opt out.",
  "text_deleted": false,
  "template_id": null,
  "audience": {
    "kind": "tags",
    "tags": [
      "buyer"
    ]
  },
  "service": "auto",
  "state": "scheduled",
  "send_at": "2026-11-14T15:00:00.000Z",
  "started_at": null,
  "completed_at": null,
  "canceled_at": null,
  "recipient_count": 42,
  "counts": {
    "pending": 41,
    "skipped": 1
  },
  "estimate": {
    "first_at": "2026-11-14T15:00:00.000Z",
    "last_at": "2026-11-14T15:14:20.000Z",
    "days": 1,
    "waits_for": [],
    "blocked_by": null,
    "mac_online": true
  },
  "created_via": "api",
  "created_at": "2026-11-13T19:41:00.000Z"
}
```

## Errors

Every refusal has the same envelope and a page of its own. These are the ones this operation can give.

| Code                                                        | Status | What it means                                                                                                                                    |
| ----------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| [`unauthorized`](https://usebluebot.com/docs/errors/unauthorized)                 | 401    | The request carried no key, or a key BlueBot doesn’t know: mistyped, revoked, or a test key sent to the live API.                                |
| [`insufficient_scope`](https://usebluebot.com/docs/errors/insufficient_scope)     | 403    | The key doesn’t carry the scope the endpoint needs. Each endpoint’s reference names its scope.                                                   |
| [`rate_limited`](https://usebluebot.com/docs/errors/rate_limited)                 | 429    | Too many requests. A key may make 120 requests a minute. The `RateLimit` header says how many are left, and `Retry-After` how long to wait.      |
| [`internal`](https://usebluebot.com/docs/errors/internal)                         | 500    | Something went wrong on BlueBot’s side. It was reported. Send the request again; with an Idempotency-Key that is always safe.                    |
| [`invalid_request`](https://usebluebot.com/docs/errors/invalid_request)           | 400    | Something in the request doesn’t fit: a missing or malformed field, a bad id, or a combination the endpoint refuses. `details` names each field. |
| [`not_found`](https://usebluebot.com/docs/errors/not_found)                       | 404    | There is no such thing on this account. Ids are prefixed by kind, so a message id starts with `msg_`.                                            |
| [`limit_reached`](https://usebluebot.com/docs/errors/limit_reached)               | 409    | The account has as many of something as it may have.                                                                                             |
| [`plan_lapsed`](https://usebluebot.com/docs/errors/plan_lapsed)                   | 402    | The account’s plan isn’t active, so BlueBot isn’t taking new texts. Texts already queued wait and go once the plan is active again.              |
| [`idempotency_conflict`](https://usebluebot.com/docs/errors/idempotency_conflict) | 409    | The Idempotency-Key was used in the last 24 hours with a different request. A key stands for one request.                                        |

## Try it
