New: every plan now includes free incoming texts and rollover credits. See pricing →
Search Help Center Documentation

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).

List contacts

GET/v1/contacts

Your 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())
Response · 200
{
  "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#

statusstring

Only subscribed or unsubscribed contacts. Other values are ignored.

One of "subscribed", "unsubscribed".

searchstring

Text to look for in names, email and (3 or more digits) phone numbers.

listIdstringuuid

Only contacts on this list.

notListIdstringuuid

Only contacts that are not on this list (for example, to pick people to add to it).

segmentIdstringuuid

Only contacts in this segment.

sortstring

Sort by when they were added, or by name. Empty names sort last.

One of "created", "first_name", "last_name". Default "created".

dirstring

Sort direction. Default desc (newest first).

One of "asc", "desc". Default "desc".

limitinteger

How many to return, 1 to 500. Default 50.

Default 50. Limits: 1 to 500.

offsetinteger

How many to skip, for paging. Default 0.

Default 0. Limits: at least 0.

Responses#

200

One page of contacts.

application/json

contactsarray of objectsrequired

This page of contacts.

Fields of each item
idstringuuidrequired

The contact id.

phonestringrequired

Mobile number in E.164 format, such as +14155550101. There is one contact per number in an account.

first_namestringnullablerequired

First name. Used by the {first_name} personalisation tag.

last_namestringnullablerequired

Last name. Used by the {last_name} personalisation tag.

emailstringnullablerequired

Email address, lower case.

timezonestringnullablerequired

IANA 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.

statusstringrequired

subscribed 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.

One of "subscribed", "unsubscribed".

sourcestringnullablerequired

How 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).

fieldsobjectrequired

Custom fields, as text: up to 30 per contact, names up to 60 characters, values up to 500. Segments can filter on them.

Any keys, each with a string value.

created_atstringdate-timerequired

When the contact was added.

totalintegerrequired

All contacts in the account.

matchingintegerrequired

Contacts matching the filters (status, search, list, segment), across all pages.

subscribedintegerrequired

Subscribed contacts in the account.

unsubscribedintegerrequired

Unsubscribed contacts in the account.

Response headers
X-Request-Idstring Guide

The id of this request (req_...), on every answer. Quote it when you contact support.

X-RateLimit-Limitinteger Guide

Requests allowed per minute with this API key.

X-RateLimit-Remaininginteger Guide

Requests left in the current minute.

X-RateLimit-Resetinteger Guide

When the current minute ends and the count starts again, in Unix seconds.

401

No API key, or one that is not valid or has been revoked (unauthorized).

404

Something the request names does not exist in your account. error.code is one of:

  • not_found: The segment in segmentId does not exist.
429

Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.

Every error has the same body: {"error": {"code", "message", "details", "requestId"}}. See Errors.

Add a contact

POST/v1/contacts

Adds 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())
Response · 200
{
  "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
}
Response · 201
{
  "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#

Idempotency-Keystring Guide

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.

Limits: up to 200 characters.

Example "2b5c4f8e-order-1042".

Request body#

application/json · required

phonestringrequired

A US or Canada mobile number in any common format (+14155550101, (415) 555-0101, 415-555-0101). Stored and returned in E.164 (+14155550101).

firstNamestring

First name, up to 120 characters.

lastNamestring

Last name, up to 120 characters.

emailstring

Email address. One that does not look like an email address is left out (stored as empty).

timezonestring

IANA time zone such as America/Chicago. One we do not recognise is left out.

fieldsobject

Custom fields. Values are stored as text; empty values are left out. Up to 30 fields, names up to 60 characters, values up to 500.

Any keys, each with a string or number or boolean value.

consentobjectrequired

Your confirmation that the people agreed to get your texts. It is kept as their opt-in record.

Child fields
attestedbooleanrequired

Must be true: you confirm these people agreed to receive your texts. Anything else is refused with consent_required.

Always true.

sourcestring

Where 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.

detailstring

Any further detail about the consent, up to 300 characters. Imports only; POST /v1/contacts records "Added by hand".

listIdstringuuid

Also put the contact on this list.

Example request body
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#

200

The number was already a contact: the details sent were merged into it. merged is true.

application/json

contactobjectrequired

A person on your contact list. Field names are snake_case.

Child fields
idstringuuidrequired

The contact id.

phonestringrequired

Mobile number in E.164 format, such as +14155550101. There is one contact per number in an account.

first_namestringnullablerequired

First name. Used by the {first_name} personalisation tag.

last_namestringnullablerequired

Last name. Used by the {last_name} personalisation tag.

emailstringnullablerequired

Email address, lower case.

timezonestringnullablerequired

IANA 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.

statusstringrequired

subscribed 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.

One of "subscribed", "unsubscribed".

sourcestringnullablerequired

How 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).

