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

API reference

Forms

Signup forms that grow your list from the web. Each form has a hosted page (https://app.smsblast.net/f/{publicId}) and an embed code for your own website: <script async src="https://app.smsblast.net/embed/form.js" data-smsblast-form="PUBLIC_ID"></script>, with data-mode="popup" added for a popup. Manage forms with your API key; the two /v1/public/forms/{publicId} endpoints need no key and are for browsers, if you build your own form.

Submitting a form is the person's opt-in: the exact consent wording they saw is stored with the signup, with the page, time, IP address and browser, as carriers and the law ask. New subscribers get the form's welcome text and start workflows. A form never undoes an opt-out: someone who texted STOP must text START from their own phone to rejoin.

List signup forms

GET/v1/forms

All your signup forms, newest first, with their views and signups.

Request

curl https://app.smsblast.net/v1/forms \
  -H "Authorization: Bearer $SMSBLAST_API_KEY"
const res = await fetch('https://app.smsblast.net/v1/forms', {
  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/forms",
    headers={
        "Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
    },
)
print(res.status_code, res.json())
Response · 200
{
  "forms": [
    {
      "id": "a7c9e1b3-5d7f-4a9c-8e1b-3d5f7a9c1e2f",
      "publicId": "Rk4xT9vQ",
      "name": "Website footer",
      "title": "Get texts from Corner Bakery",
      "description": "Fresh bread alerts and a free cookie on your birthday.",
      "buttonLabel": "Sign up",
      "successMessage": "You're in! Watch for a text from us shortly.",
      "fields": [
        "first_name",
        "birthday"
      ],
      "consentText": "By signing up, you agree to receive recurring automated marketing text messages from Corner Bakery at the number provided. Consent is not a condition of purchase. Msg frequency varies. Msg & data rates may apply. Reply HELP for help and STOP to cancel.",
      "listId": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30",
      "welcomeText": "Corner Bakery: Thanks for joining our texts! Msg frequency varies. Msg & data rates may apply. Reply HELP for help, STOP to cancel.",
      "popup": {
        "delaySeconds": 5,
        "exitIntent": true,
        "showOnMobile": true,
        "frequencyDays": 7
      },
      "style": {
        "accent": "#B5562B",
        "theme": "light"
      },
      "enabled": true,
      "views": 5120,
      "submissions": 214,
      "createdAt": "2026-11-03T17:45:20.118Z",
      "updatedAt": "2026-11-15T21:02:09.640Z"
    }
  ]
}

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

Responses#

200

Your forms.

application/json

formsarray of objectsrequired

Newest first.

Fields of each item
idstringuuidrequired

The form id.

publicIdstringrequired

The short public id in the hosted page address (https://app.smsblast.net/f/{publicId}), the embed code and the public form endpoints.

namestringrequired

Name, for you only. It is also recorded as the source of contacts who sign up (form:<name>).

titlestringrequired

The heading people see.

descriptionstringnullablerequired

The text under the heading.

buttonLabelstringrequired

The button text.

successMessagestringrequired

What people see after signing up.

fieldsarray of stringsrequired

The fields asked for besides the mobile number (always asked).

Each one of "first_name", "last_name", "email", "birthday", "zip".

consentTextstringrequired

The consent wording shown beside the button. It must say how to stop the texts (mention STOP). The exact wording is stored with every signup as proof of consent.

listIdstringuuidnullablerequired

The list people who sign up are put on.

welcomeTextstringnullablerequired

The text sent right after someone new signs up (empty: none), when your account can send. Your business name is put in front when it does not already mention it. It costs credits like any text.

popupobjectrequired

How the popup version behaves (embed code with data-mode="popup").

Child fields
delaySecondsintegerrequired

Seconds after the page opens before the popup shows, 0 to 600. Default 5.

Limits: 0 to 600.

exitIntentbooleanrequired

Also show it when the visitor moves to leave the page. Default true.

showOnMobilebooleanrequired

Show it on phones too. Default true.

frequencyDaysintegerrequired

Days before showing it again to someone who closed it, 0 to 365. Default 7.

Limits: 0 to 365.

styleobjectrequired

How the form looks.

Child fields
accentstringrequired

Button and accent colour, #RRGGBB. Default #0297DE; anything else is replaced by the default.

Pattern "^#[0-9a-fA-F]{6}$".

themestringrequired

Light or dark. Default light.

One of "light", "dark".

enabledbooleanrequired

Whether the form takes signups. A form that is switched off is not shown anywhere.

viewsintegerrequired

Times the form was shown.

submissionsintegerrequired

Signups received (including people who were already subscribed).

createdAtstringdate-timerequired

When it was created.

updatedAtstringdate-timerequired

When it was last changed.

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.

Create a signup form

POST/v1/forms

Creates a signup form, switched on at once (unless enabled: false). Every field is optional and has a sensible default, including consent wording that names your business. Up to 50 forms per account.

People can then sign up on the hosted page https://app.smsblast.net/f/{publicId}, or on your own website with the embed code <script async src="https://app.smsblast.net/embed/form.js" data-smsblast-form="PUBLIC_ID"></script> (add data-mode="popup" for a popup). To build your own form, use the public endpoints under /v1/public/forms/{publicId}.

The consent wording and the welcome text must both say how to stop the texts (mention STOP).

Request

curl -X POST https://app.smsblast.net/v1/forms \
  -H "Authorization: Bearer $SMSBLAST_API_KEY" \
  -H "Idempotency-Key: $(openssl rand -hex 16)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Website footer",
    "description": "Fresh bread alerts and a free cookie on your birthday.",
    "fields": [
      "first_name",
      "birthday"
    ],
    "listId": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30",
    "style": {
      "accent": "#B5562B",
      "theme": "light"
    }
  }'
const res = await fetch('https://app.smsblast.net/v1/forms', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.SMSBLAST_API_KEY}`,
    'Idempotency-Key': crypto.randomUUID(),
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Website footer',
    description: 'Fresh bread alerts and a free cookie on your birthday.',
    fields: ['first_name', 'birthday'],
    listId: 'e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30',
    style: {
      accent: '#B5562B',
      theme: 'light',
    },
  }),
});
console.log(res.status, await res.json());
import os
import uuid

import requests

res = requests.post(
    "https://app.smsblast.net/v1/forms",
    headers={
        "Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "name": "Website footer",
        "description": "Fresh bread alerts and a free cookie on your birthday.",
        "fields": ["first_name", "birthday"],
        "listId": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30",
        "style": {
            "accent": "#B5562B",
            "theme": "light",
        },
    },
)
print(res.status_code, res.json())
Response · 201
{
  "form": {
    "id": "a7c9e1b3-5d7f-4a9c-8e1b-3d5f7a9c1e2f",
    "publicId": "Rk4xT9vQ",
    "name": "Website footer",
    "title": "Get texts from Corner Bakery",
    "description": "Fresh bread alerts and a free cookie on your birthday.",
    "buttonLabel": "Sign up",
    "successMessage": "You're in! Watch for a text from us shortly.",
    "fields": [
      "first_name",
      "birthday"
    ],
    "consentText": "By signing up, you agree to receive recurring automated marketing text messages from Corner Bakery at the number provided. Consent is not a condition of purchase. Msg frequency varies. Msg & data rates may apply. Reply HELP for help and STOP to cancel.",
    "listId": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30",
    "welcomeText": "Corner Bakery: Thanks for joining our texts! Msg frequency varies. Msg & data rates may apply. Reply HELP for help, STOP to cancel.",
    "popup": {
      "delaySeconds": 5,
      "exitIntent": true,
      "showOnMobile": true,
      "frequencyDays": 7
    },
    "style": {
      "accent": "#B5562B",
      "theme": "light"
    },
    "enabled": true,
    "views": 0,
    "submissions": 0,
    "createdAt": "2026-11-03T17:45:20.118Z",
    "updatedAt": "2026-11-03T17:45:20.118Z"
  }
}

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

Every field is optional. On create, missing fields get their defaults; on update, only the fields you send change.

namestring

Name, for you, up to 120 characters. Default "Signup form".

titlestring

Heading, up to 120 characters. Default "Get texts from <your business name>".

descriptionstringnullable

Text under the heading, up to 500 characters; empty for none. Default "Be the first to hear about deals and news."

buttonLabelstring

Button text, up to 40 characters. Default "Sign up".

successMessagestring

Shown after signing up, up to 300 characters. Default "You're in! Watch for a text from us shortly."

fieldsarray of strings

Fields to ask for besides the mobile number. Default ["first_name"].

Each one of "first_name", "last_name", "email", "birthday", "zip".

consentTextstring

Consent wording, up to 1,000 characters. It must mention STOP. Default: a standard wording naming your business ("By signing up, you agree to receive recurring automated marketing text messages from ... Reply HELP for help and STOP to cancel.").

listIdstringuuidnullable

Put people who sign up on this list; null for none.

welcomeTextstringnullable

Text sent right after signing up, up to 640 characters; it must mention STOP. null or empty for none. Default "<business>: Thanks for joining our texts! Msg frequency varies. Msg & data rates may apply. Reply HELP for help, STOP to cancel."

popupobject

Popup settings. When sent, settings you leave out go back to their defaults (not to their current values), so send all four.

Child fields
delaySecondsinteger

0 to 600.

exitIntentboolean

Show when leaving the page.

showOnMobileboolean

Show on phones.

frequencyDaysinteger

0 to 365.

styleobject

Look. When sent, a value left out goes back to its default.

Child fields
accentstring

#RRGGBB.

themestring

Theme.

One of "light", "dark".

enabledboolean

false switches the form off. Default true.

Example request body
Request body
{
  "name": "Website footer",
  "description": "Fresh bread alerts and a free cookie on your birthday.",
  "fields": [
    "first_name",
    "birthday"
  ],
  "listId": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30",
  "style": {
    "accent": "#B5562B",
    "theme": "light"
  }
}

Responses#

201

The new form.

application/json

formobjectrequired

A signup form. Field names are camelCase.

Child fields
idstringuuidrequired

The form id.

publicIdstringrequired

The short public id in the hosted page address (https://app.smsblast.net/f/{publicId}), the embed code and the public form endpoints.

namestringrequired

Name, for you only. It is also recorded as the source of contacts who sign up (form:<name>).

titlestringrequired

The heading people see.

descriptionstringnullablerequired

The text under the heading.

buttonLabelstringrequired

The button text.

successMessagestringrequired

What people see after signing up.

fieldsarray of stringsrequired

The fields asked for besides the mobile number (always asked).

Each one of "first_name", "last_name", "email", "birthday", "zip".

consentTextstringrequired

The consent wording shown beside the button. It must say how to stop the texts (mention STOP). The exact wording is stored with every signup as proof of consent.

listIdstringuuidnullablerequired

The list people who sign up are put on.

welcomeTextstringnullablerequired

The text sent right after someone new signs up (empty: none), when your account can send. Your business name is put in front when it does not already mention it. It costs credits like any text.

popupobjectrequired

How the popup version behaves (embed code with data-mode="popup").

Child fields
delaySecondsintegerrequired

Seconds after the page opens before the popup shows, 0 to 600. Default 5.

Limits: 0 to 600.

exitIntentbooleanrequired

Also show it when the visitor moves to leave the page. Default true.

showOnMobilebooleanrequired

Show it on phones too. Default true.

frequencyDaysintegerrequired

Days before showing it again to someone who closed it, 0 to 365. Default 7.

Limits: 0 to 365.

styleobjectrequired

How the form looks.

Child fields
accentstringrequired

Button and accent colour, #RRGGBB. Default #0297DE; anything else is replaced by the default.

Pattern "^#[0-9a-fA-F]{6}$".

themestringrequired

Light or dark. Default light.

One of "light", "dark".

enabledbooleanrequired

Whether the form takes signups. A form that is switched off is not shown anywhere.

viewsintegerrequired

Times the form was shown.

submissionsintegerrequired

Signups received (including people who were already subscribed).

createdAtstringdate-timerequired

When it was created.

updatedAtstringdate-timerequired

When it was last changed.

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_fields: fields is not a list, or names an unknown field.
  • invalid_consent: consentText does not mention STOP.
  • invalid_welcome: welcomeText does not mention STOP.
  • 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:

  • too_many_forms: You already have 50 forms.
  • 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 signup form

GET/v1/forms/{id}

One signup form, with its views and signups.

Request

curl https://app.smsblast.net/v1/forms/a7c9e1b3-5d7f-4a9c-8e1b-3d5f7a9c1e2f \
  -H "Authorization: Bearer $SMSBLAST_API_KEY"
const res = await fetch('https://app.smsblast.net/v1/forms/a7c9e1b3-5d7f-4a9c-8e1b-3d5f7a9c1e2f', {
  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/forms/a7c9e1b3-5d7f-4a9c-8e1b-3d5f7a9c1e2f",
    headers={
        "Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
    },
)
print(res.status_code, res.json())
Response · 200
{
  "form": {
    "id": "a7c9e1b3-5d7f-4a9c-8e1b-3d5f7a9c1e2f",
    "publicId": "Rk4xT9vQ",
    "name": "Website footer",
    "title": "Get texts from Corner Bakery",
    "description": "Fresh bread alerts and a free cookie on your birthday.",
    "buttonLabel": "Sign up",
    "successMessage": "You're in! Watch for a text from us shortly.",
    "fields": [
      "first_name",
      "birthday"
    ],
    "consentText": "By signing up, you agree to receive recurring automated marketing text messages from Corner Bakery at the number provided. Consent is not a condition of purchase. Msg frequency varies. Msg & data rates may apply. Reply HELP for help and STOP to cancel.",
    "listId": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30",
    "welcomeText": "Corner Bakery: Thanks for joining our texts! Msg frequency varies. Msg & data rates may apply. Reply HELP for help, STOP to cancel.",
    "popup": {
      "delaySeconds": 5,
      "exitIntent": true,
      "showOnMobile": true,
      "frequencyDays": 7
    },
    "style": {
      "accent": "#B5562B",
      "theme": "light"
    },
    "enabled": true,
    "views": 5120,
    "submissions": 214,
    "createdAt": "2026-11-03T17:45:20.118Z",
    "updatedAt": "2026-11-15T21:02:09.640Z"
  }
}

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

Path parameters#

idstringuuidrequired

The form id.

Responses#

200

The form.

application/json

formobjectrequired

A signup form. Field names are camelCase.

Child fields
idstringuuidrequired

The form id.

publicIdstringrequired

The short public id in the hosted page address (https://app.smsblast.net/f/{publicId}), the embed code and the public form endpoints.

namestringrequired

Name, for you only. It is also recorded as the source of contacts who sign up (form:<name>).

titlestringrequired

The heading people see.

descriptionstringnullablerequired

The text under the heading.

buttonLabelstringrequired

The button text.

successMessagestringrequired

What people see after signing up.

fieldsarray of stringsrequired

The fields asked for besides the mobile number (always asked).

Each one of "first_name", "last_name", "email", "birthday", "zip".

consentTextstringrequired

The consent wording shown beside the button. It must say how to stop the texts (mention STOP). The exact wording is stored with every signup as proof of consent.

listIdstringuuidnullablerequired

The list people who sign up are put on.

welcomeTextstringnullablerequired

The text sent right after someone new signs up (empty: none), when your account can send. Your business name is put in front when it does not already mention it. It costs credits like any text.

popupobjectrequired

How the popup version behaves (embed code with data-mode="popup").

Child fields
delaySecondsintegerrequired

Seconds after the page opens before the popup shows, 0 to 600. Default 5.

Limits: 0 to 600.

exitIntentbooleanrequired

Also show it when the visitor moves to leave the page. Default true.

showOnMobilebooleanrequired

Show it on phones too. Default true.

frequencyDaysintegerrequired

Days before showing it again to someone who closed it, 0 to 365. Default 7.

Limits: 0 to 365.

styleobjectrequired

How the form looks.

Child fields
accentstringrequired

Button and accent colour, #RRGGBB. Default #0297DE; anything else is replaced by the default.

Pattern "^#[0-9a-fA-F]{6}$".

themestringrequired

Light or dark. Default light.

One of "light", "dark".

enabledbooleanrequired

Whether the form takes signups. A form that is switched off is not shown anywhere.

viewsintegerrequired

Times the form was shown.

submissionsintegerrequired

Signups received (including people who were already subscribed).

createdAtstringdate-timerequired

When it was created.

updatedAtstringdate-timerequired

When it was last changed.

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 form 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 signup form

PATCH/v1/forms/{id}

Changes a signup form. Only the fields you send change, except inside popup and style: those objects are replaced, and a setting left out of them goes back to its default. Changes show on the hosted page and every embed at once.

Request

curl -X PATCH https://app.smsblast.net/v1/forms/a7c9e1b3-5d7f-4a9c-8e1b-3d5f7a9c1e2f \
  -H "Authorization: Bearer $SMSBLAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Free cookie on your birthday",
    "enabled": true
  }'
const res = await fetch('https://app.smsblast.net/v1/forms/a7c9e1b3-5d7f-4a9c-8e1b-3d5f7a9c1e2f', {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${process.env.SMSBLAST_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'Free cookie on your birthday',
    enabled: true,
  }),
});
console.log(res.status, await res.json());
import os

import requests

res = requests.patch(
    "https://app.smsblast.net/v1/forms/a7c9e1b3-5d7f-4a9c-8e1b-3d5f7a9c1e2f",
    headers={
        "Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
    },
    json={
        "title": "Free cookie on your birthday",
        "enabled": True,
    },
)
print(res.status_code, res.json())
Response · 200
{
  "form": {
    "id": "a7c9e1b3-5d7f-4a9c-8e1b-3d5f7a9c1e2f",
    "publicId": "Rk4xT9vQ",
    "name": "Website footer",
    "title": "Free cookie on your birthday",
    "description": "Fresh bread alerts and a free cookie on your birthday.",
    "buttonLabel": "Sign up",
    "successMessage": "You're in! Watch for a text from us shortly.",
    "fields": [
      "first_name",
      "birthday"
    ],
    "consentText": "By signing up, you agree to receive recurring automated marketing text messages from Corner Bakery at the number provided. Consent is not a condition of purchase. Msg frequency varies. Msg & data rates may apply. Reply HELP for help and STOP to cancel.",
    "listId": "e3a9c7f2-4b1d-4e8a-9c6f-2d5b7a1e8f30",
    "welcomeText": "Corner Bakery: Thanks for joining our texts! Msg frequency varies. Msg & data rates may apply. Reply HELP for help, STOP to cancel.",
    "popup": {
      "delaySeconds": 5,
      "exitIntent": true,
      "showOnMobile": true,
      "frequencyDays": 7
    },
    "style": {
      "accent": "#B5562B",
      "theme": "light"
    },
    "enabled": true,
    "views": 5120,
    "submissions": 214,
    "createdAt": "2026-11-03T17:45:20.118Z",
    "updatedAt": "2026-11-22T16:20:41.300Z"
  }
}

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

Path parameters#

idstringuuidrequired

The form id.

Request body#

application/json · required

Every field is optional. On create, missing fields get their defaults; on update, only the fields you send change.

namestring

Name, for you, up to 120 characters. Default "Signup form".

titlestring

Heading, up to 120 characters. Default "Get texts from <your business name>".

descriptionstringnullable

Text under the heading, up to 500 characters; empty for none. Default "Be the first to hear about deals and news."

buttonLabelstring

Button text, up to 40 characters. Default "Sign up".

successMessagestring

Shown after signing up, up to 300 characters. Default "You're in! Watch for a text from us shortly."

fieldsarray of strings

Fields to ask for besides the mobile number. Default ["first_name"].

Each one of "first_name", "last_name", "email", "birthday", "zip".

consentTextstring

Consent wording, up to 1,000 characters. It must mention STOP. Default: a standard wording naming your business ("By signing up, you agree to receive recurring automated marketing text messages from ... Reply HELP for help and STOP to cancel.").

listIdstringuuidnullable

Put people who sign up on this list; null for none.

welcomeTextstringnullable

Text sent right after signing up, up to 640 characters; it must mention STOP. null or empty for none. Default "<business>: Thanks for joining our texts! Msg frequency varies. Msg & data rates may apply. Reply HELP for help, STOP to cancel."

popupobject

Popup settings. When sent, settings you leave out go back to their defaults (not to their current values), so send all four.

Child fields
delaySecondsinteger

0 to 600.

exitIntentboolean

Show when leaving the page.

showOnMobileboolean

Show on phones.

frequencyDaysinteger

0 to 365.

styleobject

Look. When sent, a value left out goes back to its default.

Child fields
accentstring

#RRGGBB.

themestring

Theme.

One of "light", "dark".

enabledboolean

false switches the form off. Default true.

Example request body
Request body
{
  "title": "Free cookie on your birthday",
  "enabled": true
}

Responses#

200

The form.

application/json

formobjectrequired

A signup form. Field names are camelCase.

Child fields
idstringuuidrequired

The form id.

publicIdstringrequired

The short public id in the hosted page address (https://app.smsblast.net/f/{publicId}), the embed code and the public form endpoints.

namestringrequired

Name, for you only. It is also recorded as the source of contacts who sign up (form:<name>).

titlestringrequired

The heading people see.

descriptionstringnullablerequired

The text under the heading.

buttonLabelstringrequired

The button text.

successMessagestringrequired

What people see after signing up.

fieldsarray of stringsrequired

The fields asked for besides the mobile number (always asked).

Each one of "first_name", "last_name", "email", "birthday", "zip".

consentTextstringrequired

The consent wording shown beside the button. It must say how to stop the texts (mention STOP). The exact wording is stored with every signup as proof of consent.

listIdstringuuidnullablerequired

The list people who sign up are put on.

welcomeTextstringnullablerequired

The text sent right after someone new signs up (empty: none), when your account can send. Your business name is put in front when it does not already mention it. It costs credits like any text.

popupobjectrequired

How the popup version behaves (embed code with data-mode="popup").

Child fields
delaySecondsintegerrequired

Seconds after the page opens before the popup shows, 0 to 600. Default 5.

Limits: 0 to 600.

exitIntentbooleanrequired

Also show it when the visitor moves to leave the page. Default true.

showOnMobilebooleanrequired

Show it on phones too. Default true.

frequencyDaysintegerrequired

Days before showing it again to someone who closed it, 0 to 365. Default 7.

Limits: 0 to 365.

styleobjectrequired

How the form looks.

Child fields
accentstringrequired

Button and accent colour, #RRGGBB. Default #0297DE; anything else is replaced by the default.

Pattern "^#[0-9a-fA-F]{6}$".

themestringrequired

Light or dark. Default light.

One of "light", "dark".

enabledbooleanrequired

Whether the form takes signups. A form that is switched off is not shown anywhere.

viewsintegerrequired

Times the form was shown.

submissionsintegerrequired

Signups received (including people who were already subscribed).

createdAtstringdate-timerequired

When it was created.

updatedAtstringdate-timerequired

When it was last changed.

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_fields: fields is not a list, or names an unknown field.
  • invalid_consent: consentText does not mention STOP.
  • invalid_welcome: welcomeText does not mention STOP.
  • 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 form with that id, or the list in listId 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.

Delete a signup form

DELETE/v1/forms/{id}

Deletes a signup form. Its hosted page and embeds stop working. Contacts who signed up with it, and their consent records, are kept.

Request

curl -X DELETE https://app.smsblast.net/v1/forms/a7c9e1b3-5d7f-4a9c-8e1b-3d5f7a9c1e2f \
  -H "Authorization: Bearer $SMSBLAST_API_KEY"
const res = await fetch('https://app.smsblast.net/v1/forms/a7c9e1b3-5d7f-4a9c-8e1b-3d5f7a9c1e2f', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.SMSBLAST_API_KEY}`,
  },
});
console.log(res.status, await res.json());
import os

