SMS Activation API Guide & Documentation

API documentation compatible with mainstream SMS-activation protocols: check balance, fetch number prices, buy virtual numbers, and receive verification codes automatically — integrate virtual phone numbers quickly.

Welcome to the SMS-Activation API.

The API is the interaction protocol between your software and our servers, and it stays compatible with mainstream providers. All requests should be sent to https://www.sms-activation.net/stubs/handler_api.php using GET/POST. Every request must include an API key as the api_key parameter.


Overview

ItemDescription
Base URLhttps://www.sms-activation.net/stubs/handler_api.php
Request MethodGET/POST
Response FormatText or JSON
Authenticationapi_key parameter

All requests must carry the following two common parameters:

ParameterTypeRequiredDescription
api_keystringYesYour API key. Get it on the API documentation page by clicking "View API Key"
actionstringYesThe API method to call — see the Action overview below

If api_key is invalid or missing, BAD_KEY is returned,

if action does not exist, BAD_ACTION is returned.


Action Overview

ActionDescriptionResponse Type
getBalanceCheck account balanceText
getPricesFetch number prices and stock countsJSON
getNumberBuy a phone number to receive verification codesText
setStatusUpdate the status of an activation order (confirm / re-request / cancel)Text
getActiveActivationsGet all in-progress activation orders of the accountJSON

1. Check Balance getBalance

Returns the current available balance of the account.

Request Parameters

ParameterTypeRequiredDescription
api_keystringYesAPI key
actionstringYesFixed value getBalance

Example Request

curl "https://www.sms-activation.net/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalance"

Example Response

ACCESS_BALANCE:128.50

Possible Errors

Return ValueDescription
BAD_KEYInvalid api_key

2. Get Prices getPrices

Fetches the unit price and stock count of numbers for each country/service. Can be filtered by service and country.

Request Parameters

ParameterTypeRequiredDescription
api_keystringYesAPI key
actionstringYesFixed value getPrices
servicestringNoService code, e.g. tg (Telegram); omit to return all services
countrynumberNoCountry code, e.g. 187 (United States); omit to return all countries

Example Request

curl "https://www.sms-activation.net/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getPrices&service=tg&country=187"

Example Response

{
  "187": {
    "tg": {
      "cost": 13.5,
      "count": 5000,
      "physicalCount": 4800
    }
  }
}

The response structure is { countryCode: { serviceCode: { cost, count, physicalCount } } }:

FieldDescription
costUnit price of the number (CNY, already adjusted by your account tier)
countCurrently available stock for the country/service
physicalCountStock count of physical numbers (may be missing for some services)

3. Get Number getNumber

Buys a temporary phone number for receiving SMS verification codes of a given service.

Request Parameters

ParameterTypeRequiredDescription
api_keystringYesAPI key
actionstringYesFixed value getNumber
servicestringYesService code, e.g. tg
countrynumberYesCountry code, e.g. 187

Example Request

curl "https://www.sms-activation.net/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getNumber&service=tg&country=187"

Example Response

ACCESS_NUMBER:38223344:12015550123

The response format is ACCESS_NUMBER:{activationId}:{phoneNumber}. Keep activationId — it is required for later status queries/updates.

Possible Errors

Return ValueDescription
NO_NUMBERSNo numbers currently available for the service/country
NO_BALANCEInsufficient account balance
BAD_SERVICEInvalid service / country parameter

4. Update Activation Status setStatus

Called after getting a number to tell the system the next step: request another SMS, confirm completion, or cancel the activation.

Request Parameters

ParameterTypeRequiredDescription
api_keystringYesAPI key
actionstringYesFixed value setStatus
idstringYesThe activationId returned by getNumber
statusnumberYesTarget status — see the table below

Status Values

statusMeaning
3Request a repeated SMS (wait for the next verification code)
6Confirm the activation is complete
8Cancel this activation (not allowed within 2 minutes after purchase)

status=1 (number ready) is set automatically by the system. After calling getNumber, clients must not — and cannot — set it manually.

Example Request

curl "https://www.sms-activation.net/stubs/handler_api.php?api_key=YOUR_API_KEY&action=setStatus&id=38223344&status=6"

Example Response

ACCESS_ACTIVATION

Possible Errors

Return ValueDescription
BAD_STATUSstatus value is outside the allowed range
WRONG_ACTIVATION_IDid does not exist or belongs to another account
EARLY_CANCEL_DENIEDCancellation (status=8) attempted within 2 minutes of purchase

5. Get Active Activations getActiveActivations

Returns details of all activations of the current account that have not finished yet (not confirmed / not cancelled).

Request Parameters

ParameterTypeRequiredDescription
api_keystringYesAPI key
actionstringYesFixed value getActiveActivations

Example Request

curl "https://www.sms-activation.net/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getActiveActivations"

Example Response

[
  {
    "activationId": "38223344",
    "phoneNumber": "12015550123",
    "countryCode": 187,
    "countryName": "United States",
    "countryNameCN": "美国",
    "serviceCode": "tg",
    "serviceNameCN": "Telegram",
    "activationStatus": 2,
    "status": 0,
    "activationCost": 13.5,
    "price_cn": 13.5,
    "activationTime": "2026-06-27T08:00:00.000Z",
    "canGetAnotherSms": true,
    "activationOperator": "",
    "discount": "",
    "repeated": "",
    "smsCode": ["123456"],
    "smsText": ["Your Telegram code: 123456"]
  }
]

Field Description

FieldDescription
activationIdActivation order ID
phoneNumberAssigned phone number
countryCode / countryNameCountry code / country name
serviceCode / serviceNameCNService code / service name
activationCost / price_cnOrder price
smsCodeList of verification codes received
smsTextList of full SMS texts received
canGetAnotherSmsWhether another SMS can be requested

Error Codes

Error CodeDescription
BAD_KEYInvalid api_key
BAD_ACTIONInvalid action parameter
BAD_SERVICEInvalid service or country parameter
BAD_STATUSInvalid status parameter
NO_NUMBERSNo numbers currently available for the service/country
NO_BALANCEInsufficient account balance
WRONG_ACTIVATION_IDActivation order ID does not exist or belongs to another account
EARLY_CANCEL_DENIEDCancellation attempted within 2 minutes of purchase