Integrate virtual phone numbers and OTP verification into your own apps and scripts.
The whole API is one endpoint. You pick what it does with the
action query parameter — for example
?action=getNumber. Every request is a plain
GET (POST form bodies work too), and every
response is JSON.
Log in or create a free account to get your personal API key. Everywhere the examples below show <your-api-key>, you'll paste the key from here.
Send it as a header — X-API-Key: <your-api-key> — or as
?api_key=..., or Authorization: Bearer <your-api-key>.
Session login also works if you're calling the API from a browser you're already logged into.
curl "https://otpdesk.com/api/handler_api.php?action=getBalance" \
-H "X-API-Key: <your-api-key>"
Keep your key server-side. Anyone holding it can spend your balance.
Every action answers with the same envelope. On failure,
data.error_code carries a stable machine-readable code from
the error reference.
{
"success": true,
"message": "ok",
"data": { ... }
}
{
"success": false,
"message": "No numbers available",
"data": { "error_code": "NO_NUMBERS" }
}
Numbers are sourced from several independent upstream servers. Every one
of them is addressed by a plain numeric server_id — the same
numbering you see on the Numbers page in your dashboard.
| ID | Name |
|---|---|
| 1 | Server 1 |
| 2 | Server 2 |
| 3 | Server 3 |
| 4 | Server 4 |
| 5 | Server 5 |
Omit server_id and we auto-route your request
across every server, cheapest first, and automatically fall back to the
next one if a server is out of stock. Supply server_id
and the request is locked to that single server — no fallback, so you get a
clear error instead of a number from somewhere else.
This list is live. Call getServers at runtime rather than hardcoding IDs — servers can be added or retired.
Parameters
| Param | Required | Description |
|---|---|---|
| service | required | Service name, e.g. Telegram. See getServicesList. |
| country | required | Country name, e.g. India. See getCountries. |
| server_id | optional | Lock to one server (1, 2, 3, 4, 5). Omit to auto-route with fallback. |
| max_price | optional | Never pay more than this. The purchase fails rather than overspending. |
Example request
GET https://otpdesk.com/api/handler_api.php?action=getNumber&service=Telegram&country=India X-API-Key: <your-api-key>
Returns
{
"success": true,
"message": "ok",
"data": {
"id": 12345,
"phone": "919000000000",
"price": 12.50,
"server_id": 1
}
}
Keep the returned id — every other activation call takes it.
Prices already include any discount on your account.
Parameters
| Param | Required | Description |
|---|---|---|
| service | required | Service name |
| country | required | Country name |
| server_id | optional | Lock to one server; omit to auto-route with fallback |
| max_price | optional | Price ceiling for this purchase |
Example request
GET https://otpdesk.com/api/handler_api.php?action=getNumberV2&service=Telegram&country=India&server_id=1 X-API-Key: <your-api-key>
Returns
{
"success": true,
"message": "ok",
"data": {
"activationId": 12345,
"phoneNumber": "919000000000",
"activationCost": 12.50,
"activationTime": "2026-01-01 12:00:00",
"countryName": "India",
"serviceName": "Telegram",
"server_id": 1,
"canGetAnotherSms": true
}
}
Same purchase behaviour as getNumber — only the response shape differs.
Parameters
| Param | Required | Description |
|---|---|---|
| id | required | The activation id returned by getNumber |
Example request
GET https://otpdesk.com/api/handler_api.php?action=getStatus&id=12345 X-API-Key: <your-api-key>
Returns
{
"success": true,
"message": "ok",
"data": {
"status": "STATUS_OK",
"code": "123456"
}
}
Poll a few seconds apart, not in a tight loop — requests are rate-limited per account. While no code has arrived yet the status stays in its waiting state.
Parameters
| Param | Required | Description |
|---|---|---|
| id | required | The activation id |
Example request
GET https://otpdesk.com/api/handler_api.php?action=getStatusV2&id=12345 X-API-Key: <your-api-key>
Returns
{
"success": true,
"message": "ok",
"data": {
"code": "123456",
"text": "Your Telegram code is 123456",
"dateTime": "2026-01-01 12:00:31"
}
}
Use this when you need the full SMS body or the delivery timestamp, not just the extracted code.
Parameters
| Param | Required | Description |
|---|---|---|
| id | required | The activation id |
| status | required | See the status table below |
Status values
| Value | Meaning |
|---|---|
| 8 | Cancel the activation and refund your balance. Not possible once a code has already arrived. |
| 6 | Mark the activation done. Closes it out; no refund. |
| 3 | Request the next OTP on the same number. |
Example request
GET https://otpdesk.com/api/handler_api.php?action=setStatus&id=12345&status=8 X-API-Key: <your-api-key>
Cancel anything you no longer need — an abandoned activation ties up stock and is only refunded if you cancel it.
Parameters
| Param | Required | Description |
|---|---|---|
| id | required | An activation that has already received at least one code |
Example request
GET https://otpdesk.com/api/handler_api.php?action=regetNumber&id=12345 X-API-Key: <your-api-key>
After calling this, keep polling getStatus for the new code.
Only available where the service supports multiple codes on one number;
equivalent to setStatus with status=3.
Takes no parameters.
Example request
GET https://otpdesk.com/api/handler_api.php?action=getBalance X-API-Key: <your-api-key>
Returns
{
"success": true,
"message": "ok",
"data": { "balance": 250.00, "currency": "INR" }
}
3925 distinct services are currently available across all servers.
Parameters
| Param | Required | Description |
|---|---|---|
| server_id | optional | Only list what this one server offers. Omit for the merged catalog across all servers. |
| country | optional | Only services available in this country |
Example request
GET https://otpdesk.com/api/handler_api.php?action=getServicesList&country=India X-API-Key: <your-api-key>
Services offered by more than one server appear once, quoted at the best price available to you. Prices already reflect your account discount.
229 distinct countries are currently available across all servers.
Parameters
| Param | Required | Description |
|---|---|---|
| server_id | optional | Only countries this one server covers. Omit for the merged list. |
Example request
GET https://otpdesk.com/api/handler_api.php?action=getCountries X-API-Key: <your-api-key>
The country names returned here are exactly what getNumber expects.
Parameters
| Param | Required | Description |
|---|---|---|
| country | optional | Filter to one country |
| service | optional | Filter to one service |
| server_id | optional | Price on this one server only. Omit for the best price across all servers. |
Example request
GET https://otpdesk.com/api/handler_api.php?action=getPrices&country=India&service=Telegram X-API-Key: <your-api-key>
Quoted prices are what getNumber will actually deduct,
discounts included. Narrow with country and
service — the unfiltered catalog is large.
Parameters
| Param | Required | Description |
|---|---|---|
| service | required | Service name, e.g. Telegram |
| server_id | optional | Rank one server only. Omit for all servers. |
| limit | optional | How many countries (1–200, default 50) |
Example request
GET https://otpdesk.com/api/handler_api.php?action=getTopCountriesByService&service=Telegram&limit=10 X-API-Key: <your-api-key>
Returns
{
"success": true,
"message": "ok",
"data": {
"service": "Telegram",
"countries": [
{ "rank": 1, "country": "India", "flag": "...", "count": 4210, "price": 0.35, "retail_price": 0.4, "server_id": 2 }
],
"total": 1
}
}
Ranked by recent successful deliveries, then numbers in stock, then price.
count = numbers in stock, price = what getNumber charges you,
retail_price = price before your discounts.
Parameters
| Param | Required | Description |
|---|---|---|
| country | optional | One country. Omit for the top services across all countries. |
| server_id | optional | Rank one server only. |
| limit | optional | How many services (1–200, default 50) |
Example request
GET https://otpdesk.com/api/handler_api.php?action=getTopServicesByCountry&country=India&limit=10 X-API-Key: <your-api-key>
Same fields as getTopCountriesByService, with service and logo
instead of country and flag.
Takes no parameters.
Example request
GET https://otpdesk.com/api/handler_api.php?action=getServers X-API-Key: <your-api-key>
Returns
{
"success": true,
"message": "ok",
"data": {
"servers": [
{ "id": 1, "name": "Server 1" }, { "id": 2, "name": "Server 2" }, { "id": 3, "name": "Server 3" }, { "id": 4, "name": "Server 4" }, { "id": 5, "name": "Server 5" } ]
}
}
This is the authoritative source for server_id values.
Fetch it at startup instead of hardcoding IDs.
Parameters
| Param | Required | Description |
|---|---|---|
| limit | optional | How many orders to return. Default 50, maximum 200. |
| offset | optional | How many to skip, for paging. Default 0. |
Example request
GET https://otpdesk.com/api/handler_api.php?action=getOrders&limit=50&offset=0 X-API-Key: <your-api-key>
Newest first. Each order carries the server_id it was fulfilled from.
Buy digital products (subscriptions, gift cards, licence keys) from your own app with the same API key. Endpoint: https://otpdesk.com/api/digital.php. Prices are in your wallet currency and already include any digital-products coupon you have claimed. Same response envelope as above.
Takes no parameters.
Example request
GET https://otpdesk.com/api/digital.php?action=products X-API-Key: <your-api-key>
Returns
{
"success": true,
"message": "ok",
"data": {
"currency": "USD",
"products": [{
"id": 12, "title": "Netflix 1 Month", "category": "Netflix",
"price": "4.500000", "normal_price": "5.000000", "coupon_applied": true,
"duration_days": 30, "warranty": "30 days", "description": null,
"requires_email": false, "in_stock": true, "stock_label": "In stock: 8", "max_qty": 8
}]
}
}
Parameters
| Param | Required | Description |
|---|---|---|
| product_id | required | The id from products. |
| quantity | optional | Default 1, at most the product's max_qty. |
| request_token | required | 32-64 lowercase hex characters, new for every order. Resending the same token returns the same order and never charges twice. |
| optional | Required when the product has requires_email: true. | |
| quote | optional | The total you expect to pay (price × quantity). If the price changed, the order is refused with PRICE_CHANGED. Leave it out to accept the current price. |
Example request
POST https://otpdesk.com/api/digital.php X-API-Key: <your-api-key> Content-Type: application/x-www-form-urlencoded action=buy&product_id=12&quantity=1"e=4.500000&request_token=9f2c4a1e7b3d4c5e8f6a0b1c2d3e4f5a
Returns
{
"success": true,
"message": "Order complete. Your codes are in My orders and were emailed to you.",
"data": {
"id": 345, "product_id": 12, "product_title": "Netflix 1 Month", "quantity": 1,
"charge": "4.500000", "currency": "USD", "status": "Completed",
"created_at": "2026-11-25 10:00:00", "message": "Order complete. ...",
"codes": ["XXXX-XXXX-XXXX"]
}
}
status is Completed (codes included), Failed
(out of stock, wallet refunded) or Review required (being checked, you are never charged twice;
poll order). On a network error or RETRY_SAME,
resend with the same request_token.
Parameters
| Param | Required | Description |
|---|---|---|
| id | required | The order id returned by buy. |
Example request
GET https://otpdesk.com/api/digital.php?action=order&id=345 X-API-Key: <your-api-key>
Same fields as buy. codes is filled only when the order is Completed.
Takes no parameters. Newest first, each with its status and codes.
GET https://otpdesk.com/api/digital.php?action=orders X-API-Key: <your-api-key>
Digital Store error codes: STORE_CLOSED, BAD_PRODUCT, PRICE_CHANGED, ORDER_REJECTED (the message says why), NO_ORDER, RETRY_SAME, plus BAD_KEY, NO_BALANCE and MISSING_PARAMS.
Failed requests return success: false and a stable
data.error_code. Branch on the code, never on the
human-readable message — that wording can change.
| Code | HTTP | Meaning |
|---|---|---|
| BAD_KEY | 401 | Invalid or missing API key. |
| NO_BALANCE | 402 | Insufficient balance. Please top up your account and try again. |
| NO_NUMBERS | 409 | No numbers available for this country and service right now. Please try again shortly. |
| BAD_SERVICE | 404 | Unknown service. Check the service name against getServicesList. |
| BAD_COUNTRY | 404 | Unknown country. Check the country name against getCountries. |
| BAD_SERVER | 404 | Unknown or unavailable server. Check the server id against getServers. |
| NO_ACTIVATION | 404 | Activation not found. It may have expired or it does not belong to this account. |
| ALREADY_FINISHED | 409 | This activation is already finished and can no longer be changed. |
| BAD_STATUS | 422 | Invalid status value for this activation. |
| BAD_ACTION | 422 | Unknown action. See the documentation for the list of supported actions. |
| MISSING_PARAMS | 422 | One or more required parameters are missing. |
| RATE_LIMIT | 429 | Too many requests. Please slow down and try again in a moment. |
Requests are rate-limited per account. Poll getStatus a few
seconds apart rather than in a tight loop, cancel activations you have
abandoned with setStatus (status=8) so you get
your money back, and read server_id from
getServers at runtime so your integration keeps working when
servers are added or retired.
Buy numbers, get your OTP codes as notifications and top up your wallet, right from your phone.