fieldsobjectrequired

Custom fields, as text: up to 30 per contact, names up to 60 characters, values up to 500. Segments can filter on them.

Any keys, each with a string value.

created_atstringdate-timerequired

When the contact was added.

mergedbooleanrequired

true when the number was already a contact and these details were merged into it.

addedToListbooleanrequired

true when this request put them on the list in listId (false when there is no listId or they were on it already).

Response headers
X-Request-Idstring Guide

The id of this request (req_...), on every answer. Quote it when you contact support.

X-RateLimit-Limitinteger Guide

Requests allowed per minute with this API key.

X-RateLimit-Remaininginteger Guide

Requests left in the current minute.

X-RateLimit-Resetinteger Guide

When the current minute ends and the count starts again, in Unix seconds.

Idempotent-Replayedstring Guide

true when this is the stored answer to an earlier request with the same Idempotency-Key, not a new one.

One of "true".

201

The new contact. Its source is api when added with an API key (manual when added by a person in the dashboard).

application/json

contactobjectrequired

A person on your contact list. Field names are snake_case.

Child fields
idstringuuidrequired

The contact id.

phonestringrequired

Mobile number in E.164 format, such as +14155550101. There is one contact per number in an account.

first_namestringnullablerequired

First name. Used by the {first_name} personalisation tag.

last_namestringnullablerequired

Last name. Used by the {last_name} personalisation tag.

emailstringnullablerequired

Email address, lower case.

timezonestringnullablerequired

IANA 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.

statusstringrequired

subscribed 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.

One of "subscribed", "unsubscribed".

sourcestringnullablerequired

How 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).

fieldsobjectrequired

Custom fields, as text: up to 30 per contact, names up to 60 characters, values up to 500. Segments can filter on them.

Any keys, each with a string value.

created_atstringdate-timerequired

When the contact was added.

mergedbooleanrequired

true when the number was already a contact and these details were merged into it.

addedToListbooleanrequired

true when this request put them on the list in listId (false when there is no listId or they were on it already).

Response headers
X-Request-Idstring Guide

The id of this request (req_...), on every answer. Quote it when you contact support.

X-RateLimit-Limitinteger Guide

Requests allowed per minute with this API key.

X-RateLimit-Remaininginteger Guide

Requests left in the current minute.

X-RateLimit-Resetinteger Guide

When the current minute ends and the count starts again, in Unix seconds.

Idempotent-Replayedstring Guide

true when this is the stored answer to an earlier request with the same Idempotency-Key, not a new one.

One of "true".

400

The request was refused because something in it is not valid. error.code is one of:

  • invalid_phone: phone is not a valid US or Canada mobile number.
  • consent_required: consent.attested is not true.
  • invalid_json: The body is not a JSON object.
  • invalid_idempotency_key: The Idempotency-Key header is longer than 200 characters.
401

No API key, or one that is not valid or has been revoked (unauthorized).

404

Something the request names does not exist in your account. error.code is one of:

  • not_found: The list in listId does not exist.
409

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.
422

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.

429

Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.

Every error has the same body: {"error": {"code", "message", "details", "requestId"}}. See Errors.

Get a contact

