SMS API Documentation
MySMSGate turns an Android phone into your own SMS gateway. Messages are sent over the REST API
below and delivered by the SIM card in your phone, so there is no per-country carrier pricing —
every message costs $0.02 regardless of destination, and a multi-part message up to
7 segments (1071 GSM-7 characters / 469 Unicode
characters) is billed as one.
Examples below use
YOUR_API_KEY as a placeholder.
Create a free account to get a real key —
the same page then shows these examples with your key already filled in.
Authentication
All API requests require a Bearer token in the Authorization header:
Authorization: Bearer YOUR_API_KEY
POST /api/v1/send
Send an SMS message
Request
cURL
Python
JavaScript
php PHP
Go
curl -X POST https://mysmsgate.net/api/v1/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to": "+79001234567", "message": "Hello!", "slot": 0}'
import requests
resp = requests.post(
"https://mysmsgate.net/api/v1/send",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"to": "+79001234567",
"message": "Hello!",
"device_id": "abc-123-...", # optional
"slot": 0 # optional
}
)
print(resp.json())
# {"success": true, "sms_id": 258, "status": "pending"}
const resp = await fetch("https://mysmsgate.net/api/v1/send", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
to: "+79001234567",
message: "Hello!",
device_id: "abc-123-...", // optional
slot: 0 // optional
})
});
const data = await resp.json();
// {success: true, sms_id: 258, status: "pending"}
$ch = curl_init("https://mysmsgate.net/api/v1/send");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY",
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => json_encode([
"to" => "+79001234567",
"message" => "Hello!",
"device_id" => "abc-123-...", // optional
"slot" => 0 // optional
])
]);
$response = json_decode(curl_exec($ch), true);
// ["success" => true, "sms_id" => 258, "status" => "pending"]
payload := map[string]interface{}{
"to": "+79001234567",
"message": "Hello!",
"slot": 0, // optional
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", "https://mysmsgate.net/api/v1/send", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
// HTTP 202: {"success": true, "sms_id": 258, "status": "pending"}
Parameters
Field Type Required Description
to string Yes Phone number (e.g. +79001234567)
message string Yes SMS text
device_id string No Device UUID. If not specified, uses first device.
slot int No SIM slot: 0 = SIM 1, 1 = SIM 2. If not specified, uses device default.
Response (HTTP 202 Accepted)
{
"success": true,
"sms_id": 258,
"status": "pending"
}
SMS is queued and delivered to the phone in batches according to the device SMS/min rate limit. If the phone is offline, a push notification is sent to wake it up.
GET /api/v1/devices
List your registered devices
cURL
Python
JavaScript
php PHP
Go
curl https://mysmsgate.net/api/v1/devices \
-H "Authorization: Bearer YOUR_API_KEY"
resp = requests.get(
"https://mysmsgate.net/api/v1/devices",
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
print(resp.json())
const resp = await fetch("https://mysmsgate.net/api/v1/devices", {
headers: { "Authorization": "Bearer YOUR_API_KEY" }
});
const data = await resp.json();
$ch = curl_init("https://mysmsgate.net/api/v1/devices");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer YOUR_API_KEY"]
]);
$response = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("GET", "https://mysmsgate.net/api/v1/devices", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
resp, _ := http.DefaultClient.Do(req)
Response
{
"devices": [
{
"id": "abc-123-...",
"name": "My Phone",
"status": "standby",
"battery_level": 85,
"default_sim_slot": 0
}
]
}
GET /api/v1/status
Check phone connection status (all devices)
cURL
Python
JavaScript
php PHP
Go
curl https://mysmsgate.net/api/v1/status \
-H "Authorization: Bearer YOUR_API_KEY"
resp = requests.get(
"https://mysmsgate.net/api/v1/status",
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
print(resp.json())
const resp = await fetch("https://mysmsgate.net/api/v1/status", {
headers: { "Authorization": "Bearer YOUR_API_KEY" }
});
const data = await resp.json();
$ch = curl_init("https://mysmsgate.net/api/v1/status");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer YOUR_API_KEY"]
]);
$response = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("GET", "https://mysmsgate.net/api/v1/status", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
resp, _ := http.DefaultClient.Do(req)
Response
{
"connected": true,
"devices": [
{
"id": "abc-123-...",
"name": "My Phone",
"status": "online",
"battery": 85
}
]
}
GET /api/v1/balance
Check SMS balance
cURL
Python
JavaScript
php PHP
Go
curl https://mysmsgate.net/api/v1/balance \
-H "Authorization: Bearer YOUR_API_KEY"
resp = requests.get(
"https://mysmsgate.net/api/v1/balance",
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
print(resp.json())
# {"balance": 95, "sent": 5, "failed": 0}
const resp = await fetch("https://mysmsgate.net/api/v1/balance", {
headers: { "Authorization": "Bearer YOUR_API_KEY" }
});
const data = await resp.json();
// {balance: 95, sent: 5, failed: 0}
$ch = curl_init("https://mysmsgate.net/api/v1/balance");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer YOUR_API_KEY"]
]);
$response = json_decode(curl_exec($ch), true);
// ["balance" => 95, "sent" => 5, "failed" => 0]
req, _ := http.NewRequest("GET", "https://mysmsgate.net/api/v1/balance", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
resp, _ := http.DefaultClient.Do(req)
// {"balance": 95, "sent": 5, "failed": 0}
Response
{
"balance": 95,
"sent": 5,
"failed": 0
}
GET /api/v1/sms?id={sms_id}
Check the status of a specific SMS
cURL
Python
JavaScript
php PHP
Go
curl "https://mysmsgate.net/api/v1/sms?id=258" \
-H "Authorization: Bearer YOUR_API_KEY"
resp = requests.get(
"https://mysmsgate.net/api/v1/sms",
params={"id": 258},
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
print(resp.json())
const resp = await fetch("https://mysmsgate.net/api/v1/sms?id=258", {
headers: { "Authorization": "Bearer YOUR_API_KEY" }
});
const data = await resp.json();
$ch = curl_init("https://mysmsgate.net/api/v1/sms?id=258");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer YOUR_API_KEY"]
]);
$response = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("GET", "https://mysmsgate.net/api/v1/sms?id=258", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
resp, _ := http.DefaultClient.Do(req)
Response
{
"sms_id": 258,
"to": "+79001234567",
"status": "sent",
"created_at": "2026-03-03T11:05:23Z",
"sent_at": "2026-03-03T11:10:55Z"
}
SMS Statuses
Status Description
pending Queued, waiting for phone to pick up
sending Claimed by phone, sending in progress
sent Successfully delivered
failed Failed to send (error field contains details)
GET /api/v1/history
Get SMS sending history
cURL
Python
JavaScript
php PHP
Go
curl "https://mysmsgate.net/api/v1/history?limit=10&offset=0" \
-H "Authorization: Bearer YOUR_API_KEY"
resp = requests.get(
"https://mysmsgate.net/api/v1/history",
params={"limit": 10, "offset": 0},
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
print(resp.json())
const resp = await fetch("https://mysmsgate.net/api/v1/history?limit=10&offset=0", {
headers: { "Authorization": "Bearer YOUR_API_KEY" }
});
const data = await resp.json();
$ch = curl_init("https://mysmsgate.net/api/v1/history?limit=10&offset=0");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer YOUR_API_KEY"]
]);
$response = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("GET", "https://mysmsgate.net/api/v1/history?limit=10&offset=0", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
resp, _ := http.DefaultClient.Do(req)
Parameters
Field Type Default Description
limit int 50 Number of records (max 100)
offset int 0 Offset for pagination
Response
{
"total": 42,
"limit": 10,
"offset": 0,
"history": [
{
"id": 258,
"phone_from": "+79371802075",
"phone_to": "+79001234567",
"message": "Hello!",
"status": "sent",
"created_at": "2026-03-03T11:05:23Z",
"sent_at": "2026-03-03T11:10:55Z"
}
]
}
Error Codes
Code Description
200 Success
202 SMS accepted and queued for delivery
400 Bad request (missing fields, invalid JSON, no device)
401 Unauthorized (invalid or missing API key)
402 Insufficient SMS balance
404 Resource not found (e.g. SMS ID not found)
429 Rate limit exceeded (max 10 req/s per IP)
500 Internal server error
Start sending in three minutes
Install the Android app, scan the pairing code, send your first SMS from the API. No card required.
Get your API key