# A2P Messaging API quickstart

Send your first SMS over the A2P Messaging API in under five minutes. Grab a token, fire one HTTP request, and point a webhook at the DLR URL to see delivery.

**Language:** en
**Audience:** developer
**TLDR:** Send an SMS with POST https://api.instasent.com/transactional/v1/sms, header Authorization: Bearer <api_sms token>, and a JSON body containing from, to, and text. The response returns an id; point your DLR webhook at it to track delivery.
**Docs index (every page):** https://docs.instasent.com/llms.txt
**This zone's index:** https://docs.instasent.com/a2p-messaging-api/llms-full.txt
**This page:** https://docs.instasent.com/a2p-messaging-api/http/quickstart/ (HTML) · https://docs.instasent.com/a2p-messaging-api/http/quickstart.md (Markdown)

The A2P Messaging API over HTTP needs three things: an account, an `api_sms` token and one POST request. This walkthrough takes you from zero to a delivered message. If you already know you need high throughput or API-driven campaigns, jump straight to [Bulk sending](/a2p-messaging-api/http/bulk) — same token, one call, up to 100 messages per request.

#### 1. Create an Instasent account

Sign up at [dashboard.instasent.com/a2p](https://dashboard.instasent.com/a2p) and complete onboarding:
**Messaging API** comes preselected as what you will use Instasent for.

#### 2. Create a token

Your A2P Messaging API project already comes with an API key named
**Onboarding** for the first send: copy it from the project home. To create
more, select **API tokens** in the project's sidebar and click **Create API
token**. Treat the token as a secret: never commit it to version control.

#### 3. Send your first message

#### curl

```bash
curl -X POST https://api.instasent.com/transactional/v1/sms \
  -H "Authorization: Bearer $INSTASENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "Instasent",
    "to": "+34600000000",
    "text": "Hello from Instasent"
  }'
```

#### node

```js
const res = await fetch("https://api.instasent.com/transactional/v1/sms", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.INSTASENT_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    from: "Instasent",
    to: "+34600000000",
    text: "Hello from Instasent",
  }),
});
const sms = await res.json();
```

#### python

```python
import os, requests

res = requests.post(
    "https://api.instasent.com/transactional/v1/sms",
    headers={"Authorization": f"Bearer {os.environ['INSTASENT_TOKEN']}"},
    json={
        "from": "Instasent",
        "to": "+34600000000",
        "text": "Hello from Instasent",
    },
)
sms = res.json()
```

#### 4. Check delivery

The response contains an `id`. Point your webhook endpoint at the DLR URL
in your project settings — Instasent will `POST` delivery updates as the
message progresses through the carrier network. See
[Receiving DLRs](/a2p-messaging-api/http/dlrs) for payload details.

## Sending many messages at once

For API-driven campaigns, notification fan-outs or any high-volume dispatch, switch from `POST /sms` to `POST /sms/bulk` — a single call that carries up to 100 messages, returns accepted and rejected items side by side, and queues the accepted ones on the platform for fastest-possible dispatch. The same `api_sms` token works.

```bash
curl -X POST https://api.instasent.com/transactional/v1/sms/bulk \
  -H "Authorization: Bearer $INSTASENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '[
    { "from": "Instasent", "to": "+34600000001", "text": "Hello one" },
    { "from": "Instasent", "to": "+34600000002", "text": "Hello two" }
  ]'
```

Full request and response shape, per-request limits, throughput model and partial-success handling live in [Bulk sending](/a2p-messaging-api/http/bulk).

> **Note**: **About that `from`.** It has to be a sender registered in your account (SMS >
> Senders): one that matches none is refused with `422` on `from`, and nothing is sent or
> charged. Only wholesale providers who have requested the wildcard route can send an
> unregistered `from`. Some countries also require the sender to be registered with the
> regulator, and your account may restrict its destination countries (`422` on `to`).
> Before you route real traffic, read
> [SMS senders](/a2p-messaging-api/channels/sms/senders).

## What's next

- **[SMS senders](/a2p-messaging-api/channels/sms/senders)** — why the `from` must be a registered sender, per-country registration, and what is billed when a message is blocked.
- **[Destination countries & SMS pumping](/a2p-messaging-api/channels/sms/destination-countries)** — the allowed and blocked country lists, and the `422` on `to`.
- **[Wildcard route](/a2p-messaging-api/channels/sms/wildcard-route)** — for wholesale providers carrying transit traffic: how to request it.
- **[Bulk sending](/a2p-messaging-api/http/bulk)** — `POST /sms/bulk`, 100 messages per request, queue-based throughput. The endpoint to use for campaigns.
- **[Authentication](/a2p-messaging-api/http/authentication)** — token scopes, rotation, header vs. query-string.
- **[Rate limits](/a2p-messaging-api/http/rate-limits)** — per-endpoint limits and how to read the `X-RateLimit-*` headers. One bulk call counts as one request against the window.
- **[Errors](/a2p-messaging-api/http/errors)** — status codes, error payload shape, retry guidance.
- **[Receiving DLRs](/a2p-messaging-api/http/dlrs)** — webhook payload and status list.
- **[SMS traffic metrics](/a2p-messaging-api/http/metrics)** — `GET /sms/metrics`: volume, delivery outcomes and cost per UTC day or month, by country, network and token.
- **[Reference](/a2p-messaging-api/http/reference)** — every endpoint, every parameter.

---

This is one page of the Instasent documentation. For the complete machine-readable index of every guide and API reference, fetch https://docs.instasent.com/llms.txt — start there for full context.
