Developers
Build on SMSBlast
The SMSBlast API lets your own software do what the dashboard does: keep contacts and their consent, send one-to-one texts and campaigns, run automatic workflows, answer people in the inbox, and hear about replies, deliveries and opt-outs through webhooks.
https://app.smsblast.netA REST API over HTTPS with JSON bodies. Every path starts with /v1. Version 1.0.0, described in OpenAPI 3.1.0.
Quickstart: your first text in three steps#
-
Create an API key
In the dashboard, open Settings → Developers and choose Create API key. Only the account owner or an admin can create keys. The key starts with
sb_and is shown once, so copy it straight into your server's configuration. Never put it in a web page or an app.Shellexport SMSBLAST_API_KEY="sb_..."Check that it works by fetching your account:
curl https://app.smsblast.net/v1/account \ -H "Authorization: Bearer $SMSBLAST_API_KEY"const res = await fetch('https://app.smsblast.net/v1/account', { headers: { Authorization: `Bearer ${process.env.SMSBLAST_API_KEY}`, }, }); console.log(res.status, await res.json());import os import requests res = requests.get( "https://app.smsblast.net/v1/account", headers={ "Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}", }, ) print(res.status_code, res.json()) -
Add a contact, with their consent
Texts only go to contacts who agreed to get them. Add the person with
POST /v1/contactsand confirm their consent withconsent.attested: true; say where they agreed inconsent.source. It is kept as their opt-in record, and they are subscribed at once.curl -X POST https://app.smsblast.net/v1/contacts \ -H "Authorization: Bearer $SMSBLAST_API_KEY" \ -H "Idempotency-Key: $(openssl rand -hex 16)" \ -H "Content-Type: application/json" \ -d '{ "phone": "+14155550101", "firstName": "Alice", "consent": { "attested": true, "source": "Website signup form" } }'const res = await fetch('https://app.smsblast.net/v1/contacts', { method: 'POST', headers: { Authorization: `Bearer ${process.env.SMSBLAST_API_KEY}`, 'Idempotency-Key': crypto.randomUUID(), 'Content-Type': 'application/json', }, body: JSON.stringify({ phone: '+14155550101', firstName: 'Alice', consent: { attested: true, source: 'Website signup form', }, }), }); console.log(res.status, await res.json());import os import uuid import requests res = requests.post( "https://app.smsblast.net/v1/contacts", headers={ "Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}", "Idempotency-Key": str(uuid.uuid4()), }, json={ "phone": "+14155550101", "firstName": "Alice", "consent": { "attested": True, "source": "Website signup form", }, }, ) print(res.status_code, res.json()) -
Send a text
Send it with
POST /v1/messages. TheIdempotency-Keymeans a retried request can never send the text twice.curl -X POST https://app.smsblast.net/v1/messages \ -H "Authorization: Bearer $SMSBLAST_API_KEY" \ -H "Idempotency-Key: $(openssl rand -hex 16)" \ -H "Content-Type: application/json" \ -d '{ "to": "+14155550101", "body": "Hi Alice, thanks for signing up for texts from Corner Bakery! Reply STOP to opt out." }'const res = await fetch('https://app.smsblast.net/v1/messages', { method: 'POST', headers: { Authorization: `Bearer ${process.env.SMSBLAST_API_KEY}`, 'Idempotency-Key': crypto.randomUUID(), 'Content-Type': 'application/json', }, body: JSON.stringify({ to: '+14155550101', body: 'Hi Alice, thanks for signing up for texts from Corner Bakery! Reply STOP to opt out.', }), }); console.log(res.status, await res.json());import os import uuid import requests res = requests.post( "https://app.smsblast.net/v1/messages", headers={ "Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}", "Idempotency-Key": str(uuid.uuid4()), }, json={ "to": "+14155550101", "body": "Hi Alice, thanks for signing up for texts from Corner Bakery! Reply STOP to opt out.", }, ) print(res.status_code, res.json())The answer is the text with status
queued; it usually goes out within seconds. Follow it withGET /v1/messages/{id}or themessage.deliveredandmessage.failedwebhooks.
no_active_number (409) or trial_ended (402). See Errors.Guides#
API reference#
Every endpoint, with its parameters, fields, errors and samples in curl, Node.js and Python.
Conventions#
JSON. Send request bodies as JSON objects with Content-Type: application/json; answers are JSON (except the CSV export). Times are ISO 8601 in UTC, such as 2026-11-20T17:02:11.482Z. Phone numbers are US and Canada numbers: send them in any common format, they come back in E.164 (+14155550101). Field names are shown exactly as the API returns them: contacts, lists, segments, campaigns, conversations, keywords, imports and the account are snake_case; messages, webhooks and workflows are camelCase.
Texting rules. Texts only go to subscribed contacts. Sending needs an approved (active) sending number and, once the 14-day free trial is over, a paid plan. Credits are taken when the text is queued: 1 per SMS segment (160 plain characters, or 153 per segment once a text is split; 70 and 67 when it contains an emoji or another character outside GSM-7), or 3 for a picture message. A text that cannot be sent, or is skipped because the person opted out first, gets its credits back. STOP, HELP and START are handled for you, and anyone who opts out is never texted again until they opt back in themselves. Campaign and workflow texts wait for 8am to 9pm in each recipient's time zone.
Code samples read your key from the SMSBLAST_API_KEY environment variable. The Node.js samples use the built-in fetch with top-level await (Node 20 or later, in an .mjs file); the Python samples use requests.