import requests

res = requests.delete(
    "https://app.smsblast.net/v1/forms/a7c9e1b3-5d7f-4a9c-8e1b-3d5f7a9c1e2f",
    headers={
        "Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
    },
)
print(res.status_code, res.json())
Response · 200
{
  "ok": true
}

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

Path parameters#

idstringuuidrequired

The form id.

Responses#

200

Deleted.

application/json

okbooleanrequired

Always true.

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

Show a form (public)

GET/v1/public/forms/{publicId}

What a web page needs to show one of your signup forms: title, fields, consent wording, links to your terms and privacy pages, look and popup settings. No API key: this is meant to be called from a browser on any website (it allows every origin). Add ?view=1 to count a view.

The hosted page and the embed code (<script async src="https://app.smsblast.net/embed/form.js" data-smsblast-form="PUBLIC_ID"></script>) already do this for you.

Request

curl https://app.smsblast.net/v1/public/forms/Rk4xT9vQ
const res = await fetch('https://app.smsblast.net/v1/public/forms/Rk4xT9vQ');
console.log(res.status, await res.json());
import requests

res = requests.get(
    "https://app.smsblast.net/v1/public/forms/Rk4xT9vQ",
)
print(res.status_code, res.json())
Response · 200
{
  "form": {
    "publicId": "Rk4xT9vQ",
    "business": "Corner Bakery",
    "title": "Get texts from Corner Bakery",
    "description": "Fresh bread alerts and a free cookie on your birthday.",
    "buttonLabel": "Sign up",
    "successMessage": "You're in! Watch for a text from us shortly.",
    "fields": [
      "first_name",
      "birthday"
    ],
    "consentText": "By signing up, you agree to receive recurring automated marketing text messages from Corner Bakery at the number provided. Consent is not a condition of purchase. Msg frequency varies. Msg & data rates may apply. Reply HELP for help and STOP to cancel.",
    "termsUrl": "https://app.smsblast.net/legal/cb7Kq2/terms",
    "privacyUrl": "https://app.smsblast.net/legal/cb7Kq2/privacy",
    "popup": {
      "delaySeconds": 5,
      "exitIntent": true,
      "showOnMobile": true,
      "frequencyDays": 7
    },
    "style": {
      "accent": "#B5562B",
      "theme": "light"
    }
  }
}

