API reference
Contacts
The people you text, and your proof that they agreed to it. Every contact is added with your confirmation of consent (consent.attested: true), kept with the contact as an opt-in record alongside every later opt-out. A contact is subscribed or unsubscribed; only subscribed contacts are texted, and nobody who opted out is ever resubscribed by you: only by texting START or a signup keyword from their own phone.
Add people one at a time (POST /v1/contacts), up to 50,000 at once (POST /v1/contacts/import), or from a large file in batches with an import job (/v1/imports).
- GET
/v1/contactsList contacts - POST
/v1/contactsAdd a contact - GET
/v1/contacts/{id}Get a contact - PATCH
/v1/contacts/{id}Update a contact - GET
/v1/contacts/{id}/consentGet consent history - POST
/v1/contacts/importImport contacts - POST
/v1/contacts/bulkAct on many contacts - GET
/v1/contacts/export.csvExport contacts as CSV - GET
/v1/importsList import jobs - POST
/v1/importsStart an import job - GET
/v1/imports/{id}Get an import job - POST
/v1/imports/{id}/rowsSend a batch of rows - POST
/v1/imports/{id}/finishFinish an import job
List contacts
/v1/contactsYour contacts, a page at a time, with counts. Filter by status, a search, a list or a segment; page with limit and offset (matching says how many there are in all).
Search matches first name, last name, full name and email (ignoring case, part of a word is enough), and phone numbers when it has 3 or more digits.
Request
curl https://app.smsblast.net/v1/contacts \
-H "Authorization: Bearer $SMSBLAST_API_KEY"const res = await fetch('https://app.smsblast.net/v1/contacts', {
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/contacts",
headers={
"Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
},
)
print(res.status_code, res.json()){
"contacts": [
{
"id": "0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60",
"phone": "+14155550101",
"first_name": "Alice",
"last_name": "Moreno",
"email": "alice@example.com",
"timezone": "America/Los_Angeles",
"status": "subscribed",
"source": "import",
"fields": {
"favorite_bread": "Sourdough",
"store": "Mission St"
},
"created_at": "2026-11-02T18:24:09.311Z"
},
{
"id": "7c4e1b9d-2a3f-4c5e-8d6b-9f0a1e2d3c71",
"phone": "+14155550102",
"first_name": "Ben",
"last_name": "Carter",
"email": null,
"timezone": null,
"status": "unsubscribed",
"source": "keyword:JOIN",
"fields": {},
"created_at": "2026-11-09T21:40:52.007Z"
}
],
"total": 1873,
"matching": 2,
"subscribed": 1802,
"unsubscribed": 71
}Needs an API key: Authorization: Bearer sb_... Authentication
Query parameters#
statusstringOnly subscribed or unsubscribed contacts. Other values are ignored.
searchstringText to look for in names, email and (3 or more digits) phone numbers.
listIdstringuuidOnly contacts on this list.
notListIdstringuuidOnly contacts that are not on this list (for example, to pick people to add to it).
segmentIdstringuuidOnly contacts in this segment.
sortstringSort by when they were added, or by name. Empty names sort last.
dirstringSort direction. Default desc (newest first).
limitintegerHow many to return, 1 to 500. Default 50.
offsetintegerHow many to skip, for paging. Default 0.
Responses#
One page of contacts.
application/json
contactsarray of objectsrequiredThis page of contacts.
Fields of each item
idstringuuidrequiredThe contact id.
phonestringrequiredMobile number in E.164 format, such as +14155550101. There is one contact per number in an account.
first_namestringnullablerequiredFirst name. Used by the {first_name} personalisation tag.
last_namestringnullablerequiredLast name. Used by the {last_name} personalisation tag.
emailstringnullablerequiredEmail address, lower case.
timezonestringnullablerequiredIANA time zone such as America/Chicago. Campaign and workflow texts wait for 8am to 9pm in this time zone; when it is empty, the account time zone is used.
statusstringrequiredsubscribed people can be texted. unsubscribed people opted out (by texting STOP or similar, or by being unsubscribed by you) and get nothing until they opt back in themselves.
sourcestringnullablerequiredHow the contact first got onto your list: import (an import or POST /v1/contacts/import), manual (POST /v1/contacts, or added by hand in the dashboard), keyword:JOIN (texted that signup keyword), form:Website footer (signed up with that signup form, by its name) or sms (first heard from when they texted STOP).
fieldsobjectrequiredCustom fields, as text: up to 30 per contact, names up to 60 characters, values up to 500. Segments can filter on them.
created_atstringdate-timerequiredWhen the contact was added.
totalintegerrequiredAll contacts in the account.
matchingintegerrequiredContacts matching the filters (status, search, list, segment), across all pages.
subscribedintegerrequiredSubscribed contacts in the account.
unsubscribedintegerrequiredUnsubscribed contacts in the account.
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
No API key, or one that is not valid or has been revoked (unauthorized).
Something the request names does not exist in your account. error.code is one of:
not_found: The segment insegmentIddoes not exist.
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.
Add a contact
/v1/contactsAdds one person who has agreed to get your texts. You must confirm their consent with consent.attested: true; that confirmation, its source and the time are kept as their opt-in record (see GET /v1/contacts/{id}/consent). The contact is subscribed at once.
A number that is already a contact is merged, not refused: each detail you send replaces the one on file, blanks keep what is there, fields are added to theirs, and with listId they are put on that list. The answer is then 200 with merged: true. Merging records no new opt-in, and someone who opted out stays opted out; only they can opt back in, by texting START or a signup keyword.
A new contact sends the contact.created and contact.opted_in webhooks and starts any workflow triggered by a new subscriber. Being put on the list in listId (new or merged) starts any workflow triggered by that list.
Request
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": "(415) 555-0101",
"firstName": "Alice",
"lastName": "Moreno",
"email": "alice@example.com",
"timezone": "America/Los_Angeles",
"fields": {
"favorite_bread": "Sourdough"
},
"consent": {
"attested": true,
"source": "Website signup form"
},
"listId": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"
}'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: '(415) 555-0101',
firstName: 'Alice',
lastName: 'Moreno',
email: 'alice@example.com',
timezone: 'America/Los_Angeles',
fields: {
favorite_bread: 'Sourdough',
},
consent: {
attested: true,
source: 'Website signup form',
},
listId: 'e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30',
}),
});
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": "(415) 555-0101",
"firstName": "Alice",
"lastName": "Moreno",
"email": "alice@example.com",
"timezone": "America/Los_Angeles",
"fields": {
"favorite_bread": "Sourdough",
},
"consent": {
"attested": True,
"source": "Website signup form",
},
"listId": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30",
},
)
print(res.status_code, res.json()){
"contact": {
"id": "0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60",
"phone": "+14155550101",
"first_name": "Alice",
"last_name": "Moreno",
"email": "alice@example.com",
"timezone": "America/Los_Angeles",
"status": "subscribed",
"source": "import",
"fields": {
"favorite_bread": "Sourdough"
},
"created_at": "2026-11-02T18:24:09.311Z"
},
"merged": true,
"addedToList": true
}{
"contact": {
"id": "0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60",
"phone": "+14155550101",
"first_name": "Alice",
"last_name": "Moreno",
"email": "alice@example.com",
"timezone": "America/Los_Angeles",
"status": "subscribed",
"source": "api",
"fields": {
"favorite_bread": "Sourdough"
},
"created_at": "2026-11-02T18:24:09.311Z"
},
"merged": false,
"addedToList": true
}Needs an API key: Authorization: Bearer sb_... Authentication
Headers#
Any unique string up to 200 characters (a UUID works well). If a POST times out or you are not sure it went through, send it again with the same key and the same body: you get the first answer back (with Idempotent-Replayed: true) instead of the work being done twice. Keys are kept for 24 hours per account.
Request body#
application/json · required
phonestringrequiredA US or Canada mobile number in any common format (+14155550101, (415) 555-0101, 415-555-0101). Stored and returned in E.164 (+14155550101).
firstNamestringFirst name, up to 120 characters.
lastNamestringLast name, up to 120 characters.
emailstringEmail address. One that does not look like an email address is left out (stored as empty).
timezonestringIANA time zone such as America/Chicago. One we do not recognise is left out.
fieldsobjectCustom fields. Values are stored as text; empty values are left out. Up to 30 fields, names up to 60 characters, values up to 500.
consentobjectrequiredYour confirmation that the people agreed to get your texts. It is kept as their opt-in record.
Child fields
attestedbooleanrequiredMust be true: you confirm these people agreed to receive your texts. Anything else is refused with consent_required.
sourcestringWhere they agreed, such as Checkout opt-in box or Website signup form, up to 120 characters. Stored with each new contact's opt-in record.
detailstringAny further detail about the consent, up to 300 characters. Imports only; POST /v1/contacts records "Added by hand".
listIdstringuuidAlso put the contact on this list.
Example request body
{
"phone": "(415) 555-0101",
"firstName": "Alice",
"lastName": "Moreno",
"email": "alice@example.com",
"timezone": "America/Los_Angeles",
"fields": {
"favorite_bread": "Sourdough"
},
"consent": {
"attested": true,
"source": "Website signup form"
},
"listId": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"
}Responses#
The number was already a contact: the details sent were merged into it. merged is true.
application/json
contactobjectrequiredA person on your contact list. Field names are snake_case.
Child fields
idstringuuidrequiredThe contact id.
phonestringrequiredMobile number in E.164 format, such as +14155550101. There is one contact per number in an account.
first_namestringnullablerequiredFirst name. Used by the {first_name} personalisation tag.
last_namestringnullablerequiredLast name. Used by the {last_name} personalisation tag.
emailstringnullablerequiredEmail address, lower case.
timezonestringnullablerequiredIANA time zone such as America/Chicago. Campaign and workflow texts wait for 8am to 9pm in this time zone; when it is empty, the account time zone is used.
statusstringrequiredsubscribed people can be texted. unsubscribed people opted out (by texting STOP or similar, or by being unsubscribed by you) and get nothing until they opt back in themselves.
sourcestringnullablerequiredHow the contact first got onto your list: import (an import or POST /v1/contacts/import), manual (POST /v1/contacts, or added by hand in the dashboard), keyword:JOIN (texted that signup keyword), form:Website footer (signed up with that signup form, by its name) or sms (first heard from when they texted STOP).
fieldsobjectrequiredCustom fields, as text: up to 30 per contact, names up to 60 characters, values up to 500. Segments can filter on them.
created_atstringdate-timerequiredWhen the contact was added.
mergedbooleanrequiredtrue when the number was already a contact and these details were merged into it.
addedToListbooleanrequiredtrue when this request put them on the list in listId (false when there is no listId or they were on it already).
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
true when this is the stored answer to an earlier request with the same Idempotency-Key, not a new one.
The new contact. Its source is api when added with an API key (manual when added by a person in the dashboard).
application/json
contactobjectrequiredA person on your contact list. Field names are snake_case.
Child fields
idstringuuidrequiredThe contact id.
phonestringrequiredMobile number in E.164 format, such as +14155550101. There is one contact per number in an account.
first_namestringnullablerequiredFirst name. Used by the {first_name} personalisation tag.
last_namestringnullablerequiredLast name. Used by the {last_name} personalisation tag.
emailstringnullablerequiredEmail address, lower case.
timezonestringnullablerequiredIANA time zone such as America/Chicago. Campaign and workflow texts wait for 8am to 9pm in this time zone; when it is empty, the account time zone is used.
statusstringrequiredsubscribed people can be texted. unsubscribed people opted out (by texting STOP or similar, or by being unsubscribed by you) and get nothing until they opt back in themselves.
sourcestringnullablerequiredHow the contact first got onto your list: import (an import or POST /v1/contacts/import), manual (POST /v1/contacts, or added by hand in the dashboard), keyword:JOIN (texted that signup keyword), form:Website footer (signed up with that signup form, by its name) or sms (first heard from when they texted STOP).
fieldsobjectrequiredCustom fields, as text: up to 30 per contact, names up to 60 characters, values up to 500. Segments can filter on them.
created_atstringdate-timerequiredWhen the contact was added.
mergedbooleanrequiredtrue when the number was already a contact and these details were merged into it.
addedToListbooleanrequiredtrue when this request put them on the list in listId (false when there is no listId or they were on it already).
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
true when this is the stored answer to an earlier request with the same Idempotency-Key, not a new one.
The request was refused because something in it is not valid. error.code is one of:
invalid_phone:phoneis not a valid US or Canada mobile number.consent_required:consent.attestedis nottrue.invalid_json: The body is not a JSON object.invalid_idempotency_key: The Idempotency-Key header is longer than 200 characters.
No API key, or one that is not valid or has been revoked (unauthorized).
Something the request names does not exist in your account. error.code is one of:
not_found: The list inlistIddoes not exist.
The request clashes with the current state of things. error.code is one of:
idempotency_in_progress: A request with the same Idempotency-Key is still running. Try again in a moment.
This Idempotency-Key was already used for a different request (another path or body) in the last 24 hours (idempotency_key_reused). Use a new key for each new request.
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.
Get a contact
/v1/contacts/{id}One contact, the lists they are on and their full consent history.
Request
curl https://app.smsblast.net/v1/contacts/0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60 \
-H "Authorization: Bearer $SMSBLAST_API_KEY"const res = await fetch('https://app.smsblast.net/v1/contacts/0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60', {
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/contacts/0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60",
headers={
"Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
},
)
print(res.status_code, res.json()){
"contact": {
"id": "0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60",
"phone": "+14155550101",
"first_name": "Alice",
"last_name": "Moreno",
"email": "alice@example.com",
"timezone": "America/Los_Angeles",
"status": "subscribed",
"source": "import",
"fields": {
"favorite_bread": "Sourdough",
"store": "Mission St"
},
"created_at": "2026-11-02T18:24:09.311Z"
},
"lists": [
{
"id": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30",
"name": "Weekend regulars"
}
],
"consent": [
{
"kind": "opt_in",
"source": "Checkout opt-in box",
"detail": "pos-customers.csv (Checkout opt-in box)",
"occurred_at": "2026-11-02T18:24:09.311Z"
}
]
}Needs an API key: Authorization: Bearer sb_... Authentication
Path parameters#
idstringuuidrequiredThe contact id.
Responses#
The contact.
application/json
contactobjectrequiredA person on your contact list. Field names are snake_case.
Child fields
idstringuuidrequiredThe contact id.
phonestringrequiredMobile number in E.164 format, such as +14155550101. There is one contact per number in an account.
first_namestringnullablerequiredFirst name. Used by the {first_name} personalisation tag.
last_namestringnullablerequiredLast name. Used by the {last_name} personalisation tag.
emailstringnullablerequiredEmail address, lower case.
timezonestringnullablerequiredIANA time zone such as America/Chicago. Campaign and workflow texts wait for 8am to 9pm in this time zone; when it is empty, the account time zone is used.
statusstringrequiredsubscribed people can be texted. unsubscribed people opted out (by texting STOP or similar, or by being unsubscribed by you) and get nothing until they opt back in themselves.
sourcestringnullablerequiredHow the contact first got onto your list: import (an import or POST /v1/contacts/import), manual (POST /v1/contacts, or added by hand in the dashboard), keyword:JOIN (texted that signup keyword), form:Website footer (signed up with that signup form, by its name) or sms (first heard from when they texted STOP).
fieldsobjectrequiredCustom fields, as text: up to 30 per contact, names up to 60 characters, values up to 500. Segments can filter on them.
created_atstringdate-timerequiredWhen the contact was added.
listsarray of objectsrequiredThe lists the contact is on, by name.
Fields of each item
idstringuuidrequiredThe list id.
namestringrequiredThe list name.
consentarray of objectsrequiredEvery opt-in and opt-out, oldest first.
Fields of each item
kindstringrequiredWhether they joined or left.
sourcestringrequiredWhere it happened: your consent source for imports and contacts you added (default import or manual), keyword:JOIN for a signup keyword, form:Rk4xT9vQ for a signup form (its publicId), sms:STOP / sms:START (the words they texted, normalised) for opt-outs and opt-ins by text, or manual for someone you unsubscribed.
detailstringnullablerequiredMore about it: the text they sent, the file and consent source of an import, "Added by hand", who unsubscribed them ("Unsubscribed by API" for API keys), or for a signup form a JSON record of the form, the exact consent wording shown, and the IP address, browser and page of the signup.
occurred_atstringdate-timerequiredWhen it happened.
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
No API key, or one that is not valid or has been revoked (unauthorized).
Something the request names does not exist in your account. error.code is one of:
not_found: No contact with that id in your account.
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.
Update a contact
/v1/contacts/{id}Changes a contact's name, email, time zone and custom fields. The phone number cannot be changed, and neither can the status: unsubscribe people with POST /v1/contacts/bulk; only the person can opt back in.
Only the fields you send change; send null or "" to clear one. fields, when sent, replaces all of the contact's custom fields, so send the full set.
Request
curl -X PATCH https://app.smsblast.net/v1/contacts/0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60 \
-H "Authorization: Bearer $SMSBLAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "alice.moreno@example.com",
"fields": {
"favorite_bread": "Rye",
"store": "Mission St"
}
}'const res = await fetch('https://app.smsblast.net/v1/contacts/0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SMSBLAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: 'alice.moreno@example.com',
fields: {
favorite_bread: 'Rye',
store: 'Mission St',
},
}),
});
console.log(res.status, await res.json());import os
import requests
res = requests.patch(
"https://app.smsblast.net/v1/contacts/0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60",
headers={
"Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
},
json={
"email": "alice.moreno@example.com",
"fields": {
"favorite_bread": "Rye",
"store": "Mission St",
},
},
)
print(res.status_code, res.json()){
"contact": {
"id": "0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60",
"phone": "+14155550101",
"first_name": "Alice",
"last_name": "Moreno",
"email": "alice.moreno@example.com",
"timezone": "America/Los_Angeles",
"status": "subscribed",
"source": "import",
"fields": {
"favorite_bread": "Rye",
"store": "Mission St"
},
"created_at": "2026-11-02T18:24:09.311Z"
}
}Needs an API key: Authorization: Bearer sb_... Authentication
Path parameters#
idstringuuidrequiredThe contact id.
Request body#
application/json · required
Only the fields you send change.
firstNamestringnullableFirst name, up to 120 characters. null or "" clears it.
lastNamestringnullableLast name, up to 120 characters. null or "" clears it.
emailstringnullableEmail address. null or "" clears it; so does one that does not look like an email address.
timezonestringnullableIANA time zone. null or "" clears it; one we do not recognise is refused with invalid_timezone.
fieldsobjectCustom fields. When sent, they replace all of the contact's custom fields (send the full set); leave it out to keep them.
Example request body
{
"email": "alice.moreno@example.com",
"fields": {
"favorite_bread": "Rye",
"store": "Mission St"
}
}Responses#
The updated contact.
application/json
contactobjectrequiredA person on your contact list. Field names are snake_case.
Child fields
idstringuuidrequiredThe contact id.
phonestringrequiredMobile number in E.164 format, such as +14155550101. There is one contact per number in an account.
first_namestringnullablerequiredFirst name. Used by the {first_name} personalisation tag.
last_namestringnullablerequiredLast name. Used by the {last_name} personalisation tag.
emailstringnullablerequiredEmail address, lower case.
timezonestringnullablerequiredIANA time zone such as America/Chicago. Campaign and workflow texts wait for 8am to 9pm in this time zone; when it is empty, the account time zone is used.
statusstringrequiredsubscribed people can be texted. unsubscribed people opted out (by texting STOP or similar, or by being unsubscribed by you) and get nothing until they opt back in themselves.
sourcestringnullablerequiredHow the contact first got onto your list: import (an import or POST /v1/contacts/import), manual (POST /v1/contacts, or added by hand in the dashboard), keyword:JOIN (texted that signup keyword), form:Website footer (signed up with that signup form, by its name) or sms (first heard from when they texted STOP).
fieldsobjectrequiredCustom fields, as text: up to 30 per contact, names up to 60 characters, values up to 500. Segments can filter on them.
created_atstringdate-timerequiredWhen the contact was added.
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
The request was refused because something in it is not valid. error.code is one of:
invalid_timezone:timezoneis not one we recognise.invalid_json: The body is not a JSON object.
No API key, or one that is not valid or has been revoked (unauthorized).
Something the request names does not exist in your account. error.code is one of:
not_found: No contact with that id in your account.
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.
Get consent history
/v1/contacts/{id}/consentEvery opt-in and opt-out for one contact, oldest first: your proof of consent. These records are never changed or deleted.
Request
curl https://app.smsblast.net/v1/contacts/0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60/consent \
-H "Authorization: Bearer $SMSBLAST_API_KEY"const res = await fetch('https://app.smsblast.net/v1/contacts/0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60/consent', {
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/contacts/0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60/consent",
headers={
"Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
},
)
print(res.status_code, res.json()){
"events": [
{
"kind": "opt_in",
"source": "keyword:JOIN",
"detail": "join",
"occurred_at": "2026-11-09T21:40:52.007Z"
},
{
"kind": "opt_out",
"source": "sms:STOP",
"detail": "Stop",
"occurred_at": "2026-11-19T23:15:02.660Z"
}
]
}Needs an API key: Authorization: Bearer sb_... Authentication
Path parameters#
idstringuuidrequiredThe contact id.
Responses#
The consent history.
application/json
eventsarray of objectsrequiredOldest first.
Fields of each item
kindstringrequiredWhether they joined or left.
sourcestringrequiredWhere it happened: your consent source for imports and contacts you added (default import or manual), keyword:JOIN for a signup keyword, form:Rk4xT9vQ for a signup form (its publicId), sms:STOP / sms:START (the words they texted, normalised) for opt-outs and opt-ins by text, or manual for someone you unsubscribed.
detailstringnullablerequiredMore about it: the text they sent, the file and consent source of an import, "Added by hand", who unsubscribed them ("Unsubscribed by API" for API keys), or for a signup form a JSON record of the form, the exact consent wording shown, and the IP address, browser and page of the signup.
occurred_atstringdate-timerequiredWhen it happened.
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
No API key, or one that is not valid or has been revoked (unauthorized).
Something the request names does not exist in your account. error.code is one of:
not_found: No contact with that id in your account.
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.
Import contacts
/v1/contacts/importAdds or updates up to 50,000 people in one request. You must confirm they all agreed to get your texts (consent.attested: true); each new contact gets an opt-in record with your consent.source and detail.
Numbers already on file have their details refreshed (only the values you send replace what is there; custom fields are merged). An import never resubscribes anyone who opted out: they are counted in stillUnsubscribed. Rows without a valid number are skipped and listed in invalid; when a number appears twice, the last row wins. With listId, everyone in the batch is also put on that list.
Imports do not send contact.created or contact.opted_in webhooks and do not start workflows. For a large file you want to send in parts with progress, use an import job (POST /v1/imports).
Request
curl -X POST https://app.smsblast.net/v1/contacts/import \
-H "Authorization: Bearer $SMSBLAST_API_KEY" \
-H "Idempotency-Key: $(openssl rand -hex 16)" \
-H "Content-Type: application/json" \
-d '{
"contacts": [
{
"phone": "415-555-0101",
"firstName": "Alice",
"lastName": "Moreno",
"email": "alice@example.com",
"fields": {
"favorite_bread": "Sourdough"
}
},
{
"phone": "(415) 555-0103",
"firstName": "Cara"
},
{
"phone": "555-0199"
}
],
"consent": {
"attested": true,
"source": "Checkout opt-in box",
"detail": "Collected at the till, November 2026"
},
"listId": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"
}'const res = await fetch('https://app.smsblast.net/v1/contacts/import', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SMSBLAST_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
contacts: [
{
phone: '415-555-0101',
firstName: 'Alice',
lastName: 'Moreno',
email: 'alice@example.com',
fields: {
favorite_bread: 'Sourdough',
},
},
{
phone: '(415) 555-0103',
firstName: 'Cara',
},
{
phone: '555-0199',
},
],
consent: {
attested: true,
source: 'Checkout opt-in box',
detail: 'Collected at the till, November 2026',
},
listId: 'e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30',
}),
});
console.log(res.status, await res.json());import os
import uuid
import requests
res = requests.post(
"https://app.smsblast.net/v1/contacts/import",
headers={
"Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"contacts": [
{
"phone": "415-555-0101",
"firstName": "Alice",
"lastName": "Moreno",
"email": "alice@example.com",
"fields": {
"favorite_bread": "Sourdough",
},
},
{
"phone": "(415) 555-0103",
"firstName": "Cara",
},
{
"phone": "555-0199",
},
],
"consent": {
"attested": True,
"source": "Checkout opt-in box",
"detail": "Collected at the till, November 2026",
},
"listId": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30",
},
)
print(res.status_code, res.json()){
"created": 1,
"updated": 1,
"stillUnsubscribed": 0,
"invalid": [
{
"row": 2,
"phone": "555-0199",
"reason": "Not a valid US or Canada mobile number"
}
]
}Needs an API key: Authorization: Bearer sb_... Authentication
Headers#
Any unique string up to 200 characters (a UUID works well). If a POST times out or you are not sure it went through, send it again with the same key and the same body: you get the first answer back (with Idempotent-Replayed: true) instead of the work being done twice. Keys are kept for 24 hours per account.
Request body#
application/json · required
contactsarray of objectsrequiredThe people, 1 to 50,000. When a number appears twice, the last row wins.
Fields of each item
phonestringA US or Canada mobile number in any common format (+14155550101, (415) 555-0101, 415-555-0101). Stored and returned in E.164 (+14155550101). A row without a valid number is skipped and reported in invalid.
firstNamestringFirst name, up to 120 characters.
lastNamestringLast name, up to 120 characters.
emailstringEmail address. One that does not look like an email address is left out (stored as empty).
timezonestringIANA time zone such as America/Chicago. One we do not recognise is left out.
fieldsobjectCustom fields. Values are stored as text; empty values are left out. Up to 30 fields, names up to 60 characters, values up to 500.
consentobjectrequiredYour confirmation that the people agreed to get your texts. It is kept as their opt-in record.
Child fields
attestedbooleanrequiredMust be true: you confirm these people agreed to receive your texts. Anything else is refused with consent_required.
sourcestringWhere they agreed, such as Checkout opt-in box or Website signup form, up to 120 characters. Stored with each new contact's opt-in record.
detailstringAny further detail about the consent, up to 300 characters. Imports only; POST /v1/contacts records "Added by hand".
listIdstringuuidAlso put everyone in the batch (new or already on file) on this list.
Example request body
{
"contacts": [
{
"phone": "415-555-0101",
"firstName": "Alice",
"lastName": "Moreno",
"email": "alice@example.com",
"fields": {
"favorite_bread": "Sourdough"
}
},
{
"phone": "(415) 555-0103",
"firstName": "Cara"
},
{
"phone": "555-0199"
}
],
"consent": {
"attested": true,
"source": "Checkout opt-in box",
"detail": "Collected at the till, November 2026"
},
"listId": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"
}Responses#
What the import did.
application/json
createdintegerrequiredNew contacts added, each with an opt-in record.
updatedintegerrequiredContacts already on file whose details were refreshed.
stillUnsubscribedintegerrequiredOf the updated contacts, how many had opted out and so stay unsubscribed. An import never resubscribes anyone.
invalidarray of objectsrequiredRows that were skipped.
Fields of each item
rowintegerrequiredPosition of the row: 0 for the first row of contacts (or, for import jobs, the row number in the file, counted from offset).
phonestringrequiredThe phone value as sent.
reasonstringrequiredWhy it was skipped, such as "Not a valid US or Canada mobile number" or "No phone number".
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
true when this is the stored answer to an earlier request with the same Idempotency-Key, not a new one.
The request was refused because something in it is not valid. error.code is one of:
consent_required:consent.attestedis nottrue.no_contacts:contactsis missing or empty.too_many_contacts: More than 50,000 contacts.invalid_json: The body is not a JSON object.invalid_idempotency_key: The Idempotency-Key header is longer than 200 characters.
No API key, or one that is not valid or has been revoked (unauthorized).
Something the request names does not exist in your account. error.code is one of:
not_found: The list inlistIddoes not exist.
The request clashes with the current state of things. error.code is one of:
idempotency_in_progress: A request with the same Idempotency-Key is still running. Try again in a moment.
This Idempotency-Key was already used for a different request (another path or body) in the last 24 hours (idempotency_key_reused). Use a new key for each new request.
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.
Act on many contacts
/v1/contacts/bulkDoes one thing to up to 5,000 contacts at once:
add_to_list: put them on the listlistId(starts workflows triggered by that list).remove_from_list: take them off the listlistId.unsubscribe: opt them out, for example when someone asked in person. It is recorded in their consent history ("Unsubscribed by API") and sendscontact.opted_out. There is no way to resubscribe someone: they must opt back in themselves.delete: delete them. Someone who opted out is not forgotten: their name, email and custom fields are cleared, but the number stays on file as unsubscribed so no later import can text them.
Ids that are not your contacts are ignored.
Request
curl -X POST https://app.smsblast.net/v1/contacts/bulk \
-H "Authorization: Bearer $SMSBLAST_API_KEY" \
-H "Idempotency-Key: $(openssl rand -hex 16)" \
-H "Content-Type: application/json" \
-d '{
"action": "add_to_list",
"ids": [
"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60",
"7c4e1b9d-2a3f-4c5e-8d6b-9f0a1e2d3c71"
],
"listId": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"
}'const res = await fetch('https://app.smsblast.net/v1/contacts/bulk', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SMSBLAST_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
action: 'add_to_list',
ids: [
'0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60',
'7c4e1b9d-2a3f-4c5e-8d6b-9f0a1e2d3c71',
],
listId: 'e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30',
}),
});
console.log(res.status, await res.json());import os
import uuid
import requests
res = requests.post(
"https://app.smsblast.net/v1/contacts/bulk",
headers={
"Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"action": "add_to_list",
"ids": [
"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60",
"7c4e1b9d-2a3f-4c5e-8d6b-9f0a1e2d3c71",
],
"listId": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30",
},
)
print(res.status_code, res.json()){
"added": 2
}Needs an API key: Authorization: Bearer sb_... Authentication
Headers#
Any unique string up to 200 characters (a UUID works well). If a POST times out or you are not sure it went through, send it again with the same key and the same body: you get the first answer back (with Idempotent-Replayed: true) instead of the work being done twice. Keys are kept for 24 hours per account.
Request body#
application/json · required
actionstringrequiredWhat to do with the contacts.
idsarray of stringsuuidrequiredContact ids, 1 to 5,000 (any more are ignored). Ids that are not yours are ignored.
listIdstringuuidThe list, for add_to_list and remove_from_list.
Example request body
{
"action": "add_to_list",
"ids": [
"0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60",
"7c4e1b9d-2a3f-4c5e-8d6b-9f0a1e2d3c71"
],
"listId": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"
}Responses#
How many contacts it changed.
application/json
add_to_list
addedintegerrequiredContacts newly added to the list (ones already on it are not counted).
remove_from_list
removedintegerrequiredContacts taken off the list.
unsubscribe
unsubscribedintegerrequiredContacts that were subscribed and are now unsubscribed.
delete
deletedintegerrequiredSubscribed contacts deleted.
keptAsOptOutintegerrequiredUnsubscribed contacts whose name, email and custom fields were cleared but whose number is kept as an opt-out, so no later import can text them.
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
true when this is the stored answer to an earlier request with the same Idempotency-Key, not a new one.
The request was refused because something in it is not valid. error.code is one of:
no_contacts:idsis missing or empty.invalid_action:actionis not one of the four.invalid_json: The body is not a JSON object.invalid_idempotency_key: The Idempotency-Key header is longer than 200 characters.
No API key, or one that is not valid or has been revoked (unauthorized).
Something the request names does not exist in your account. error.code is one of:
not_found: The list inlistIddoes not exist (orlistIdis missing for a list action).
The request clashes with the current state of things. error.code is one of:
idempotency_in_progress: A request with the same Idempotency-Key is still running. Try again in a moment.
This Idempotency-Key was already used for a different request (another path or body) in the last 24 hours (idempotency_key_reused). Use a new key for each new request.
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.
Export contacts as CSV
/v1/contacts/export.csvEvery contact matching the filters, as a CSV file (UTF-8 with a byte-order mark, so spreadsheet apps read accents correctly). Columns: phone, first_name, last_name, email, status, source, timezone, created_at, then one column per custom field.
Takes the same filters and sort as GET /v1/contacts, without paging. Cells that a spreadsheet would run as a formula (starting with =, +, - or @, other than phone numbers) are prefixed with an apostrophe.
Request
curl https://app.smsblast.net/v1/contacts/export.csv \
-H "Authorization: Bearer $SMSBLAST_API_KEY"const res = await fetch('https://app.smsblast.net/v1/contacts/export.csv', {
headers: {
Authorization: `Bearer ${process.env.SMSBLAST_API_KEY}`,
},
});
console.log(res.status, await res.text());import os
import requests
res = requests.get(
"https://app.smsblast.net/v1/contacts/export.csv",
headers={
"Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
},
)
print(res.status_code, res.text)phone,first_name,last_name,email,status,source,timezone,created_at,favorite_bread,store
+14155550101,Alice,Moreno,alice@example.com,subscribed,import,America/Los_Angeles,2026-11-02T18:24:09.311Z,Sourdough,Mission St
Needs an API key: Authorization: Bearer sb_... Authentication
Query parameters#
statusstringOnly subscribed or unsubscribed contacts.
searchstringText to look for in names, email and phone numbers.
listIdstringuuidOnly contacts on this list.
segmentIdstringuuidOnly contacts in this segment.
sortstringSort order.
dirstringSort direction.
Responses#
The CSV file, sent as a download named contacts-YYYY-MM-DD.csv.
text/csv
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
No API key, or one that is not valid or has been revoked (unauthorized).
Something the request names does not exist in your account. error.code is one of:
not_found: The segment insegmentIddoes not exist.
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.
Request
curl https://app.smsblast.net/v1/imports \
-H "Authorization: Bearer $SMSBLAST_API_KEY"const res = await fetch('https://app.smsblast.net/v1/imports', {
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/imports",
headers={
"Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
},
)
print(res.status_code, res.json()){
"imports": [
{
"id": "1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52",
"account_id": "5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10",
"filename": "pos-customers.csv",
"list_id": "9b1d4f6a-7c2e-4a3b-8e5d-6f0c2a9b1d42",
"list_name": "Point of sale signups",
"consent_source": "Checkout opt-in box",
"status": "done",
"total_rows": 2503,
"processed": 2503,
"created": 2497,
"updated": 4,
"invalid": 2,
"still_unsubscribed": 1,
"created_at": "2026-11-19T18:30:00.000Z",
"finished_at": "2026-11-19T18:31:12.400Z"
}
]
}Needs an API key: Authorization: Bearer sb_... Authentication
Responses#
Import jobs.
application/json
importsarray of objectsrequiredNewest first.
Fields of each item
idstringuuidrequiredThe import id.
account_idstringuuidrequiredYour account id.
filenamestringrequiredThe file name you gave (default contacts.csv).
list_idstringuuidnullablerequiredThe list everyone in the import is put on.
list_namestringnullablerequiredThat list's name.
consent_sourcestringrequiredWhere the people agreed to your texts (default CSV import).
statusstringrequiredrunning until you finish it.
total_rowsintegerrequiredRows in the file, as you said when starting (for showing progress).
processedintegerrequiredRows sent so far.
createdintegerrequiredNew contacts so far.
updatedintegerrequiredContacts already on file, refreshed.
invalidintegerrequiredRows skipped for a missing or invalid number.
still_unsubscribedintegerrequiredUpdated contacts that had opted out and stay unsubscribed.
created_atstringdate-timerequiredWhen the import started.
finished_atstringdate-timenullablerequiredWhen it was finished.
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
No API key, or one that is not valid or has been revoked (unauthorized).
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.
Start an import job
/v1/importsFor a large file: start a job, send the rows in batches of up to 5,000 with POST /v1/imports/{id}/rows, then finish it with POST /v1/imports/{id}/finish. The job keeps running totals, so you can show progress, and an interrupted upload leaves an honest record of how far it got. (For up to 50,000 rows in one go, POST /v1/contacts/import is simpler.)
You must confirm everyone in the file agreed to get your texts. Contacts are added and updated by the same rules as POST /v1/contacts/import: nobody who opted out is resubscribed, and no webhooks are sent or workflows started. Everyone can be put on an existing list (listId) or a new one (newListName).
Request
curl -X POST https://app.smsblast.net/v1/imports \
-H "Authorization: Bearer $SMSBLAST_API_KEY" \
-H "Idempotency-Key: $(openssl rand -hex 16)" \
-H "Content-Type: application/json" \
-d '{
"filename": "pos-customers.csv",
"totalRows": 2503,
"newListName": "Point of sale signups",
"consent": {
"attested": true,
"source": "Checkout opt-in box"
}
}'const res = await fetch('https://app.smsblast.net/v1/imports', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SMSBLAST_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
filename: 'pos-customers.csv',
totalRows: 2503,
newListName: 'Point of sale signups',
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/imports",
headers={
"Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"filename": "pos-customers.csv",
"totalRows": 2503,
"newListName": "Point of sale signups",
"consent": {
"attested": True,
"source": "Checkout opt-in box",
},
},
)
print(res.status_code, res.json()){
"import": {
"id": "1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52",
"account_id": "5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10",
"filename": "pos-customers.csv",
"list_id": "9b1d4f6a-7c2e-4a3b-8e5d-6f0c2a9b1d42",
"list_name": "Point of sale signups",
"consent_source": "Checkout opt-in box",
"status": "running",
"total_rows": 2503,
"processed": 0,
"created": 0,
"updated": 0,
"invalid": 0,
"still_unsubscribed": 0,
"created_at": "2026-11-19T18:30:00.000Z",
"finished_at": null
}
}Needs an API key: Authorization: Bearer sb_... Authentication
Headers#
Any unique string up to 200 characters (a UUID works well). If a POST times out or you are not sure it went through, send it again with the same key and the same body: you get the first answer back (with Idempotent-Replayed: true) instead of the work being done twice. Keys are kept for 24 hours per account.
Request body#
application/json · required
filenamestringThe file name, for your records (up to 200 characters).
totalRowsintegerHow many rows the file has, so progress can be shown.
listIdstringuuidPut everyone in the import on this existing list.
newListNamestringCreate a new list with this name and put everyone on it. Takes precedence over listId.
consentobjectrequiredChild fields
attestedbooleanrequiredMust be true: you confirm everyone in the file agreed to receive your texts.
sourcestringWhere they agreed, up to 120 characters (default CSV import).
Example request body
{
"filename": "pos-customers.csv",
"totalRows": 2503,
"newListName": "Point of sale signups",
"consent": {
"attested": true,
"source": "Checkout opt-in box"
}
}Responses#
The new job.
application/json
importobjectrequiredAn import job: a large file sent in batches, with running totals.
Child fields
idstringuuidrequiredThe import id.
account_idstringuuidrequiredYour account id.
filenamestringrequiredThe file name you gave (default contacts.csv).
list_idstringuuidnullablerequiredThe list everyone in the import is put on.
list_namestringnullablerequiredThat list's name.
consent_sourcestringrequiredWhere the people agreed to your texts (default CSV import).
statusstringrequiredrunning until you finish it.
total_rowsintegerrequiredRows in the file, as you said when starting (for showing progress).
processedintegerrequiredRows sent so far.
createdintegerrequiredNew contacts so far.
updatedintegerrequiredContacts already on file, refreshed.
invalidintegerrequiredRows skipped for a missing or invalid number.
still_unsubscribedintegerrequiredUpdated contacts that had opted out and stay unsubscribed.
created_atstringdate-timerequiredWhen the import started.
finished_atstringdate-timenullablerequiredWhen it was finished.
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
true when this is the stored answer to an earlier request with the same Idempotency-Key, not a new one.
The request was refused because something in it is not valid. error.code is one of:
consent_required:consent.attestedis nottrue.invalid_name:newListNameis empty after trimming.invalid_json: The body is not a JSON object.invalid_idempotency_key: The Idempotency-Key header is longer than 200 characters.
No API key, or one that is not valid or has been revoked (unauthorized).
Something the request names does not exist in your account. error.code is one of:
not_found: The list inlistIddoes not exist.
The request clashes with the current state of things. error.code is one of:
idempotency_in_progress: A request with the same Idempotency-Key is still running. Try again in a moment.
The body is too large. error.code is one of:
too_large: The body is larger than 12 MB.
This Idempotency-Key was already used for a different request (another path or body) in the last 24 hours (idempotency_key_reused). Use a new key for each new request.
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.
Request
curl https://app.smsblast.net/v1/imports/1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52 \
-H "Authorization: Bearer $SMSBLAST_API_KEY"const res = await fetch('https://app.smsblast.net/v1/imports/1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52', {
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/imports/1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52",
headers={
"Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
},
)
print(res.status_code, res.json()){
"import": {
"id": "1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52",
"account_id": "5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10",
"filename": "pos-customers.csv",
"list_id": "9b1d4f6a-7c2e-4a3b-8e5d-6f0c2a9b1d42",
"list_name": "Point of sale signups",
"consent_source": "Checkout opt-in box",
"status": "running",
"total_rows": 2503,
"processed": 2000,
"created": 1994,
"updated": 4,
"invalid": 2,
"still_unsubscribed": 1,
"created_at": "2026-11-19T18:30:00.000Z",
"finished_at": null
}
}Needs an API key: Authorization: Bearer sb_... Authentication
Path parameters#
idstringuuidrequiredThe import id.
Responses#
The job.
application/json
importobjectrequiredAn import job: a large file sent in batches, with running totals.
Child fields
idstringuuidrequiredThe import id.
account_idstringuuidrequiredYour account id.
filenamestringrequiredThe file name you gave (default contacts.csv).
list_idstringuuidnullablerequiredThe list everyone in the import is put on.
list_namestringnullablerequiredThat list's name.
consent_sourcestringrequiredWhere the people agreed to your texts (default CSV import).
statusstringrequiredrunning until you finish it.
total_rowsintegerrequiredRows in the file, as you said when starting (for showing progress).
processedintegerrequiredRows sent so far.
createdintegerrequiredNew contacts so far.
updatedintegerrequiredContacts already on file, refreshed.
invalidintegerrequiredRows skipped for a missing or invalid number.
still_unsubscribedintegerrequiredUpdated contacts that had opted out and stay unsubscribed.
created_atstringdate-timerequiredWhen the import started.
finished_atstringdate-timenullablerequiredWhen it was finished.
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
No API key, or one that is not valid or has been revoked (unauthorized).
Something the request names does not exist in your account. error.code is one of:
not_found: No import with that id in your account.
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.
Send a batch of rows
/v1/imports/{id}/rowsAdds one batch of up to 5,000 rows to a running import job, at once. Set offset to the position of the batch's first row in the file, so skipped rows are reported with their real row numbers. Returns what the batch did and the job with its new totals.
Request
curl -X POST https://app.smsblast.net/v1/imports/1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52/rows \
-H "Authorization: Bearer $SMSBLAST_API_KEY" \
-H "Idempotency-Key: $(openssl rand -hex 16)" \
-H "Content-Type: application/json" \
-d '{
"rows": [
{
"phone": "415-555-0101",
"firstName": "Alice",
"lastName": "Moreno"
},
{
"phone": "n/a",
"firstName": "Dana"
}
],
"offset": 2000
}'const res = await fetch('https://app.smsblast.net/v1/imports/1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52/rows', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SMSBLAST_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
rows: [
{
phone: '415-555-0101',
firstName: 'Alice',
lastName: 'Moreno',
},
{
phone: 'n/a',
firstName: 'Dana',
},
],
offset: 2000,
}),
});
console.log(res.status, await res.json());import os
import uuid
import requests
res = requests.post(
"https://app.smsblast.net/v1/imports/1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52/rows",
headers={
"Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"rows": [
{
"phone": "415-555-0101",
"firstName": "Alice",
"lastName": "Moreno",
},
{
"phone": "n/a",
"firstName": "Dana",
},
],
"offset": 2000,
},
)
print(res.status_code, res.json()){
"created": 1,
"updated": 0,
"stillUnsubscribed": 0,
"invalid": [
{
"row": 2001,
"phone": "n/a",
"reason": "Not a valid US or Canada mobile number"
}
],
"job": {
"id": "1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52",
"account_id": "5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10",
"filename": "pos-customers.csv",
"list_id": "9b1d4f6a-7c2e-4a3b-8e5d-6f0c2a9b1d42",
"list_name": "Point of sale signups",
"consent_source": "Checkout opt-in box",
"status": "running",
"total_rows": 2503,
"processed": 2000,
"created": 1994,
"updated": 4,
"invalid": 2,
"still_unsubscribed": 1,
"created_at": "2026-11-19T18:30:00.000Z",
"finished_at": null
}
}Needs an API key: Authorization: Bearer sb_... Authentication
Path parameters#
idstringuuidrequiredThe import id.
Headers#
Any unique string up to 200 characters (a UUID works well). If a POST times out or you are not sure it went through, send it again with the same key and the same body: you get the first answer back (with Idempotent-Replayed: true) instead of the work being done twice. Keys are kept for 24 hours per account.
Request body#
application/json · required
rowsarray of objectsrequiredUp to 5,000 rows.
Fields of each item
phonestringA US or Canada mobile number in any common format (+14155550101, (415) 555-0101, 415-555-0101). Stored and returned in E.164 (+14155550101). A row without a valid number is skipped and reported in invalid.
firstNamestringFirst name, up to 120 characters.
lastNamestringLast name, up to 120 characters.
emailstringEmail address. One that does not look like an email address is left out (stored as empty).
timezonestringIANA time zone such as America/Chicago. One we do not recognise is left out.
fieldsobjectCustom fields. Values are stored as text; empty values are left out. Up to 30 fields, names up to 60 characters, values up to 500.
offsetintegerThe position of the first row of this batch in the file, so invalid[].row points at the right line. Default 0.
Example request body
{
"rows": [
{
"phone": "415-555-0101",
"firstName": "Alice",
"lastName": "Moreno"
},
{
"phone": "n/a",
"firstName": "Dana"
}
],
"offset": 2000
}Responses#
What the batch did.
application/json
createdintegerrequiredNew contacts added from this batch.
updatedintegerrequiredContacts already on file, refreshed from this batch.
stillUnsubscribedintegerrequiredOf those, contacts that had opted out and stay unsubscribed.
invalidarray of objectsrequiredRows of this batch that were skipped.
Fields of each item
rowintegerrequiredRow number in the file (offset plus the position in this batch).
phonestringrequiredThe phone value as sent.
reasonstringrequiredWhy it was skipped.
jobobjectrequiredAn import job: a large file sent in batches, with running totals.
Child fields
idstringuuidrequiredThe import id.
account_idstringuuidrequiredYour account id.
filenamestringrequiredThe file name you gave (default contacts.csv).
list_idstringuuidnullablerequiredThe list everyone in the import is put on.
list_namestringnullablerequiredThat list's name.
consent_sourcestringrequiredWhere the people agreed to your texts (default CSV import).
statusstringrequiredrunning until you finish it.
total_rowsintegerrequiredRows in the file, as you said when starting (for showing progress).
processedintegerrequiredRows sent so far.
createdintegerrequiredNew contacts so far.
updatedintegerrequiredContacts already on file, refreshed.
invalidintegerrequiredRows skipped for a missing or invalid number.
still_unsubscribedintegerrequiredUpdated contacts that had opted out and stay unsubscribed.
created_atstringdate-timerequiredWhen the import started.
finished_atstringdate-timenullablerequiredWhen it was finished.
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
true when this is the stored answer to an earlier request with the same Idempotency-Key, not a new one.
The request was refused because something in it is not valid. error.code is one of:
no_contacts:rowsis missing or empty.batch_too_large: More than 5,000 rows.invalid_json: The body is not a JSON object.invalid_idempotency_key: The Idempotency-Key header is longer than 200 characters.
No API key, or one that is not valid or has been revoked (unauthorized).
Something the request names does not exist in your account. error.code is one of:
not_found: No import with that id in your account.
The request clashes with the current state of things. error.code is one of:
import_finished: The import has already been finished.idempotency_in_progress: A request with the same Idempotency-Key is still running. Try again in a moment.
The body is too large. error.code is one of:
too_large: The body is larger than 12 MB.
This Idempotency-Key was already used for a different request (another path or body) in the last 24 hours (idempotency_key_reused). Use a new key for each new request.
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.
Finish an import job
/v1/imports/{id}/finishMarks a running import done (or failed, with failed: true, for example when the upload was abandoned). No more rows can be added afterwards. Finishing an import that is already finished changes nothing. The body is optional.
Request
curl -X POST https://app.smsblast.net/v1/imports/1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52/finish \
-H "Authorization: Bearer $SMSBLAST_API_KEY" \
-H "Idempotency-Key: $(openssl rand -hex 16)" \
-H "Content-Type: application/json" \
-d '{}'const res = await fetch('https://app.smsblast.net/v1/imports/1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52/finish', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SMSBLAST_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
console.log(res.status, await res.json());import os
import uuid
import requests
res = requests.post(
"https://app.smsblast.net/v1/imports/1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52/finish",
headers={
"Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={},
)
print(res.status_code, res.json()){
"import": {
"id": "1a3c5e7f-9b0d-4c2e-8f4a-6c8e0a2c4e52",
"account_id": "5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10",
"filename": "pos-customers.csv",
"list_id": "9b1d4f6a-7c2e-4a3b-8e5d-6f0c2a9b1d42",
"list_name": "Point of sale signups",
"consent_source": "Checkout opt-in box",
"status": "done",
"total_rows": 2503,
"processed": 2503,
"created": 2497,
"updated": 4,
"invalid": 2,
"still_unsubscribed": 1,
"created_at": "2026-11-19T18:30:00.000Z",
"finished_at": "2026-11-19T18:31:12.400Z"
}
}Needs an API key: Authorization: Bearer sb_... Authentication
Path parameters#
idstringuuidrequiredThe import id.
Headers#
Any unique string up to 200 characters (a UUID works well). If a POST times out or you are not sure it went through, send it again with the same key and the same body: you get the first answer back (with Idempotent-Replayed: true) instead of the work being done twice. Keys are kept for 24 hours per account.
Request body#
application/json
failedbooleantrue marks the import failed (for example the upload was abandoned) instead of done.
Example request body
{}Responses#
The finished job.
application/json
importobjectrequiredAn import job: a large file sent in batches, with running totals.
Child fields
idstringuuidrequiredThe import id.
account_idstringuuidrequiredYour account id.
filenamestringrequiredThe file name you gave (default contacts.csv).
list_idstringuuidnullablerequiredThe list everyone in the import is put on.
list_namestringnullablerequiredThat list's name.
consent_sourcestringrequiredWhere the people agreed to your texts (default CSV import).
statusstringrequiredrunning until you finish it.
total_rowsintegerrequiredRows in the file, as you said when starting (for showing progress).
processedintegerrequiredRows sent so far.
createdintegerrequiredNew contacts so far.
updatedintegerrequiredContacts already on file, refreshed.
invalidintegerrequiredRows skipped for a missing or invalid number.
still_unsubscribedintegerrequiredUpdated contacts that had opted out and stay unsubscribed.
created_atstringdate-timerequiredWhen the import started.
finished_atstringdate-timenullablerequiredWhen it was finished.
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
true when this is the stored answer to an earlier request with the same Idempotency-Key, not a new one.
The request was refused because something in it is not valid. error.code is one of:
invalid_idempotency_key: The Idempotency-Key header is longer than 200 characters.
No API key, or one that is not valid or has been revoked (unauthorized).
Something the request names does not exist in your account. error.code is one of:
not_found: No import with that id in your account.
The request clashes with the current state of things. error.code is one of:
idempotency_in_progress: A request with the same Idempotency-Key is still running. Try again in a moment.
The body is too large. error.code is one of:
too_large: The body is larger than 12 MB.
This Idempotency-Key was already used for a different request (another path or body) in the last 24 hours (idempotency_key_reused). Use a new key for each new request.
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.