API documentation

Automate number purchases with the iLoveSMS REST API or the SMS-Activate compatible protocol.

Your personal API key is in your account settings. Sign up

REST JSON API v1

Base URL: https://ilovesms.com.tr/api/v1/ — Authentication: ?api_key=… / Authorization: Bearer …

MethodParametersDescription
GET services—List services with lowest price and stock.
GET countries—List countries.
GET pricesservicePrices and stock per country for a service.
GET balanceapi_keyYour balance.
POST buyapi_key, service, country_idBuy a number; the price is deducted from your balance.
GET statusapi_key, idOrder status and SMS code.
POST cancelapi_key, idCancel a waiting order and refund it.
POST finishapi_key, idClose a number after you received the code.
GET ordersapi_keyYour last 100 orders.
# 1) Buy a number
curl -X POST "https://ilovesms.com.tr/api/v1/buy" -d "api_key=YOUR_API_KEY" -d "service=tg" -d "country_id=12"

{"ok":true,"order":{"id":1042,"service":"Telegram","country":"USA","number":"12025550123",
 "price":0.45,"status":"waiting","code":null,"seconds_left":1200}}

# 2) Poll every 5 seconds until a code arrives
curl "https://ilovesms.com.tr/api/v1/status?api_key=YOUR_API_KEY&id=1042"

{"ok":true,"order":{"id":1042,"status":"received","code":"48213", ...}}

Error codes: bad_key, bad_service, insufficient, no_numbers, not_cancelable, cancel_later

Webhooks

Instead of polling, give us a URL and we will POST a JSON event to it when a code arrives or an unused order is refunded.

POST https://your-server.example/sms-webhook
Content-Type: application/json
X-Event: sms.received          (sms.received | order.refunded | test)
X-Signature: sha256=<hmac_sha256(body, API_KEY)>

{"event":"sms.received","order":{"id":1042,"service":"Telegram","number":"12025550123","status":"received","code":"48213", ...},"sent_at":"2026-10-30T12:00:00+00:00"}

# PHP
$ok = hash_equals('sha256=' . hash_hmac('sha256', file_get_contents('php://input'), API_KEY), $_SERVER['HTTP_X_SIGNATURE']);

Respond with HTTP 2xx within 5 seconds. Set your webhook URL in Account settings

SMS-Activate compatible endpoint

Software built for the SMS-Activate protocol works without changes: just replace the base URL and API key.

https://ilovesms.com.tr/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalance        → ACCESS_BALANCE:12.40
...&action=getNumber&service=tg&country=12                    → ACCESS_NUMBER:1042:12025550123
...&action=getStatus&id=1042                                   → STATUS_WAIT_CODE | STATUS_OK:48213
...&action=setStatus&id=1042&status=8                          → ACCESS_CANCEL
...&action=setStatus&id=1042&status=6                          → ACCESS_ACTIVATION
...&action=getPrices&service=tg                                → {"12":{"tg":{"cost":0.45,"count":3120}}}

Service codes and country IDs are the same as in the services and countries methods.