No API key needed: this endpoint is meant to be called from a web page.

Path parameters#

publicIdstringrequired

The form's publicId.

Query parameters#

viewstring

1 counts this as a view of the form.

One of "1".

Responses#

200

The form.

application/json

formobjectrequired

What a page needs to show a form: no private details.

Child fields
publicIdstringrequired

The form's public id.

businessstringrequired

Your business name.

titlestringrequired

The heading.

descriptionstringnullablerequired

The text under the heading.

buttonLabelstringrequired

The button text.

successMessagestringrequired

What to show after signing up.

fieldsarray of stringsrequired

Fields to ask for besides the mobile number.

Each one of "first_name", "last_name", "email", "birthday", "zip".

consentTextstringrequired

The consent wording to show beside the button. Show it exactly: it is what the person agrees to.

termsUrlstringnullablerequired

Your SMS terms page, from your number registration.

privacyUrlstringnullablerequired

Your privacy policy page, from your number registration.

popupobjectrequired

How the popup version behaves (embed code with data-mode="popup").

Child fields
delaySecondsintegerrequired

Seconds after the page opens before the popup shows, 0 to 600. Default 5.

Limits: 0 to 600.

exitIntentbooleanrequired

Also show it when the visitor moves to leave the page. Default true.

showOnMobilebooleanrequired

