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.
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()){
"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#
Your forms.
application/json
formsarray of objectsrequiredNewest first.
Fields of each item
idstringuuidrequiredThe form id.
publicIdstringrequiredThe short public id in the hosted page address (https://app.smsblast.net/f/{publicId}), the embed code and the public form endpoints.
namestringrequiredName, for you only. It is also recorded as the source of contacts who sign up (form:<name>).
titlestringrequiredThe heading people see.
descriptionstringnullablerequiredThe text under the heading.
buttonLabelstringrequiredThe button text.
successMessagestringrequiredWhat people see after signing up.
fieldsarray of stringsrequiredThe fields asked for besides the mobile number (always asked).
consentTextstringrequiredThe 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.
listIdstringuuidnullablerequiredThe list people who sign up are put on.
welcomeTextstringnullablerequiredThe 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.
popupobjectrequiredHow the popup version behaves (embed code with data-mode="popup").
Child fields
delaySecondsintegerrequiredSeconds after the page opens before the popup shows, 0 to 600. Default 5.
exitIntentbooleanrequiredAlso show it when the visitor moves to leave the page. Default true.
showOnMobilebooleanrequiredShow it on phones too. Default true.
frequencyDaysintegerrequiredDays before showing it again to someone who closed it, 0 to 365. Default 7.
styleobjectrequiredHow the form looks.
Child fields
accentstringrequiredButton and accent colour, #RRGGBB. Default #0297DE; anything else is replaced by the default.
themestringrequiredLight or dark. Default light.
enabledbooleanrequiredWhether the form takes signups. A form that is switched off is not shown anywhere.
viewsintegerrequiredTimes the form was shown.
submissionsintegerrequiredSignups received (including people who were already subscribed).
createdAtstringdate-timerequiredWhen it was created.
updatedAtstringdate-timerequiredWhen it was last changed.
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
No API key, or one that is not valid or has been revoked (unauthorized).
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.
Create a signup form
/v1/formsCreates 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()){
"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#
Any unique string up to 200 characters (a UUID works well). If a POST times out or you are not sure it went through, send it again with the same key and the same body: you get the first answer back (with Idempotent-Replayed: true) instead of the work being done twice. Keys are kept for 24 hours per account.
Request body#
application/json · required
Every field is optional. On create, missing fields get their defaults; on update, only the fields you send change.
namestringName, for you, up to 120 characters. Default "Signup form".
titlestringHeading, up to 120 characters. Default "Get texts from <your business name>".
descriptionstringnullableText under the heading, up to 500 characters; empty for none. Default "Be the first to hear about deals and news."
buttonLabelstringButton text, up to 40 characters. Default "Sign up".
successMessagestringShown after signing up, up to 300 characters. Default "You're in! Watch for a text from us shortly."
fieldsarray of stringsFields to ask for besides the mobile number. Default ["first_name"].
consentTextstringConsent 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.").
listIdstringuuidnullablePut people who sign up on this list; null for none.
welcomeTextstringnullableText 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."
popupobjectPopup settings. When sent, settings you leave out go back to their defaults (not to their current values), so send all four.
Child fields
delaySecondsinteger0 to 600.
exitIntentbooleanShow when leaving the page.
showOnMobilebooleanShow on phones.
frequencyDaysinteger0 to 365.
styleobjectLook. When sent, a value left out goes back to its default.
Child fields
accentstring#RRGGBB.
themestringTheme.
enabledbooleanfalse switches the form off. Default true.
Example 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#
The new form.
application/json
formobjectrequiredA signup form. Field names are camelCase.
Child fields
idstringuuidrequiredThe form id.
publicIdstringrequiredThe short public id in the hosted page address (https://app.smsblast.net/f/{publicId}), the embed code and the public form endpoints.
namestringrequiredName, for you only. It is also recorded as the source of contacts who sign up (form:<name>).
titlestringrequiredThe heading people see.
descriptionstringnullablerequiredThe text under the heading.
buttonLabelstringrequiredThe button text.
successMessagestringrequiredWhat people see after signing up.
fieldsarray of stringsrequiredThe fields asked for besides the mobile number (always asked).
consentTextstringrequiredThe 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.
listIdstringuuidnullablerequiredThe list people who sign up are put on.
welcomeTextstringnullablerequiredThe 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.
popupobjectrequiredHow the popup version behaves (embed code with data-mode="popup").
Child fields
delaySecondsintegerrequiredSeconds after the page opens before the popup shows, 0 to 600. Default 5.
exitIntentbooleanrequiredAlso show it when the visitor moves to leave the page. Default true.
showOnMobilebooleanrequiredShow it on phones too. Default true.
frequencyDaysintegerrequiredDays before showing it again to someone who closed it, 0 to 365. Default 7.
styleobjectrequiredHow the form looks.
Child fields
accentstringrequiredButton and accent colour, #RRGGBB. Default #0297DE; anything else is replaced by the default.
themestringrequiredLight or dark. Default light.
enabledbooleanrequiredWhether the form takes signups. A form that is switched off is not shown anywhere.
viewsintegerrequiredTimes the form was shown.
submissionsintegerrequiredSignups received (including people who were already subscribed).
createdAtstringdate-timerequiredWhen it was created.
updatedAtstringdate-timerequiredWhen it was last changed.
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
true when this is the stored answer to an earlier request with the same Idempotency-Key, not a new one.
The request was refused because something in it is not valid. error.code is one of:
invalid_fields:fieldsis not a list, or names an unknown field.invalid_consent:consentTextdoes not mention STOP.invalid_welcome:welcomeTextdoes not mention STOP.invalid_json: The body is not a JSON object.invalid_idempotency_key: The Idempotency-Key header is longer than 200 characters.
No API key, or one that is not valid or has been revoked (unauthorized).
Something the request names does not exist in your account. error.code is one of:
not_found: The list inlistIddoes not exist.
The request clashes with the current state of things. error.code is one of:
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.
This Idempotency-Key was already used for a different request (another path or body) in the last 24 hours (idempotency_key_reused). Use a new key for each new request.
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.
Request
curl https://app.smsblast.net/v1/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()){
"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#
idstringuuidrequiredThe form id.
Responses#
The form.
application/json
formobjectrequiredA signup form. Field names are camelCase.
Child fields
idstringuuidrequiredThe form id.
publicIdstringrequiredThe short public id in the hosted page address (https://app.smsblast.net/f/{publicId}), the embed code and the public form endpoints.
namestringrequiredName, for you only. It is also recorded as the source of contacts who sign up (form:<name>).
titlestringrequiredThe heading people see.
descriptionstringnullablerequiredThe text under the heading.
buttonLabelstringrequiredThe button text.
successMessagestringrequiredWhat people see after signing up.
fieldsarray of stringsrequiredThe fields asked for besides the mobile number (always asked).
consentTextstringrequiredThe 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.
listIdstringuuidnullablerequiredThe list people who sign up are put on.
welcomeTextstringnullablerequiredThe 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.
popupobjectrequiredHow the popup version behaves (embed code with data-mode="popup").
Child fields
delaySecondsintegerrequiredSeconds after the page opens before the popup shows, 0 to 600. Default 5.
exitIntentbooleanrequiredAlso show it when the visitor moves to leave the page. Default true.
showOnMobilebooleanrequiredShow it on phones too. Default true.
frequencyDaysintegerrequiredDays before showing it again to someone who closed it, 0 to 365. Default 7.
styleobjectrequiredHow the form looks.
Child fields
accentstringrequiredButton and accent colour, #RRGGBB. Default #0297DE; anything else is replaced by the default.
themestringrequiredLight or dark. Default light.
enabledbooleanrequiredWhether the form takes signups. A form that is switched off is not shown anywhere.
viewsintegerrequiredTimes the form was shown.
submissionsintegerrequiredSignups received (including people who were already subscribed).
createdAtstringdate-timerequiredWhen it was created.
updatedAtstringdate-timerequiredWhen it was last changed.
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
No API key, or one that is not valid or has been revoked (unauthorized).
Something the request names does not exist in your account. error.code is one of:
not_found: No form with that id in your account.
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.
Update a signup form
/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()){
"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#
idstringuuidrequiredThe 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.
namestringName, for you, up to 120 characters. Default "Signup form".
titlestringHeading, up to 120 characters. Default "Get texts from <your business name>".
descriptionstringnullableText under the heading, up to 500 characters; empty for none. Default "Be the first to hear about deals and news."
buttonLabelstringButton text, up to 40 characters. Default "Sign up".
successMessagestringShown after signing up, up to 300 characters. Default "You're in! Watch for a text from us shortly."
fieldsarray of stringsFields to ask for besides the mobile number. Default ["first_name"].
consentTextstringConsent 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.").
listIdstringuuidnullablePut people who sign up on this list; null for none.
welcomeTextstringnullableText 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."
popupobjectPopup settings. When sent, settings you leave out go back to their defaults (not to their current values), so send all four.
Child fields
delaySecondsinteger0 to 600.
exitIntentbooleanShow when leaving the page.
showOnMobilebooleanShow on phones.
frequencyDaysinteger0 to 365.
styleobjectLook. When sent, a value left out goes back to its default.
Child fields
accentstring#RRGGBB.
themestringTheme.
enabledbooleanfalse switches the form off. Default true.
Example request body
{
"title": "Free cookie on your birthday",
"enabled": true
}Responses#
The form.
application/json
formobjectrequiredA signup form. Field names are camelCase.
Child fields
idstringuuidrequiredThe form id.
publicIdstringrequiredThe short public id in the hosted page address (https://app.smsblast.net/f/{publicId}), the embed code and the public form endpoints.
namestringrequiredName, for you only. It is also recorded as the source of contacts who sign up (form:<name>).
titlestringrequiredThe heading people see.
descriptionstringnullablerequiredThe text under the heading.
buttonLabelstringrequiredThe button text.
successMessagestringrequiredWhat people see after signing up.
fieldsarray of stringsrequiredThe fields asked for besides the mobile number (always asked).
consentTextstringrequiredThe 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.
listIdstringuuidnullablerequiredThe list people who sign up are put on.
welcomeTextstringnullablerequiredThe 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.
popupobjectrequiredHow the popup version behaves (embed code with data-mode="popup").
Child fields
delaySecondsintegerrequiredSeconds after the page opens before the popup shows, 0 to 600. Default 5.
exitIntentbooleanrequiredAlso show it when the visitor moves to leave the page. Default true.
showOnMobilebooleanrequiredShow it on phones too. Default true.
frequencyDaysintegerrequiredDays before showing it again to someone who closed it, 0 to 365. Default 7.
styleobjectrequiredHow the form looks.
Child fields
accentstringrequiredButton and accent colour, #RRGGBB. Default #0297DE; anything else is replaced by the default.
themestringrequiredLight or dark. Default light.
enabledbooleanrequiredWhether the form takes signups. A form that is switched off is not shown anywhere.
viewsintegerrequiredTimes the form was shown.
submissionsintegerrequiredSignups received (including people who were already subscribed).
createdAtstringdate-timerequiredWhen it was created.
updatedAtstringdate-timerequiredWhen it was last changed.
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
The request was refused because something in it is not valid. error.code is one of:
invalid_fields:fieldsis not a list, or names an unknown field.invalid_consent:consentTextdoes not mention STOP.invalid_welcome:welcomeTextdoes not mention STOP.invalid_json: The body is not a JSON object.
No API key, or one that is not valid or has been revoked (unauthorized).
Something the request names does not exist in your account. error.code is one of:
not_found: No form with that id, or the list inlistIddoes not exist.
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.
Delete a signup form
/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()){
"ok": true
}Needs an API key: Authorization: Bearer sb_... Authentication
Path parameters#
idstringuuidrequiredThe form id.
Responses#
Deleted.
application/json
okbooleanrequiredResponse headers
The id of this request (req_...), on every answer. Quote it when you contact support.
Requests allowed per minute with this API key.
Requests left in the current minute.
When the current minute ends and the count starts again, in Unix seconds.
No API key, or one that is not valid or has been revoked (unauthorized).
Something the request names does not exist in your account. error.code is one of:
not_found: No form with that id in your account.
Too many requests with this API key (rate_limited). Wait for the number of seconds in Retry-After.
Show a form (public)
/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/Rk4xT9vQconst 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()){
"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#
publicIdstringrequiredThe form's publicId.
Query parameters#
viewstring1 counts this as a view of the form.
Responses#
The form.
application/json
formobjectrequiredWhat a page needs to show a form: no private details.
Child fields
publicIdstringrequiredThe form's public id.
businessstringrequiredYour business name.
titlestringrequiredThe heading.
descriptionstringnullablerequiredThe text under the heading.
buttonLabelstringrequiredThe button text.
successMessagestringrequiredWhat to show after signing up.
fieldsarray of stringsrequiredFields to ask for besides the mobile number.
consentTextstringrequiredThe consent wording to show beside the button. Show it exactly: it is what the person agrees to.
termsUrlstringnullablerequiredYour SMS terms page, from your number registration.
privacyUrlstringnullablerequiredYour privacy policy page, from your number registration.
popupobjectrequiredHow the popup version behaves (embed code with data-mode="popup").
Child fields
delaySecondsintegerrequiredSeconds after the page opens before the popup shows, 0 to 600. Default 5.
exitIntentbooleanrequiredAlso show it when the visitor moves to leave the page. Default true.
showOnMobilebooleanrequiredShow it on phones too. Default true.
frequencyDaysintegerrequiredDays before showing it again to someone who closed it, 0 to 365. Default 7.
styleobjectrequiredHow the form looks.
Child fields
accentstringrequiredButton and accent colour, #RRGGBB. Default #0297DE; anything else is replaced by the default.
themestringrequiredLight or dark. Default light.
Response headers
The id of this request (req_...), on every answer. Quote it when you contact support.
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.
Sign up with a form (public)
/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.createdandcontact.opted_inwebhooks) 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()){
"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#
publicIdstringrequiredThe form's publicId.
Request body#
application/json · required
phonestringrequiredA US or Canada mobile number in any common format (+14155550101, (415) 555-0101, 415-555-0101). Stored and returned in E.164 (+14155550101).
first_namestringFirst name, up to 80 characters (firstName also works). Kept only when the form asks for it.
last_namestringLast name, up to 80 characters (lastName also works). Kept only when the form asks for it.
emailstringEmail address. Kept only when the form asks for it; one that does not look valid is refused.
birthdaystringBirthday as the person typed it, up to 20 characters. Kept (as a custom field) only when the form asks for it.
zipstringZIP or postal code, up to 12 characters. Kept (as a custom field) only when the form asks for it.
pagestringThe address of the page the form was on, kept with the proof of consent. Default: the Referer header.
Example request body
{
"phone": "(415) 555-0104",
"first_name": "Dana",
"birthday": "04/12",
"page": "https://example.com/"
}Responses#
Signed up.
application/json
statusstringrequiredsubscribed: 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.
messagestringrequiredWhat 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
The id of this request (req_...), on every answer. Quote it when you contact support.
The request was refused because something in it is not valid. error.code is one of:
invalid_phone:phoneis not a valid US or Canada mobile number.invalid_email:emaildoes not look like an email address.invalid_json: The body is not a JSON object.
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.
Too many requests. error.code is one of:
rate_limited: More than 20 signups from this IP address in 10 minutes.