GET/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())
Response · 200
{
  "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#

idstringuuidrequired

The contact id.

Responses#

200

The contact.

application/json

contactobjectrequired

A person on your contact list. Field names are snake_case.

Child fields
idstringuuidrequired

The contact id.

phonestringrequired

Mobile number in E.164 format, such as +14155550101. There is one contact per number in an account.

first_namestringnullablerequired

First name. Used by the {first_name} personalisation tag.

last_namestringnullablerequired

Last name. Used by the {last_name} personalisation tag.

emailstringnullablerequired

Email address, lower case.

timezonestringnullablerequired

IANA 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.

statusstringrequired

subscribed 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.

One of "subscribed", "unsubscribed".

sourcestringnullablerequired

How 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).

fieldsobjectrequired

Custom fields, as text: up to 30 per contact, names up to 60 characters, values up to 500. Segments can filter on them.

Any keys, each with a string value.

created_atstringdate-timerequired

When the contact was added.

listsarray of objectsrequired

The lists the contact is on, by name.

Fields of each item
idstringuuidrequired

The list id.

namestringrequired

The list name.

consentarray of objectsrequired

Every opt-in and opt-out, oldest first.

Fields of each item
kindstringrequired

Whether they joined or left.

One of "opt_in", "opt_out".

sourcestringrequired

Where 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.

detailstringnullablerequired

More 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-timerequired

When it happened.

Response headers
X-Request-Idstring Guide

The id of this request (req_...), on every answer. Quote it when you contact support.

X-RateLimit-Limitinteger Guide

Requests allowed per minute with this API key.

X-RateLimit-Remaininginteger Guide

Requests left in the current minute.

X-RateLimit-Resetinteger Guide

When the current minute ends and the count starts again, in Unix seconds.

401

No API key, or one that is not valid or has been revoked (unauthorized).

404

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.
429

Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.

Every error has the same body: {"error": {"code", "message", "details", "requestId"}}. See Errors.

Update a contact

PATCH/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())
Response · 200
{
  "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#

idstringuuidrequired

The contact id.

Request body#

application/json · required

Only the fields you send change.

firstNamestringnullable

First name, up to 120 characters. null or "" clears it.

lastNamestringnullable

Last name, up to 120 characters. null or "" clears it.

emailstringnullable

Email address. null or "" clears it; so does one that does not look like an email address.

timezonestringnullable

IANA time zone. null or "" clears it; one we do not recognise is refused with invalid_timezone.

fieldsobject

Custom fields. When sent, they replace all of the contact's custom fields (send the full set); leave it out to keep them.

Any keys, each with a string or number or boolean value.

Example request body
Request body
{
  "email": "alice.moreno@example.com",
  "fields": {
    "favorite_bread": "Rye",
    "store": "Mission St"
  }
}

Responses#

200

The updated contact.

application/json

contactobjectrequired

A person on your contact list. Field names are snake_case.

Child fields
idstringuuidrequired

The contact id.

phonestringrequired

Mobile number in E.164 format, such as +14155550101. There is one contact per number in an account.

first_namestringnullablerequired

First name. Used by the {first_name} personalisation tag.

last_namestringnullablerequired

Last name. Used by the {last_name} personalisation tag.

emailstringnullablerequired

Email address, lower case.

timezonestringnullablerequired

IANA 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.

statusstringrequired

subscribed 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.

One of "subscribed", "unsubscribed".

sourcestringnullablerequired

How 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).

fieldsobjectrequired

Custom fields, as text: up to 30 per contact, names up to 60 characters, values up to 500. Segments can filter on them.

Any keys, each with a string value.

created_atstringdate-timerequired

When the contact was added.

Response headers
X-Request-Idstring Guide

The id of this request (req_...), on every answer. Quote it when you contact support.

X-RateLimit-Limitinteger Guide

Requests allowed per minute with this API key.

X-RateLimit-Remaininginteger Guide

Requests left in the current minute.

X-RateLimit-Resetinteger Guide

When the current minute ends and the count starts again, in Unix seconds.

400

The request was refused because something in it is not valid. error.code is one of:

  • invalid_timezone: timezone is not one we recognise.
  • invalid_json: The body is not a JSON object.
401

No API key, or one that is not valid or has been revoked (unauthorized).

404

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.
429

Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.

Every error has the same body: {"error": {"code", "message", "details", "requestId"}}. See Errors.