Show it on phones too. Default true.

frequencyDaysintegerrequired

Days before showing it again to someone who closed it, 0 to 365. Default 7.

Limits: 0 to 365.

styleobjectrequired

How the form looks.

Child fields
accentstringrequired

Button and accent colour, #RRGGBB. Default #0297DE; anything else is replaced by the default.

Pattern "^#[0-9a-fA-F]{6}$".

themestringrequired

Light or dark. Default light.

One of "light", "dark".

Response headers
X-Request-Idstring Guide

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

404

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

  • form_not_found: There is no form with that public id, or it is switched off.

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

Sign up with a form (public)

POST/v1/public/forms/{publicId}

Signs a person up through one of your forms, from your own page or app. No API key: call it from the person's browser (it allows every origin), not from your server, so the proof of consent records their IP address and browser. Submitting is their opt-in: it is stored with the exact consent wording the form shows, the page, the time, their IP address and browser.

  • Someone new becomes a subscribed contact (contact.created and contact.opted_in webhooks) and gets the welcome text right away, if the form has one and your account can send (an approved number, enough credits, and a plan once the free trial is over). Without that the signup is still kept, just with no welcome text.
  • Someone already subscribed only gets empty details filled in; the answer says already_subscribed.
  • A number that opted out is not resubscribed, because anyone can type any number into a form: nothing changes and nothing is texted, and the answer (opted_out) tells the person to text START to your number from their own phone.

