SMSKodySMSKody

API Documentation

Integrate SMSKody into your application to rent USA phone numbers and receive SMS verification codes programmatically. Compatible with the SMS-Activate protocol — if your software already supports it, just change the base URL and API key.

Quick Start — 3 Steps
1. Get your API key from Settings
2. Call getNumber with a service code to rent a number
3. Poll getStatus every 3-5 seconds until the SMS arrives
Authentication

Two methods are supported. Header-based auth is recommended as it keeps your key out of server logs and browser history.

Method 1 — Authorization Header (recommended)
Authorization: Bearer sk_your_api_key_here
Method 2 — Query Parameter
GET https://smskody.com/api/ext?api_key=sk_your_key&action=getBalance
Base URL
https://smskody.com/api/ext
Pricing

dynamic per service — starting from $0.05/SMS

Use getPrices to check current prices. Only charged when SMS is received. Auto-refund on cancel/expire.

Rate Limits
LimitValueResponse
API requests per key60 requests / minuteRATE_LIMIT

Polling getStatus every 3 seconds uses ~20 req/min — well within the limit. If you get RATE_LIMIT, wait and retry.

Full Integration Flow
# 1. Check balance
GET /api/ext?action=getBalance
→ ACCESS_BALANCE:10.50

# 2. Get available services and prices
GET /api/ext?action=getPrices
→ {"0": {"wa": {"cost": 0.05, "count": 219475}, ...}}

# 3. Rent a number for WhatsApp
GET /api/ext?action=getNumber&service=wa
→ ACCESS_NUMBER:8041315:12145550198

# 4. Use +12145550198 on WhatsApp to request SMS code

# 5. Poll for the SMS (every 3-5 seconds)
GET /api/ext?action=getStatus&id=8041315
→ STATUS_WAIT_CODE          (keep polling)
→ STATUS_OK:482731          (SMS received!)

# 6. Done! Optionally mark as complete
GET /api/ext?action=setStatus&id=8041315&status=6
→ ACCESS_ACTIVATION

# If SMS never arrives, cancel for refund:
GET /api/ext?action=setStatus&id=8041315&status=8
→ ACCESS_CANCEL

Endpoints

getBalance

Returns the current account balance in USD.

Example
GET https://smskody.com/api/ext?action=getBalance
Responses
ACCESS_BALANCE:10.50Current balance
BAD_KEYInvalid API key
getServicesList

Returns a JSON array of all available services with code and name.

Example
GET https://smskody.com/api/ext?action=getServicesList
Responses
[{"code":"wa","name":"Whatsapp"}, ...]JSON array of services
getPrices

Returns prices and available number counts for all services, grouped by country.

Parameters
countryCountry ID (optional, only 0 = USA)
Example
GET https://smskody.com/api/ext?action=getPrices
Responses
{"0":{"wa":{"cost":0.05,"count":219475},...}}JSON object: country → service → {cost, count}
getCountries

Returns available countries. Currently only USA.

Example
GET https://smskody.com/api/ext?action=getCountries
Responses
{"0":{"id":0,"name":"USA"}}JSON object of countries
getNumber

Rent a phone number for a specific service. Balance is deducted at the service price (check getPrices). Number is active for 15 minutes.

Parameters
service*Service code (e.g. wa, go, fb, ig, lf, ds, tw)
countryCountry ID (default: 0 = USA)
Example
GET https://smskody.com/api/ext?action=getNumber&service=wa
Responses
ACCESS_NUMBER:8041315:12145550198Success — {activationId}:{phoneNumber}
NO_BALANCEInsufficient balance
NO_NUMBERSNo numbers available for this service
BAD_SERVICEUnknown service code
getStatus

Check the status of an activation. Poll this every 3-5 seconds to wait for the SMS code.

Parameters
id*Activation ID from getNumber response
Example
GET https://smskody.com/api/ext?action=getStatus&id=8041315
Responses
STATUS_WAIT_CODEStill waiting for SMS — keep polling
STATUS_OK:482731SMS received — code after the colon
STATUS_CANCELActivation was cancelled or expired
NO_ACTIVATIONActivation ID not found
setStatus

Change the status of an activation. Use status=8 to cancel (get refund), or status=6 to mark complete.

Parameters
id*Activation ID
status*8 = cancel & refund, 6 = mark complete
Example
GET https://smskody.com/api/ext?action=setStatus&id=8041315&status=8
Responses
ACCESS_CANCELCancelled — balance refunded
ACCESS_ACTIVATIONMarked as complete
BAD_STATUSInvalid status value or wrong state
NO_ACTIVATIONActivation ID not found

Webhooks (Optional)

SMS Webhook

Instead of polling, you can set a webhook URL in Settings. When an SMS arrives, we'll POST a JSON payload to your URL:

POST https://your-server.com/webhook
Content-Type: application/json

{
  "activationId": 8041315,
  "phone": "12145550198",
  "service": "wa",
  "smsCode": "482731",
  "smsText": "Your WhatsApp code is 482731",
  "status": "completed"
}

Code Examples

Python
import requests, time

API_KEY = "sk_your_key_here"
BASE = "https://smskody.com/api/ext"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

r = requests.get(BASE, params={"action": "getNumber", "service": "wa"}, headers=HEADERS)
parts = r.text.split(":")
activation_id, phone = parts[1], parts[2]
print(f"Use this number: +{phone}")

while True:
    r = requests.get(BASE, params={"action": "getStatus", "id": activation_id}, headers=HEADERS)
    if r.text.startswith("STATUS_OK:"):
        print(f"SMS code: {r.text.split(':')[1]}")
        break
    time.sleep(3)
Node.js
const API_KEY = "sk_your_key_here";
const BASE = "https://smskody.com/api/ext";

async function api(params) {
  const url = BASE + "?" + new URLSearchParams(params);
  const res = await fetch(url, { headers: { Authorization: "Bearer " + API_KEY } });
  return res.text();
}

const result = await api({ action: "getNumber", service: "wa" });
const [, activationId, phone] = result.split(":");
console.log("Use number: +" + phone);

while (true) {
  const status = await api({ action: "getStatus", id: activationId });
  if (status.startsWith("STATUS_OK:")) {
    console.log("Code:", status.split(":")[1]);
    break;
  }
  await new Promise(r => setTimeout(r, 3000));
}
cURL
curl -H "Authorization: Bearer sk_your_key" \
  "https://smskody.com/api/ext?action=getBalance"

curl -H "Authorization: Bearer sk_your_key" \
  "https://smskody.com/api/ext?action=getNumber&service=wa"

curl -H "Authorization: Bearer sk_your_key" \
  "https://smskody.com/api/ext?action=getStatus&id=8041315"

curl -H "Authorization: Bearer sk_your_key" \
  "https://smskody.com/api/ext?action=setStatus&id=8041315&status=8"

Error Codes Reference

CodeMeaningWhat to do
BAD_KEYInvalid or missing API keyCheck your key in Settings
BAD_ACTIONUnknown action parameterCheck the action name
BAD_SERVICEService code not foundUse getServicesList to see valid codes
BAD_STATUSInvalid status or wrong activation stateCheck activation state before changing status
NO_BALANCEInsufficient balanceTop up your account
NO_NUMBERSNo numbers available for this serviceTry again later or use a different service
NO_ACTIVATIONActivation ID not foundCheck the ID matches your account
RATE_LIMITToo many requestsWait 60 seconds, max 60 req/min
Interactive API Tester

Test all endpoints in your browser with our interactive tool.

Open API Tester
Need help integrating? Contact us on Telegram @smskodybot or email support@smskody.com