Get consent history

GET/v1/contacts/{id}/consent

Every 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())
Response · 200
{
  "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#

idstringuuidrequired

The contact id.

Responses#

200

The consent history.

application/json

eventsarray of objectsrequired

Oldest first.

Fields of each item
kindstringrequired

Whether they joined or left.

One of "opt_in", "opt_out".

sourcestringrequired

Where 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.

detailstringnullablerequired

More 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-timerequired

When it happened.

Response headers
X-Request-Idstring Guide

The id of this request (req_...), on every answer. Quote it when you contact support.

X-RateLimit-Limitinteger Guide

Requests allowed per minute with this API key.

X-RateLimit-Remaininginteger Guide

Requests left in the current minute.

X-RateLimit-Resetinteger Guide

When the current minute ends and the count starts again, in Unix seconds.

401

No API key, or one that is not valid or has been revoked (unauthorized).

404

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.
429

Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.

Every error has the same body: {"error": {"code", "message", "details", "requestId"}}. See Errors.

Import contacts

POST/v1/contacts/import

Adds 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())
Response · 200
{
  "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#

Idempotency-Keystring Guide

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.

Limits: up to 200 characters.

Example "2b5c4f8e-order-1042".

Request body#

application/json · required

contactsarray of objectsrequired

The people, 1 to 50,000. When a number appears twice, the last row wins.

Limits: 1 to 50000 items.

Fields of each item
phonestring

A 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.

firstNamestring

First name, up to 120 characters.

lastNamestring

Last name, up to 120 characters.

emailstring

Email address. One that does not look like an email address is left out (stored as empty).

timezonestring

IANA time zone such as America/Chicago. One we do not recognise is left out.

fieldsobject

Custom fields. Values are stored as text; empty values are left out. Up to 30 fields, names up to 60 characters, values up to 500.

Any keys, each with a string or number or boolean value.

consentobjectrequired

Your confirmation that the people agreed to get your texts. It is kept as their opt-in record.

Child fields
attestedbooleanrequired

Must be true: you confirm these people agreed to receive your texts. Anything else is refused with consent_required.

Always true.

sourcestring

Where 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.

detailstring

Any further detail about the consent, up to 300 characters. Imports only; POST /v1/contacts records "Added by hand".

listIdstringuuid

Also put everyone in the batch (new or already on file) on this list.

Example request body
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#

200

What the import did.

application/json

createdintegerrequired

New contacts added, each with an opt-in record.

updatedintegerrequired

Contacts already on file whose details were refreshed.

stillUnsubscribedintegerrequired

Of the updated contacts, how many had opted out and so stay unsubscribed. An import never resubscribes anyone.

invalidarray of objectsrequired

Rows that were skipped.

Fields of each item
rowintegerrequired

Position of the row: 0 for the first row of contacts (or, for import jobs, the row number in the file, counted from offset).

phonestringrequired

The phone value as sent.

reasonstringrequired

Why it was skipped, such as "Not a valid US or Canada mobile number" or "No phone number".

Response headers
X-Request-Idstring Guide

The id of this request (req_...), on every answer. Quote it when you contact support.

X-RateLimit-Limitinteger Guide

Requests allowed per minute with this API key.

X-RateLimit-Remaininginteger Guide

Requests left in the current minute.

X-RateLimit-Resetinteger Guide

When the current minute ends and the count starts again, in Unix seconds.

Idempotent-Replayedstring Guide

true when this is the stored answer to an earlier request with the same Idempotency-Key, not a new one.

One of "true".

400

The request was refused because something in it is not valid. error.code is one of:

  • consent_required: consent.attested is not true.
  • no_contacts: contacts is 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.
401

No API key, or one that is not valid or has been revoked (unauthorized).

404

Something the request names does not exist in your account. error.code is one of:

  • not_found: The list in listId does not exist.
409

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.
422

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.

429

Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.

Every error has the same body: {"error": {"code", "message", "details", "requestId"}}. See Errors.

Act on many contacts

POST/v1/contacts/bulk

Does one thing to up to 5,000 contacts at once:

  • add_to_list: put them on the list listId (starts workflows triggered by that list).
  • remove_from_list: take them off the list listId.
  • unsubscribe: opt them out, for example when someone asked in person. It is recorded in their consent history ("Unsubscribed by API") and sends contact.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())