New and already subscribed people are put on the form's list (which starts workflows triggered by that list for people new to it), and new subscribers start workflows triggered by subscribing. Only the fields the form asks for are kept. Up to 20 signups per 10 minutes from one IP address.

Request

curl -X POST https://app.smsblast.net/v1/public/forms/Rk4xT9vQ \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "(415) 555-0104",
    "first_name": "Dana",
    "birthday": "04/12",
    "page": "https://example.com/"
  }'
const res = await fetch('https://app.smsblast.net/v1/public/forms/Rk4xT9vQ', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    phone: '(415) 555-0104',
    first_name: 'Dana',
    birthday: '04/12',
    page: 'https://example.com/',
  }),
});
console.log(res.status, await res.json());
import requests

res = requests.post(
    "https://app.smsblast.net/v1/public/forms/Rk4xT9vQ",
    json={
        "phone": "(415) 555-0104",
        "first_name": "Dana",
        "birthday": "04/12",
        "page": "https://example.com/",
    },
)
print(res.status_code, res.json())
Response · 201
{
  "status": "subscribed",
  "message": "You're in! Watch for a text from us shortly."
}

No API key needed: this endpoint is meant to be called from a web page.

Path parameters#

publicIdstringrequired

The form's publicId.

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

first_namestring

First name, up to 80 characters (firstName also works). Kept only when the form asks for it.

