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

API reference

Account

Your account: business name, time zone, support contact, credit balance and sending numbers. API keys, billing and number registration are managed in the dashboard.

Get your account

GET/v1/account

Your account, your credit balance and your sending numbers. Only active numbers can send; a number stays pending until its carrier registration is approved in the dashboard.

Request

curl https://app.smsblast.net/v1/account \
  -H "Authorization: Bearer $SMSBLAST_API_KEY"
const res = await fetch('https://app.smsblast.net/v1/account', {
  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/account",
    headers={
        "Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
    },
)
print(res.status_code, res.json())
Response · 200
{
  "account": {
    "id": "5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10",
    "name": "Corner Bakery",
    "timezone": "America/Los_Angeles",
    "support_contact": "help@example.com"
  },
  "credits": 4210,
  "numbers": [
    {
      "id": "b7e2f1a4-3c5d-4e6f-8a9b-0c1d2e3f4a5b",
      "account_id": "5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10",
      "e164": "+14155550100",
      "kind": "10dlc",
      "provider": "telnyx",
      "status": "active"
    }
  ]
}

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

Responses#

200

Your account.

application/json

accountobjectrequired

Your account. Field names are snake_case.

Child fields
idstringuuidrequired

Your account id.

namestringrequired

Your business name. It starts the automatic answers to STOP, HELP and START ("Corner Bakery: You are unsubscribed...").

timezonestringrequired

IANA time zone, used for sending hours when a contact has none and for analytics days.

support_contactstringnullablerequired

How people reach you for help (an email address or phone number). It is included in the automatic answer to HELP.

creditsintegerrequired

Your credit balance.

numbersarray of objectsrequired

Your sending numbers, oldest first.

Fields of each item
idstringuuidrequired

The number id (the fromNumberId of campaigns, the numberId of keywords).

account_idstringuuidrequired

Your account id.

e164stringrequired

The number, E.164 (or 5 to 6 digits for a short code).

kindstringrequired

The kind of number.

One of "toll_free", "10dlc", "short_code".

providerstringrequired

The carrier network partner that sends from it, such as telnyx.

statusstringrequired

Only active numbers send. A number is pending until its carrier registration is approved.

One of "pending", "active", "suspended".

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.

Update your account

PATCH/v1/account

Changes your business name (it starts the automatic STOP, HELP and START answers), your time zone (used for sending hours when a contact has none, and for analytics days) or your support contact (included in the HELP answer). Only the fields you send change.

Request

curl -X PATCH https://app.smsblast.net/v1/account \
  -H "Authorization: Bearer $SMSBLAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "timezone": "America/Los_Angeles",
    "supportContact": "help@example.com"
  }'
const res = await fetch('https://app.smsblast.net/v1/account', {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${process.env.SMSBLAST_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    timezone: 'America/Los_Angeles',
    supportContact: 'help@example.com',
  }),
});
console.log(res.status, await res.json());
import os

import requests

res = requests.patch(
    "https://app.smsblast.net/v1/account",
    headers={
        "Authorization": f"Bearer {os.environ['SMSBLAST_API_KEY']}",
    },
    json={
        "timezone": "America/Los_Angeles",
        "supportContact": "help@example.com",
    },
)
print(res.status_code, res.json())
Response · 200
{
  "account": {
    "id": "5d0c6a2e-8f43-4b8a-9c1d-2e7f4a6b3c10",
    "name": "Corner Bakery",
    "timezone": "America/Los_Angeles",
    "support_contact": "help@example.com"
  }
}

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

Request body#

application/json · required

Only the fields you send change.

namestring

Your business name, up to 120 characters. Empty values are ignored.

timezonestring

IANA time zone, such as America/Los_Angeles.

supportContactstring

How people reach you for help, up to 160 characters. An empty string clears it.

Example request body
Request body
{
  "timezone": "America/Los_Angeles",
  "supportContact": "help@example.com"
}

Responses#

200

Your account.

application/json

accountobjectrequired

Your account. Field names are snake_case.

Child fields
idstringuuidrequired

Your account id.

namestringrequired

Your business name. It starts the automatic answers to STOP, HELP and START ("Corner Bakery: You are unsubscribed...").

timezonestringrequired

IANA time zone, used for sending hours when a contact has none and for analytics days.

support_contactstringnullablerequired

How people reach you for help (an email address or phone number). It is included in the automatic answer to HELP.

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

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.