Guide
Compliance
SMSBlast enforces the texting rules for you. Here is what that means for your code.
Texts only go to subscribed contacts#
- Every text goes to a contact who is subscribed.
POST /v1/messagesto anyone else is refused:not_a_contactfor a number that is not a contact,unsubscribedfor someone who opted out (both409). - Campaigns and workflows skip anyone who is not subscribed.
- A text already queued for someone who then opts out is not sent: it becomes
skippedand its credits come back.
Consent is required to add contacts#
POST /v1/contactsand imports (POST /v1/contacts/import,POST /v1/imports) needconsent.attested: true: your confirmation that the people agreed to get your texts. Without it the request is refused withconsent_required.- Say where they agreed in
consent.source, such as “Checkout opt-in box”. It is kept with the contact as their opt-in record, next to every later opt-out; read it withGET /v1/contacts/{id}/consent. - People who text one of your signup keywords or fill in a signup form opt in themselves, and that is recorded for you.
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": "Checkout opt-in box"
}
}'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: 'Checkout opt-in box',
},
}),
});
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": "Checkout opt-in box",
},
},
)
print(res.status_code, res.json())STOP, HELP and START are handled for you#
- STOP, and the other opt-out words (STOPALL, UNSUBSCRIBE, CANCEL, END, QUIT, REVOKE, OPT OUT), unsubscribe the person at once.
- HELP (or INFO) gets an automatic answer with your business name and your support contact from your account settings.
- START (or UNSTOP, YES) brings back someone who opted out by text.
- A text that mentions stopping without being one of these words, such as “please remove me”, is not acted on automatically. It is flagged for a person to read:
GET /v1/messages/inbound?review=true. - These words cannot be used as signup keywords. Every incoming text, these included, is sent to the
message.receivedwebhook.
Opt-outs last until the person opts back in#
- Nobody who opted out can be resubscribed by you: not with the API, an import or the dashboard. Only their own action brings them back: texting START or a signup keyword, or filling in one of your signup forms.
- Importing a list never resubscribes anyone. A STOP from a number that is not a contact yet is remembered, so a later import cannot text them either.
- You can unsubscribe people yourself, for example with
POST /v1/contacts/bulkand theunsubscribeaction. - Listen for
contact.opted_outto keep your own systems in step.
Quiet hours#
- Campaign and workflow texts only go out between 8am and 9pm in each recipient's time zone (the contact's
timezone, or your account's when it is not known). Outside those hours they wait for the next 8am there. - Texts sent with
POST /v1/messagesgo out at any hour, because they are usually answers to something the person did. SendrespectQuietHours: trueto hold one until 8am to 9pm in the contact's time zone; do that for anything that is not an answer.
Your part#
- Only add people who agreed to get your texts, and record where they agreed.
- Say who you are and how to stop in your texts, for example “Reply STOP to opt out.”
- For the full picture, read the SMS compliance guide.