> For the complete documentation index, see [llms.txt](https://developer.9bits.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.9bits.net/messaging/a2p-sms/rest-api/batches.md).

# Batches

Batches are sets of SMS messages. You can send a single message or many. Batches are queued and sent at the rate limit in FIFO (first-in-first-out) order.

## Send

The first step is to set a webhook URL at Webhook tab under Settings, to ensure receipt of all DLRs (delivery reports).&#x20;

Depending on the length of the body, one message might be split into multiple parts and charged accordingly.

<mark style="color:green;">`POST`</mark> `https://app.9bits.net:2096/ng/v1/sendsms`

#### Headers

| Name                                            | Type                        | Description |
| ----------------------------------------------- | --------------------------- | ----------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer \<YOUR\_TOKEN\_HERE> |             |
| Content-Type<mark style="color:red;">\*</mark>  | application/json            |             |

#### Request Body

| Key                                    | Value                               | Description |
| -------------------------------------- | ----------------------------------- | ----------- |
| from<mark style="color:red;">\*</mark> | myCode                              |             |
| body<mark style="color:red;">\*</mark> | Hello Buddy. Let's go!              |             |
| to<mark style="color:red;">\*</mark>   | \["2348020000000", 23480300000000"] |             |

<pre class="language-python" data-title="Request sample"><code class="lang-python"><strong>
</strong><strong>import requests
</strong>
url = "https://app.9bits.net:2096/ng/v1/sendsms"

payload = {
  "from": "Your_sender_ID",
  "to": [
    "Recipient_number"
  ],
  "content": "Your_message"
}

headers = {
  "Content-Type": "application/json",
  "Authorization": "Bearer &#x3C;YOUR_TOKEN_HERE>"
}

response = requests.post(url, json=payload, headers=headers)

data = response.json()
print(data)
</code></pre>

{% code title="Response sample" %}

```python

{
    "reference_id": "fdab8f46df049e58b0af7c2d7,
    "status": "accepted",
    "accepted_at": "2026-01-01T18:48:14+01:00",
    "recipients_accepted": 2,
    "status_url": "/ng/v1/sendsms/status/ + refID"
}
```

{% endcode %}

REQUEST AND RESPONSE BODY SCHEMA: application/json

<mark style="color:green;">body</mark> <mark style="color:red;">(required)</mark>        The message content.

<mark style="color:green;">to</mark> <mark style="color:red;">(required)</mark>             List of Phone numbers and group IDs that will receive the batch.

<mark style="color:green;">from</mark> <mark style="color:red;">(required)</mark>        Sender number. Must be an alphanumeric ID that was registered on the web portal.

<mark style="color:green;">delivery\_report</mark>        Default: "none". Request delivery report callback. Note that delivery reports can be fetched  from the API regardless of this setting.

|      | Description                                                                                                                                                                        |
| ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| none | No delivery report callback will be sent                                                                                                                                           |
| yes  | A delivery report callback will be sent for each status change of a message. These delivery reports also include a timestamp of when the Delivery Report originated from the SMSC. |

<mark style="color:green;">send\_at</mark>                   If set in the future, the message will be delayed until `send_at` occurs. If set in the past, messages will be sent immediately.

<mark style="color:green;">reference\_id</mark>          A unique reference for each transaction.

<mark style="color:green;">created\_at</mark>            Timestamp for when batch was created.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.9bits.net/messaging/a2p-sms/rest-api/batches.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
