Developer API

The SMS API, one key and JSON

Send texts automatically from your shop, app or booking system. The API uses the same credit and prices as web sending, with the same number checks.

20,000numbers in one call
120calls a minute
JSONbodies both ways
Monitor showing code in a dark editor

One requestUp to 20,000 numbers

Quick start

Your first request

  1. 01Create a key on the API page of your account. It starts with smk_ and is shown only once.
  2. 02Attach it to each call as Authorization: Bearer <key>.
  3. 03Check the cost with POST /api/v1/quote, then send with POST /api/v1/messages.

Base URL

https://smsmarket.shop/api/v1

Endpoints

Endpoint list

RequestWhat it does
GET /api/v1/balanceRemaining credit in USD
GET /api/v1/countriesPrice per country, no key needed
POST /api/v1/quoteCost, part count and skipped numbers, without sending
POST /api/v1/messagesSend now, or add schedule_at to schedule
GET /api/v1/messagesRecent campaigns, paged with limit and offset
GET /api/v1/messages/{id}One campaign with results by country
POST /api/v1/messages/{id}/cancelCancel a scheduled send before it goes out, with a full refund

Sending

Sending a message

Pass the to field as a JSON array, or as text with one number per line. When numbers have no plus sign, set the country field to their country code, for example us or kr.

FieldMeaning
toRecipients: an array or one number per line, up to 20,000
textMessage text, up to 10 parts
countryOptional. Country code for numbers written without +
schedule_atOptional. A moment 5 minutes to 30 days ahead, as ISO time with a zone (for example 2026-12-01T09:00:00Z) or Unix seconds
client_refOptional. Your own reference, up to 64 characters
Response · 201201 Created
{
  "ok": true,
  "campaign": {
    "id": "K7Q2M9XD4TPA",
    "status": "sending",
    "recipients": 2,
    "parts": 1,
    "encoding": "GSM-7",
    "cost": "0.0101",
    "countries": [
      { "country": "US", "recipients": 1, "cost": "0.0039" },
      { "country": "GB", "recipients": 1, "cost": "0.0062" }
    ]
  },
  "rejected": [],
  "duplicates": 0,
  "opted_out": 0,
  "balance": "49.9899"
}
POST /api/v1/messages
curl -X POST https://smsmarket.shop/api/v1/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": ["+14155550142", "+447400123456"],
    "text": "Your order #A2847 has shipped."
  }'
POST /api/v1/quote
curl -X POST https://smsmarket.shop/api/v1/quote \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "to": ["+14155550142", "+819012345678"], "text": "Hello" }'
Response · 200200 OK
{
  "ok": true,
  "recipients": 2,
  "parts": 1,
  "encoding": "GSM-7",
  "cost": "0.0124",
  "balance": "50.00",
  "countries": [
    { "country": "JP", "recipients": 1, "price": "0.0085", "cost": "0.0085" },
    { "country": "US", "recipients": 1, "price": "0.0039", "cost": "0.0039" }
  ],
  "rejected": [],
  "duplicates": 0,
  "opted_out": 0
}

Errors

Error codes

CodeHTTPMeaning
unauthorized401Key absent or unknown
rate_limited429Too many calls in this minute
bad_request400Body is not readable JSON
empty_text400text has nothing in it
too_long400text runs past 10 parts
no_numbers400No valid numbers left
too_many400Over 20,000 numbers in one call
bad_time400schedule_at falls outside the window
low_balance402Not enough credit
unavailable503Sending unavailable right now, no credit taken
not_found404No campaign with that id
not_scheduled409Already sent or cancelled

Limits and notes

  • Each key may make 120 calls per minute.
  • Money comes back as a USD string such as "0.0042".
  • Campaign ids are random 12-character codes, not sequential numbers.
  • The opt-out list and number checks work exactly as in web sending.
Create an API key