Response · 200
{
  "added": 2
}

Needs an API key: Authorization: Bearer sb_... Authentication

Headers#

Idempotency-Keystring Guide

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.

Limits: up to 200 characters.

Example "2b5c4f8e-order-1042".

Request body#

application/json · required

actionstringrequired

What to do with the contacts.

One of "add_to_list", "remove_from_list", "unsubscribe", "delete".

idsarray of stringsuuidrequired

Contact ids, 1 to 5,000 (any more are ignored). Ids that are not yours are ignored.

Limits: at least 1 item.

listIdstringuuid

The list, for add_to_list and remove_from_list.

Example request body
Request body
{
  "action": "add_to_list",
  "ids": [
    "0f8d5c3a-6b2e-4f1d-9a7c-3e5b8d2f1a60",
    "7c4e1b9d-2a3f-4c5e-8d6b-9f0a1e2d3c71"
  ],
  "listId": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30"
}

Responses#

200

How many contacts it changed.

application/json

One of these shapes:

add_to_list
addedintegerrequired

Contacts newly added to the list (ones already on it are not counted).

remove_from_list
removedintegerrequired

Contacts taken off the list.

unsubscribe
unsubscribedintegerrequired

Contacts that were subscribed and are now unsubscribed.

delete
deletedintegerrequired

Subscribed contacts deleted.

keptAsOptOutintegerrequired

Unsubscribed 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
X-Request-Idstring Guide

The id of this request (req_...), on every answer. Quote it when you contact support.

X-RateLimit-Limitinteger Guide

Requests allowed per minute with this API key.

X-RateLimit-Remaininginteger Guide

Requests left in the current minute.

X-RateLimit-Resetinteger Guide

When the current minute ends and the count starts again, in Unix seconds.

Idempotent-Replayedstring Guide

true when this is the stored answer to an earlier request with the same Idempotency-Key, not a new one.

One of "true".

400

The request was refused because something in it is not valid. error.code is one of:

  • no_contacts: ids is missing or empty.
  • invalid_action: action is 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.
401

No API key, or one that is not valid or has been revoked (unauthorized).

404

Something the request names does not exist in your account. error.code is one of:

  • not_found: The list in listId does not exist (or listId is missing for a list action).
409

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.
422

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.

429

Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.

Every error has the same body: {"error": {"code", "message", "details", "requestId"}}. See Errors.

Export contacts as CSV

GET/v1/contacts/export.csv

Every 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)
Response · 200
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#

statusstring

Only subscribed or unsubscribed contacts.

One of "subscribed", "unsubscribed".

searchstring

Text to look for in names, email and phone numbers.

listIdstringuuid

Only contacts on this list.

segmentIdstringuuid

Only contacts in this segment.

sortstring

Sort order.

One of "created", "first_name", "last_name". Default "created".

dirstring

Sort direction.

One of "asc", "desc". Default "desc".

Responses#

200

The CSV file, sent as a download named contacts-YYYY-MM-DD.csv.

text/csv

string
Response headers
X-Request-Idstring Guide

The id of this request (req_...), on every answer. Quote it when you contact support.

X-RateLimit-Limitinteger Guide

Requests allowed per minute with this API key.

X-RateLimit-Remaininginteger Guide

Requests left in the current minute.

X-RateLimit-Resetinteger Guide

When the current minute ends and the count starts again, in Unix seconds.

401

No API key, or one that is not valid or has been revoked (unauthorized).

404

Something the request names does not exist in your account. error.code is one of:

  • not_found: The segment in segmentId does not exist.
429

Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.

Every error has the same body: {"error": {"code", "message", "details", "requestId"}}. See Errors.

List import jobs

GET/v1/imports