last_namestring

Last name, up to 80 characters (lastName also works). Kept only when the form asks for it.

emailstring

Email address. Kept only when the form asks for it; one that does not look valid is refused.

birthdaystring

Birthday as the person typed it, up to 20 characters. Kept (as a custom field) only when the form asks for it.

zipstring

ZIP or postal code, up to 12 characters. Kept (as a custom field) only when the form asks for it.

pagestring

The address of the page the form was on, kept with the proof of consent. Default: the Referer header.

Example request body
Request body
{
  "phone": "(415) 555-0104",
  "first_name": "Dana",
  "birthday": "04/12",
  "page": "https://example.com/"
}

Responses#

201

Signed up.

application/json

statusstringrequired

subscribed: they joined now. already_subscribed: they were already subscribed. opted_out: the number opted out earlier and was not resubscribed; they need to text START from their phone.

One of "subscribed", "already_subscribed", "opted_out".

messagestringrequired

What to show the person: the form's success message, "You're already signed up. Thanks!", or for opted_out "This number unsubscribed from <business> texts earlier. To rejoin, text START to (415) 555-0100 from your phone."

Response headers
X-Request-Idstring Guide

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

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.
  • invalid_email: email does not look like an email address.
  • invalid_json: The body is not a JSON object.
404

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

  • form_not_found: There is no form with that public id, or it is switched off.
429

Too many requests. error.code is one of:

  • rate_limited: More than 20 signups from this IP address in 10 minutes.

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