Integrate SMS.SB directly into your software. Automate verifications with our simple, high-performance REST API.
The SMS.SB API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
Base URL
https://sms.sb/api/v1Authenticate your requests using your API Key found in Settings. Pass it via the Authorization header or api_key query parameter.
Authorization: Bearer sk_live_...
SMS.SB uses conventional HTTP response codes to indicate the success or failure of an API request.
Everything worked as expected.
The request was unacceptable, often due to missing parameters.
No valid API key provided.
The requested resource doesn't exist.
The order and cancel endpoints return structured error codes for programmatic handling:
INVALID_API_KEY401Missing or invalid API key.INVALID_REQUEST400Missing required parameters (service, country, id, etc.).NOT_FOUND404Order not found or does not belong to your account.INVALID_STATE400Order is not in a valid state for this action (e.g. cancelling an already completed order).NO_NUMBERS409No numbers currently available. Retry after 1-2 seconds.PRICE_CHANGED409Price has changed since you last checked. Response includes old_price and new_price.OUT_OF_STOCK409Service is unavailable in this country.INSUFFICIENT_BALANCE402Not enough balance. Response includes required and balance fields.TRANSIENT_ERROR503Temporary issue. Safe to retry immediately.TOO_EARLY400Cannot cancel before 2 minutes have passed since purchase.NO_CODE_YET409Cannot complete order before SMS code is received. Keep polling /status.CANCEL_FAILED400The cancellation request was rejected by the provider.SERVER_ERROR500Unexpected server error. Contact support if persistent.Retrieve your current account balance.
curl -H "Authorization: Bearer YOUR_API_KEY" \ https://sms.sb/api/v1/balance
{
"balance": 125.50,
"currency": "USD"
}Get a list of available services and their prices for a specific country.
countrynumber- Country ID (default: 0 for Russia)curl "https://sms.sb/api/v1/services?country=0" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"success": true,
"country": 0,
"services": [
{ "id": "vk", "name": "VKontakte", "price": 0.15, "currency": "USD" },
{ "id": "tg", "name": "Telegram", "price": 0.25, "currency": "USD" }
]
}Get a list of all supported countries.
curl "https://sms.sb/api/v1/countries" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"success": true,
"countries": [
{ "id": 0, "name": "Russia" },
{ "id": 1, "name": "Ukraine" }
]
}Purchase a number for a specific service.
servicestringrequired- Service ID (e.g. "tg", "wa")countrynumberrequired- Country IDoperatorstring- Specific operator or "any"max_pricenumber- Maximum price you are willing to pay (USD). Order is rejected if price exceeds this.curl -X POST "https://sms.sb/api/v1/order" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"service": "tg", "country": 0, "max_price": 0.50}'// Success
{
"success": true,
"id": "order_uuid_...",
"phone": "79991234567",
"service": "Telegram",
"cost": 0.25,
"status": "active"
}
// Error (structured)
{
"success": false,
"code": "PRICE_CHANGED",
"error": "Price has changed",
"old_price": 0.25,
"new_price": 0.35
}Get the status and SMS code for an order. If no ID provided, returns all active orders.
idstringrequired- Order ID received from order endpointcurl "https://sms.sb/api/v1/status?id=ORDER_ID" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"success": true,
"status": "completed",
"code": "12345",
"phone": "79991234567"
}Confirm that you received the SMS code and release the number. This can only be called after the code has been received. If no code has arrived yet, you'll get a NO_CODE_YET error — keep polling /status instead.
idstringrequired- Order ID to completecurl -X POST "https://sms.sb/api/v1/complete" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id": "ORDER_ID"}'// Success (code already known)
{
"success": true,
"status": "completed"
}
// Success (code found during complete)
{
"success": true,
"status": "completed",
"code": "12345"
}
// No code received yet
{
"success": false,
"code": "NO_CODE_YET",
"error": "Cannot complete order before SMS code is received."
}Cancel an active order and get a full refund. Note: cancellation is only possible after 2 minutes have passed since purchase. If you try earlier, you'll get a TOO_EARLY error code.
idstringrequired- Order ID to cancelcurl -X POST "https://sms.sb/api/v1/cancel" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id": "ORDER_ID"}'// Success
{
"success": true,
"status": "cancelled",
"refunded": 0.25
}
// Too early
{
"success": false,
"code": "TOO_EARLY",
"error": "Cannot cancel before 2 minutes have passed"
}Get detailed availability and deliverability statistics for a service.
servicestringrequired- Service ID (e.g. "tg", "wa")countrynumber- Country ID (default: 0)curl "https://sms.sb/api/v1/services/stats?service=tg&country=0" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"success": true,
"service": "tg",
"country": 0,
"stats": {
"quantity": 1429,
"price": 0.25,
"deliverability": 25.82,
"cheapest_countries": [
{ "country_id": 6, "country_name": "Indonesia", "price": "0.10" }
]
}
}