Your 50 most recent import jobs, newest first.

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())
Response · 200
{
  "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#

200

Import jobs.

application/json

importsarray of objectsrequired

Newest first.

Fields of each item
idstringuuidrequired

The import id.

account_idstringuuidrequired

Your account id.

filenamestringrequired

The file name you gave (default contacts.csv).

list_idstringuuidnullablerequired

The list everyone in the import is put on.

list_namestringnullablerequired

That list's name.

consent_sourcestringrequired

Where the people agreed to your texts (default CSV import).

statusstringrequired

running until you finish it.

One of "running", "done", "failed".

total_rowsintegerrequired

Rows in the file, as you said when starting (for showing progress).

processedintegerrequired

Rows sent so far.

createdintegerrequired

New contacts so far.

updatedintegerrequired

Contacts already on file, refreshed.

invalidintegerrequired

Rows skipped for a missing or invalid number.

still_unsubscribedintegerrequired

Updated contacts that had opted out and stay unsubscribed.

created_atstringdate-timerequired

When the import started.

finished_atstringdate-timenullablerequired

When it was finished.

Response headers
X-Request-Idstring Guide

The id of this request (req_...), on every answer. Quote it when you contact support.

X-RateLimit-Limitinteger Guide

Requests allowed per minute with this API key.

X-RateLimit-Remaininginteger Guide

Requests left in the current minute.

X-RateLimit-Resetinteger Guide

When the current minute ends and the count starts again, in Unix seconds.

401

No API key, or one that is not valid or has been revoked (unauthorized).

429

Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.

Every error has the same body: {"error": {"code", "message", "details", "requestId"}}. See Errors.

Start an import job

POST/v1/imports

For 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())
Response · 201
{
  "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#

Idempotency-Keystring Guide

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.

Limits: up to 200 characters.

Example "2b5c4f8e-order-1042".

Request body#

application/json · required

filenamestring

The file name, for your records (up to 200 characters).

totalRowsinteger

How many rows the file has, so progress can be shown.

Limits: at least 0.

listIdstringuuid

Put everyone in the import on this existing list.

newListNamestring

Create a new list with this name and put everyone on it. Takes precedence over listId.

consentobjectrequired
Child fields
attestedbooleanrequired

Must be true: you confirm everyone in the file agreed to receive your texts.

Always true.

sourcestring

Where they agreed, up to 120 characters (default CSV import).

Example request body
Request body
{
  "filename": "pos-customers.csv",
  "totalRows": 2503,
  "newListName": "Point of sale signups",
  "consent": {
    "attested": true,
    "source": "Checkout opt-in box"
  }
}

Responses#

201

The new job.

application/json

importobjectrequired

An import job: a large file sent in batches, with running totals.

Child fields
idstringuuidrequired

The import id.

account_idstringuuidrequired

Your account id.

filenamestringrequired

The file name you gave (default contacts.csv).

list_idstringuuidnullablerequired

The list everyone in the import is put on.

list_namestringnullablerequired

That list's name.

consent_sourcestringrequired

Where the people agreed to your texts (default CSV import).

statusstringrequired

running until you finish it.

One of "running", "done", "failed".

total_rowsintegerrequired

Rows in the file, as you said when starting (for showing progress).

processedintegerrequired

Rows sent so far.

createdintegerrequired

New contacts so far.

updatedintegerrequired

Contacts already on file, refreshed.

invalidintegerrequired

Rows skipped for a missing or invalid number.

still_unsubscribedintegerrequired

Updated contacts that had opted out and stay unsubscribed.

created_atstringdate-timerequired

When the import started.

finished_atstringdate-timenullablerequired

When it was finished.

Response headers
X-Request-Idstring Guide

The id of this request (req_...), on every answer. Quote it when you contact support.

X-RateLimit-Limitinteger Guide

Requests allowed per minute with this API key.

X-RateLimit-Remaininginteger Guide

Requests left in the current minute.

X-RateLimit-Resetinteger Guide

When the current minute ends and the count starts again, in Unix seconds.

Idempotent-Replayedstring Guide

true when this is the stored answer to an earlier request with the same Idempotency-Key, not a new one.

One of "true".

400

The request was refused because something in it is not valid. error.code is one of:

  • consent_required: consent.attested is not true.
  • invalid_name: newListName is empty after trimming.
  • invalid_json: The body is not a JSON object.
  • invalid_idempotency_key: The Idempotency-Key header is longer than 200 characters.
401

No API key, or one that is not valid or has been revoked (unauthorized).

404

Something the request names does not exist in your account. error.code is one of:

  • not_found: The list in listId does not exist.
409

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.
413

The body is too large. error.code is one of:

  • too_large: The body is larger than 12 MB.
422

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.

429

Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.

Every error has the same body: {"error": {"code", "message", "details", "requestId"}}. See Errors.

Get an import job

GET/v1/imports/{id}

One import job and its running totals.

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())
Response · 200
{
  "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#

idstringuuidrequired

The import id.

Responses#

200

The job.

application/json

importobjectrequired

An import job: a large file sent in batches, with running totals.

Child fields
idstringuuidrequired

The import id.

account_idstringuuidrequired

Your account id.

filenamestringrequired

The file name you gave (default contacts.csv).

list_idstringuuidnullablerequired

The list everyone in the import is put on.

list_namestringnullablerequired

That list's name.

consent_sourcestringrequired

Where the people agreed to your texts (default CSV import).

statusstringrequired

running until you finish it.

One of "running", "done", "failed".

total_rowsintegerrequired

Rows in the file, as you said when starting (for showing progress).

processedintegerrequired

Rows sent so far.

createdintegerrequired

New contacts so far.

updatedintegerrequired

Contacts already on file, refreshed.

invalidintegerrequired

Rows skipped for a missing or invalid number.

still_unsubscribedintegerrequired

Updated contacts that had opted out and stay unsubscribed.

created_atstringdate-timerequired

When the import started.

finished_atstringdate-timenullablerequired

When it was finished.

Response headers
X-Request-Idstring Guide

The id of this request (req_...), on every answer. Quote it when you contact support.

X-RateLimit-Limitinteger Guide

Requests allowed per minute with this API key.

X-RateLimit-Remaininginteger Guide

Requests left in the current minute.

X-RateLimit-Resetinteger Guide

When the current minute ends and the count starts again, in Unix seconds.

401

No API key, or one that is not valid or has been revoked (unauthorized).

404

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.
429

Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.

Every error has the same body: {"error": {"code", "message", "details", "requestId"}}. See Errors.

Send a batch of rows

POST/v1/imports/{id}/rows

Adds 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())
Response · 200
{
  "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#

idstringuuidrequired

The import id.

Headers#

Idempotency-Keystring Guide

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.

Limits: up to 200 characters.

Example "2b5c4f8e-order-1042".

Request body#

application/json · required

rowsarray of objectsrequired

Up to 5,000 rows.

Limits: 1 to 5000 items.

Fields of each item
phonestring

A 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.

firstNamestring

First name, up to 120 characters.

lastNamestring

Last name, up to 120 characters.

emailstring

Email address. One that does not look like an email address is left out (stored as empty).

timezonestring

IANA time zone such as America/Chicago. One we do not recognise is left out.

fieldsobject

Custom fields. Values are stored as text; empty values are left out. Up to 30 fields, names up to 60 characters, values up to 500.

Any keys, each with a string or number or boolean value.

offsetinteger

The position of the first row of this batch in the file, so invalid[].row points at the right line. Default 0.

Limits: at least 0.

Example request body
Request body
{
  "rows": [
    {
      "phone": "415-555-0101",
      "firstName": "Alice",
      "lastName": "Moreno"
    },
    {
      "phone": "n/a",
      "firstName": "Dana"
    }
  ],
  "offset": 2000
}

Responses#

200

What the batch did.

application/json

createdintegerrequired

New contacts added from this batch.

updatedintegerrequired

Contacts already on file, refreshed from this batch.

stillUnsubscribedintegerrequired

Of those, contacts that had opted out and stay unsubscribed.

invalidarray of objectsrequired

Rows of this batch that were skipped.

Fields of each item
rowintegerrequired

Row number in the file (offset plus the position in this batch).

phonestringrequired

The phone value as sent.

reasonstringrequired

Why it was skipped.

jobobjectrequired

An import job: a large file sent in batches, with running totals.

Child fields
idstringuuidrequired

The import id.

account_idstringuuidrequired

Your account id.

filenamestringrequired

The file name you gave (default contacts.csv).

list_idstringuuidnullablerequired

The list everyone in the import is put on.

list_namestringnullablerequired

That list's name.

consent_sourcestringrequired

Where the people agreed to your texts (default CSV import).

statusstringrequired

running until you finish it.

One of "running", "done", "failed".

total_rowsintegerrequired

Rows in the file, as you said when starting (for showing progress).

processedintegerrequired

Rows sent so far.

createdintegerrequired

New contacts so far.

updatedintegerrequired

Contacts already on file, refreshed.

invalidintegerrequired

Rows skipped for a missing or invalid number.

still_unsubscribedintegerrequired

Updated contacts that had opted out and stay unsubscribed.

created_atstringdate-timerequired

When the import started.

finished_atstringdate-timenullablerequired

When it was finished.

Response headers
X-Request-Idstring Guide

The id of this request (req_...), on every answer. Quote it when you contact support.

X-RateLimit-Limitinteger Guide

Requests allowed per minute with this API key.

X-RateLimit-Remaininginteger Guide

Requests left in the current minute.

X-RateLimit-Resetinteger Guide

When the current minute ends and the count starts again, in Unix seconds.

Idempotent-Replayedstring Guide

true when this is the stored answer to an earlier request with the same Idempotency-Key, not a new one.

One of "true".

400

The request was refused because something in it is not valid. error.code is one of:

  • no_contacts: rows is 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.
401

No API key, or one that is not valid or has been revoked (unauthorized).

404

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.
409

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.
413

The body is too large. error.code is one of:

  • too_large: The body is larger than 12 MB.
422

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.

429

Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.

Every error has the same body: {"error": {"code", "message", "details", "requestId"}}. See Errors.

Finish an import job

POST/v1/imports/{id}/finish

Marks 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())
Response · 200
{
  "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#

idstringuuidrequired

The import id.

Headers#

Idempotency-Keystring Guide

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.

Limits: up to 200 characters.

Example "2b5c4f8e-order-1042".

Request body#

application/json

failedboolean

true marks the import failed (for example the upload was abandoned) instead of done.

Example request body
Request body
{}

Responses#

200

The finished job.

application/json

importobjectrequired

An import job: a large file sent in batches, with running totals.

Child fields
idstringuuidrequired

The import id.

account_idstringuuidrequired

Your account id.

filenamestringrequired

The file name you gave (default contacts.csv).

list_idstringuuidnullablerequired

The list everyone in the import is put on.

list_namestringnullablerequired

That list's name.

consent_sourcestringrequired

Where the people agreed to your texts (default CSV import).

statusstringrequired

running until you finish it.

One of "running", "done", "failed".

total_rowsintegerrequired

Rows in the file, as you said when starting (for showing progress).

processedintegerrequired

Rows sent so far.

createdintegerrequired

New contacts so far.

updatedintegerrequired

Contacts already on file, refreshed.

invalidintegerrequired

Rows skipped for a missing or invalid number.

still_unsubscribedintegerrequired

Updated contacts that had opted out and stay unsubscribed.

created_atstringdate-timerequired

When the import started.

finished_atstringdate-timenullablerequired

When it was finished.

Response headers
X-Request-Idstring Guide

The id of this request (req_...), on every answer. Quote it when you contact support.

X-RateLimit-Limitinteger Guide

Requests allowed per minute with this API key.

X-RateLimit-Remaininginteger Guide

Requests left in the current minute.

X-RateLimit-Resetinteger Guide

When the current minute ends and the count starts again, in Unix seconds.

Idempotent-Replayedstring Guide

true when this is the stored answer to an earlier request with the same Idempotency-Key, not a new one.

One of "true".

400

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.
401

No API key, or one that is not valid or has been revoked (unauthorized).

404

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.
409

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.
413

The body is too large. error.code is one of:

  • too_large: The body is larger than 12 MB.
422

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.

429

Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.

Every error has the same body: {"error": {"code", "message", "details", "requestId"}}. See Errors.