🔐 Authentication
Each request must include the following header:
Authorization: Bearer your_token_here
1. Send SMS
https://devsms.uz/api/send_sms.php
Request Body:
{
"phone": "998901234567",
"message": "Test SMS xabari",
"from": "4546",
"callback_url": "https://your-domain.com/sms-callback"
}
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| phone | string | Yes | Phone number (998901234567 or international: 12025551234) |
| message | string | Yes | SMS message text |
| from | string | No | From (default: 4546) |
| callback_url | string | No | URL to receive SMS status updates (http:// or https://) |
| type | string | No | SMS type: eskiz (default), simple, universal_otp |
Response:
// To Uzbekistan number
{
"success": true,
"message": "SMS muvaffaqiyatli yuborildi",
"data": {
"sms_id": 123,
"request_id": "uuid-here",
"status": "sent",
"parts_count": 1,
"total_cost": "$0.005",
"balance": "$0.079",
"type": "eskiz"
}
}
// To international number
{
"success": true,
"message": "SMS muvaffaqiyatli yuborildi",
"data": {
"sms_id": 124,
"request_id": "uuid-here",
"status": "sent",
"parts_count": 1,
"total_cost": "$0.010",
"balance": "$0.070",
"type": "eskiz",
"country": "United States",
"country_code": "us"
}
}
1.1 Universal OTP SMS
https://devsms.uz/api/send_sms.php
Send verification codes using Eskiz-approved universal OTP templates. Company name is checked by AI moderation.
Universal templates are pre-approved by Eskiz. You only provide the company name and OTP code. If the company name is inappropriate, the SMS will NOT be sent, but your balance WILL be charged!
Request Body:
{
"phone": "998901234567",
"type": "universal_otp",
"template_type": 1,
"service_name": "TechShop",
"otp_code": "5678"
}
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| phone | string | Yes | Phone number (998901234567 or international: 12025551234) |
| type | string | Yes | "universal_otp" |
| template_type | integer | Yes | Template type: 1=Operation verification, 2=Password reset, 3=Registration, 4=Login |
| service_name | string | Yes | Company/service name (2-50 chars, letters, numbers, spaces, dots, hyphens only) |
| otp_code | string | Yes | OTP verification code (4-8 digits) |
Available templates:
MyService tizimi: {service_name} xizmatida amaliyotni tasdiqlash kodi: {otp_code}
MyService tizimi: {service_name} xizmatida parolni tiklash uchun tasdiqlash kodi: {otp_code}
MyService tizimi: {service_name} xizmatiga ro'yxatdan o'tish uchun tasdiqlash kodi: {otp_code}
MyService tizimi: {service_name} xizmatiga kirish uchun tasdiqlash kodi: {otp_code}
Response:
{
"success": true,
"message": "SMS muvaffaqiyatli yuborildi",
"data": {
"sms_id": 456,
"request_id": "uuid-here",
"status": "sent",
"parts_count": 1,
"total_cost": "$0.005",
"balance": "$0.079",
"type": "universal_otp"
}
}
Blocked SMS response:
{
"success": false,
"error": "Korxona nomi nomaqbul deb topildi: ... SMS yuborilmadi, lekin to'lov yechildi."
}
2. Get SMS History
https://devsms.uz/api/get_history.php
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
| limit | integer | 50 | Number of SMS (max: 200) |
| offset | integer | 0 | Offset |
| status | string | null | Status filter (sent, delivered, failed) |
Example:
GET https://devsms.uz/api/get_history.php?limit=10&offset=0&status=delivered
Response:
{
"success": true,
"data": {
"history": [
{
"id": 123,
"phone_number": "998901234567",
"message": "Salom!",
"status": "delivered",
"parts_count": 1,
"total_cost": "$0.005",
"from_number": "4546",
"eskiz_request_id": "uuid-here",
"eskiz_message_id": "msg-id",
"sent_at": "2026-03-09 10:30:00",
"delivered_at": "2026-03-09 10:30:05",
"failed_at": null,
"created_at": "2026-03-09 10:29:58"
}
],
"count": 1,
"limit": 10,
"offset": 0
}
}
Status Timestamps
| Parameter | Description |
|---|---|
| created_at | Time SMS was created |
| sent_at | Time SMS was sent |
| delivered_at | Time SMS was delivered |
| failed_at | Time SMS failed |
3. Get Balance
https://devsms.uz/api/get_balance.php
Response:
{
"success": true,
"data": {
"balance": "$0.083",
"sms_price": "$0.005",
"statistics": {
"total_sms": 100,
"total_spent": "$0.414",
"today_sms": 10,
"today_spent": "$0.042",
"month_sms": 50,
"month_spent": "$0.207" }
}
}
4. Get SMS Status
https://devsms.uz/api/get_status.php
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
| sms_id | integer | SMS ID (database ID) |
| request_id | string | Eskiz request ID |
Example:
GET https://devsms.uz/api/get_status.php?sms_id=123
or
GET https://devsms.uz/api/get_status.php?request_id=uuid-here
Response:
{
"success": true,
"data": {
"id": 123,
"phone_number": "998901234567",
"message": "Salom!",
"status": "delivered",
"parts_count": 1,
"total_cost": "$0.005",
"from_number": "4546",
"eskiz_request_id": "uuid-here",
"eskiz_message_id": "msg-id",
"sent_at": "2026-03-09 10:30:00",
"delivered_at": "2026-03-09 10:30:05",
"failed_at": null,
"created_at": "2026-03-09 10:29:58",
"updated_at": "2026-03-09 10:30:05"
}
}
🔔 Callback URL
When you include the callback_url parameter when sending an SMS, a POST request will be sent to your URL when the SMS status changes (sent, delivered, failed).
When callback is sent:
Data sent to your URL:
{
"sms_id": 123,
"request_id": "uuid-here",
"phone": "998901234567",
"status": "delivered",
"sent_at": "2026-03-09 10:30:00",
"delivered_at": "2026-03-09 10:30:05",
"failed_at": null,
"timestamp": "2026-03-09 10:30:05"
}
Parameters:
| Parameter | Type | Description |
|---|---|---|
| sms_id | integer | SMS ID (database ID) |
| request_id | string | Eskiz request ID |
| phone | string | Phone number (998901234567 or international: 12025551234) |
| status | string | Status filter (sent, delivered, failed) |
| sent_at | string|null | Time SMS was sent |
| delivered_at | string|null | Time SMS was delivered |
| failed_at | string|null | Time SMS failed |
| timestamp | string | Time SMS was created |
Note: Callback is sent with a 5 second timeout. If your server does not respond, no retry is attempted.
📝 SMS Statuses
| Status | Description |
|---|---|
| pending | SMS not yet sent (pending) |
| sent | SMS sent (accepted by Eskiz) |
| delivered | SMS delivered to recipient |
| failed | SMS failed (rejected or undeliverable) |
❌ Errors
When an error occurs, the following format is returned:
{
"success": false,
"error": "Xatolik xabari"
}
HTTP Status Codes:
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request |
| 401 | Authentication Error |
| 403 | Forbidden |
| 404 | Not Found |
| 500 | Server Error |
Tip:
You can use Postman or cURL to test the API.
🌍 International SMS Pricing
To send SMS to an international number, provide the number in international format in the phone parameter (e.g., 12025551234). Country and price are detected automatically. Simple SMS is available only for Uzbekistan numbers.
| Country | Phone Code | Local user ($) | Foreign user ($) |
|---|---|---|---|
| Afghanistan (AF) | +93 | $0.542 | $0.629 |
| Aland Islands (AX) | +35818 | $0.127 | $0.147 |
| Albania (AL) | +355 | $0.137 | $0.159 |
| Angola (AO) | +244 | $0.170 | $0.197 |
| Argentina (AR) | +54 | $0.107 | $0.124 |
| Armenia (AM) | +374 | $0.256 | $0.297 |
| Aruba (AW) | +297 | $0.151 | $0.175 |
| Australia (AU) | +61 | $0.090 | $0.105 |
| Austria (AT) | +43 | $0.144 | $0.167 |
| Azerbaijan (AZ) | +994 | $0.612 | $0.710 |
| Bahamas (BS) | +1242 | $0.012 | $0.014 |
| Bahrain (BH) | +973 | $0.070 | $0.081 |
| Bangladesh (BD) | +880 | $0.424 | $0.491 |
| Barbados (BB) | +1246 | $0.012 | $0.014 |
| Belarus (BY) | +375 | $0.398 | $0.462 |
| Belgium (BE) | +32 | $0.154 | $0.179 |
| Belize (BZ) | +501 | $0.508 | $0.589 |
| Bosnia and Herzegovina (BA) | +387 | $0.011 | $0.013 |
| Brazil (BR) | +55 | $0.092 | $0.106 |
| Bulgaria (BG) | +359 | $0.228 | $0.264 |
| Cambodia (KH) | +855 | $0.242 | $0.280 |
| Canada (CA) | +1 | $0.012 | $0.014 |
| Central African Republic (CF) | +236 | $0.061 | $0.071 |
| China (CN) | +86 | $0.064 | $0.074 |
| Colombia (CO) | +57 | $0.074 | $0.086 |
| Croatia (HR) | +385 | $0.137 | $0.159 |
| Cuba (CU) | +53 | $0.124 | $0.144 |
| Cyprus (CY) | +357 | $0.129 | $0.150 |
| Czech Republic (CZ) | +420 | $0.098 | $0.113 |
| Denmark (DK) | +45 | $0.095 | $0.110 |
| Egypt (EG) | +20 | $0.304 | $0.353 |
| Estonia (EE) | +372 | $0.140 | $0.163 |
| Finland (FI) | +358 | $0.131 | $0.152 |
| France (FR) | +33 | $0.118 | $0.137 |
| Georgia (GE) | +995 | $0.320 | $0.371 |
| Germany (DE) | +49 | $0.167 | $0.194 |
| Greece (GR) | +30 | $0.093 | $0.107 |
| Guernsey (GG) | +441481 | $0.075 | $0.087 |
| Hong Kong (HK) | +852 | $0.119 | $0.138 |
| Hungary (HU) | +36 | $0.129 | $0.150 |
| Iceland (IS) | +354 | $0.119 | $0.138 |
| India (IN) | +91 | $0.127 | $0.147 |
| Indonesia (ID) | +62 | $0.639 | $0.742 |
| Iran (IR) | +98 | $0.334 | $0.388 |
| Iraq (IQ) | +964 | $0.447 | $0.518 |
| Ireland (IE) | +353 | $0.110 | $0.127 |
| Israel (IL) | +972 | $0.290 | $0.337 |
| Italy (IT) | +39 | $0.139 | $0.161 |
| Japan (JP) | +81 | $0.131 | $0.152 |
| Kazakhstan (KZ) | +77 | $0.860 | $0.997 |
| Kuwait (KW) | +965 | $0.412 | $0.477 |
| Kyrgyzstan (KG) | +996 | $0.523 | $0.607 |
| Latvia (LV) | +371 | $0.111 | $0.129 |
| Liechtenstein (LI) | +423 | $0.091 | $0.105 |
| Lithuania (LT) | +370 | $0.100 | $0.116 |
| Luxembourg (LU) | +352 | $0.121 | $0.140 |
| Macedonia (MK) | +389 | $0.106 | $0.123 |
| Madagascar (MG) | +261 | $0.684 | $0.794 |
| Malaysia (MY) | +60 | $0.116 | $0.135 |
| Maldives (MV) | +960 | $0.050 | $0.058 |
| Malta (MT) | +356 | $0.133 | $0.154 |
| Mexico (MX) | +52 | $0.077 | $0.089 |
| Moldova (MD) | +373 | $0.117 | $0.135 |
| Monaco (MC) | +377 | $0.238 | $0.276 |
| Mongolia (MN) | +976 | $0.300 | $0.347 |
| Morocco (MA) | +212 | $0.298 | $0.345 |
| Myanmar (MM) | +95 | $0.359 | $0.417 |
| Netherlands (NL) | +31 | $0.149 | $0.173 |
| New Zealand (NZ) | +64 | $0.154 | $0.179 |
| Norway (NO) | +47 | $0.109 | $0.126 |
| Oman (OM) | +968 | $0.229 | $0.266 |
| Pakistan (PK) | +92 | $0.608 | $0.705 |
| Philippines (PH) | +63 | $0.325 | $0.377 |
| Poland (PL) | +48 | $0.065 | $0.075 |
| Portugal (PT) | +351 | $0.080 | $0.093 |
| Qatar (QA) | +974 | $0.095 | $0.110 |
| Romania (RO) | +40 | $0.113 | $0.131 |
| Russia (RU) | +7 | $0.860 | $0.997 |
| Saudi Arabia (SA) | +966 | $0.174 | $0.202 |
| Serbia (RS) | +381 | $0.324 | $0.375 |
| Singapore (SG) | +65 | $0.082 | $0.095 |
| Slovakia (SK) | +421 | $0.138 | $0.160 |
| Slovenia (SI) | +386 | $0.300 | $0.347 |
| South Korea (KR) | +82 | $0.075 | $0.087 |
| Spain (ES) | +34 | $0.057 | $0.066 |
| Sri Lanka (LK) | +94 | $0.428 | $0.496 |
| Sweden (SE) | +46 | $0.098 | $0.114 |
| Switzerland (CH) | +41 | $0.109 | $0.126 |
| Taiwan (TW) | +886 | $0.084 | $0.097 |
| Tajikistan (TJ) | +992 | $0.885 | $1.027 |
| Thailand (TH) | +66 | $0.045 | $0.052 |
| Tunisia (TN) | +216 | $0.395 | $0.458 |
| Turkey (TR) | +90 | $0.045 | $0.052 |
| Turkmenistan (TM) | +993 | $0.282 | $0.327 |
| Ukraine (UA) | +380 | $0.262 | $0.304 |
| United Arab Emirates (AE) | +971 | $0.197 | $0.229 |
| United Kingdom (GB) | +44 | $0.078 | $0.090 |
| United States (US) | +1 | $0.012 | $0.014 |
| Uruguay (UY) | +598 | $0.142 | $0.164 |
| Vietnam (VI) | +1340 | $0.012 | $0.014 |
Prices are per SMS part. Long messages may consist of multiple parts.
International SMS example:
// USA
{
"phone": "12025551234",
"message": "Hello from Uzbekistan!"
}
// Russia
{
"phone": "79161234567",
"message": "Privet iz Uzbekistana!"
}
// Kazakhstan
{
"phone": "77011234567",
"message": "Salom Qozog'istondan!"
}
🔧 cURL Examples
Send SMS:
curl -X POST https://devsms.uz/api/send_sms.php \
-H "Authorization: Bearer your_token" \
-H "Content-Type: application/json" \
-d '{
"phone": "998901234567",
"message": "Test SMS"
}'
Get Balance:
curl -X GET https://devsms.uz/api/get_balance.php \
-H "Authorization: Bearer your_token"
💻 Code Examples
Select programming language:
<?php
// DevSMS API - PHP Example
$token = "your_api_token_here";
$baseUrl = "https://devsms.uz/api";
// SMS Yuborish
function sendSMS($token, $baseUrl, $phone, $message) {
$ch = curl_init("$baseUrl/send_sms.php");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $token",
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => json_encode([
"phone" => $phone,
"message" => $message
])
]);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
// Balansni olish
function getBalance($token, $baseUrl) {
$ch = curl_init("$baseUrl/get_balance.php");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $token"
]
]);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
// Ishlatish
$result = sendSMS($token, $baseUrl, "998901234567", "Salom!");
print_r($result);
$balance = getBalance($token, $baseUrl);
print_r($balance);
?>