SMS activation API
Connect your application to LuckyMonkey: find a service, reserve a number and receive its SMS code through a single API.
https://luckymonkey.cc/api/v1/AUTHORIZATION
Bearer YOUR_API_KEYQuick start
- 01
Create an account and top up
Start from a service page. Your website balance is also your API balance.
- 02
Create an API key
Give each integration its own key. Choose read-only access or permission to place orders.
- 03
Get a number and wait for SMS
Fetch a quote, create an order, then check its status every 5 seconds. SMS completion is automatic.
Authentication
Public catalog methods work without a key. Balance, orders and SMS require a Bearer key. Browser login cookies are not accepted by the API.
Authorization: Bearer YOUR_API_KEYThe full key is shown once. Keep it on your server and send it only in the Authorization header over HTTPS. You can revoke it at any time. Changing your password invalidates your keys.
Endpoints
| Method | URL | Access |
|---|---|---|
| GET | /balanceAvailable and reserved balance | Read |
| GET | /countriesAvailable countries and ISO codes | Public |
| GET | /services?q=telegramServices; optional q search | Public |
| GET | /prices?service=telegram&country=USCurrent quotes; service is required, country is optional | Public |
| GET | /orders?status=waiting_smsYour orders; optional status filter | Read |
| POST | /ordersReserve a number using a quote | Orders |
| GET | /orders/{id}Check number, status and received SMS | Read |
| POST | /orders/{id}/cancelCancel before a supplier attempt begins | Orders |
| POST | /orders/{id}/resendRequest another SMS when supported | Orders |
Amounts and pagination
Currency is USD. Display amounts are strings with 4 decimal places. Integer *_units fields preserve exact amounts: 1 USD = 1,000,000 units. Use exact units for accounting and price comparisons; display strings are rounded. Lists use limit (1–100, default 50), offset and next_offset. A null next_offset means the last page.
Integration example
Use a service ID from /services and a country code from /countries. Quote IDs below are examples: always fetch a current quote before purchasing.
curl 'https://luckymonkey.cc/api/v1/prices?service=telegram&country=US'
curl -X POST 'https://luckymonkey.cc/api/v1/orders' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: 71f65109-689d-486e-8422-93d64a4230fb' \
-d '{"price_id":123,"price_version":1,"max_price":"1.0000"}'
curl 'https://luckymonkey.cc/api/v1/orders/ORDER_UUID' \
-H 'Authorization: Bearer YOUR_API_KEY' import os, time, uuid
import requests
base = "https://luckymonkey.cc/api/v1"
headers = {"Authorization": "Bearer " + os.environ["LUCKY_API_KEY"]}
quotes = requests.get(base + "/prices", params={"service": "telegram", "country": "US"}, timeout=15)
quotes.raise_for_status()
quote = next(q for q in quotes.json()["data"] if q["available"])
key = str(uuid.uuid4()) # Keep this UUID when retrying this purchase.
response = requests.post(base + "/orders", headers={**headers, "Idempotency-Key": key},
json={"price_id": quote["price_id"], "price_version": quote["price_version"]}, timeout=15)
response.raise_for_status()
order = response.json()["data"]
while order["status"] not in ("completed", "expired", "failed"):
if order["phone"]:
print("Phone:", order["phone"]) # Request the SMS in the target service.
time.sleep(5)
response = requests.get(base + "/orders/" + order["id"], headers=headers, timeout=15)
response.raise_for_status()
order = response.json()["data"]
print(order["status"], order["sms"])Order response · 202 Accepted
{
"data": {
"id": "36e4a486-9421-420b-847e-b59392f09d3d",
"status": "allocating",
"service": "telegram",
"country": "US",
"phone": null,
"price": "0.7500",
"price_units": 750000,
"currency": "USD",
"sms": []
}
}Order parameters
price_id and price_version are integers from /prices. The quote version prevents purchasing at a changed price. max_price is an optional positive decimal string, with up to 6 decimal places.
Safe retries
Send a UUID in Idempotency-Key for every new order. Retry the same body with the same UUID after a timeout: the API returns the existing order without another debit. Reusing a UUID with different fields returns 409. A new order requires a new UUID.
Order lifecycle
allocating | Funds reserved; a number is being allocated |
|---|---|
allocation_pending | Supplier response is being reconciled; keep the same order ID |
waiting_sms | Number issued; waiting for SMS |
finalizing | Final SMS check at the end of the window |
completed | SMS received; payment captured |
expired | No SMS arrived; the reservation was released |
failed | Number not issued, supplier ended the order or it was cancelled; reservation released |
The receiving window is up to 20 minutes from issue; use expires_at in UTC. SMS completion and refunds happen automatically. An issued number cannot be manually refunded early. Cancellation is available only before any supplier attempt. Another SMS is available only for supported numbers before expiry.
Errors
Errors return the appropriate HTTP status and error.code, error.message and request_id. Codes are stable English identifiers. Do not retry a purchase with a new UUID after a connection error.
{
"error": {"code": "insufficient_balance", "message": "Insufficient funds. Top up your balance."},
"request_id": "f24f3aee-f574-4af3-a606-435b5042d0dc"
}| 400 | Invalid JSON, quote parameters or UUID |
|---|---|
| 401 | Key missing, expired, revoked or invalid |
| 402 | Insufficient available balance |
| 403 | Read-only key cannot create or change orders |
| 404 | Resource not found or owned by another account |
| 409 | Price changed, no stock, order limit or operation unavailable |
| 429 | Rate limit; wait for Retry-After seconds |
| 503 | Order processing temporarily unavailable |
Limits
120 authenticated requests per minute per account across all keys; up to 10 order creation requests per minute. Public requests: 60 per minute per IP. Invalid keys: 30 per minute per IP. Poll each order no more than once every 5 seconds. Respect Retry-After and use a delay after network errors.
Protocol
This is the LuckyMonkey REST API v1 with asynchronous order creation. It is not a drop-in handler_api.php or 5SIM endpoint: use the documented URLs and OpenAPI schema.