MTS Device API - Quick Reference Guide
Related Documentation:
- Available Resources Reference - Complete resource documentation with examples
- Command Endpoints Reference - Complete command documentation with examples
- API README - Getting started guide
Base URL
http://192.168.2.1 (or your device IP)
Authentication
Login
POST /api/login
Content-Type: application/json
{
"username": "admin",
"password": "admin"
}
Logout
POST /api/logout
Common Endpoints
System Information
# Get all system info
GET /api?fields=system
# Get specific fields
GET /api?fields=system/capabilities
GET /api?fields=system/firmware
GET /api?fields=system/dbDirty
# Update system
PUT /api/system
{
"deviceName": "MyDevice",
"deviceHostname": "mydevice"
}
Cellular Configuration
# Get cellular config
GET /api?fields=cellular
# Update cellular
PUT /api/cellular
{
"enabled": true,
"providerProfiles": [...],
"simProfiles": [...]
}
User Management
# List users
GET /api?fields=users
# Get specific user
GET /api?fields=users/{username}
# Create user
POST /api/users
{
"name": "newuser",
"password": "password",
"permission": "user"
}
# Update user
PUT /api/users/{username}
{
"email": "user@example.com"
}
# Delete user
DELETE /api/users/{username}
Network Configuration
# DNS
GET /api?fields=dns
PUT /api/dns
# WiFi
GET /api?fields=wifi
PUT /api/wifi
# DHCP
GET /api?fields=dhcp
PUT /api/dhcp
# Routes
GET /api?fields=routes
PUT /api/routes
# Firewall
GET /api?fields=firewall
PUT /api/firewall
Status & Monitoring
# Get status notifications
GET /api?fields=status
# Clear notification
DELETE /api/status/{guid}
# Get statistics
GET /api?fields=stats
# Event log
GET /api?fields=eventlog
LoRa Management
# Get LoRa config
GET /api?fields=loraNetwork
# Update LoRa config
PUT /api/loraNetwork
# List gateways
GET /api/lora/gateways
# Delete gateway
DELETE /api/lora/gateways/{gwEui}
# Restart LoRa service
POST /api/lora/restart
GPS
# Get GPS data
GET /api?fields=gps
# Update GPS config
PUT /api/gps
Docker
# Get Docker config
GET /api?fields=docker
# Update Docker config
PUT /api/docker
Command Endpoints
See Command Endpoints Reference for complete documentation.
Configuration Management
# Save configuration
POST /api/command/save
# Revert configuration
POST /api/command/revert
# Save and apply
POST /api/command/save_apply
# Upload config file
POST /api/command/upload_config
(multipart/form-data)
# Download config
POST /api/command/download_config
System Commands
# Restart device
POST /api/command/restart
# Reset modem
POST /api/command/reset_modem
# Reset WiFi
POST /api/command/reset_wifi
# Reset Bluetooth
POST /api/command/reset_bluetooth
Firmware Management
# Check for updates
POST /api/command/firmware_check
# Upgrade firmware
POST /api/command/firmware_upgrade
(multipart/form-data with firmware file)
# Upgrade radio firmware
POST /api/command/radio/firmware_upgrade
Network Testing
# Ping test
POST /api/command/ping
{
"host": "8.8.8.8",
"count": 4
}
# Start continuous ping
POST /api/command/continuous_ping_start
{
"host": "8.8.8.8"
}
# Stop continuous ping
POST /api/command/continuous_ping_stop
User Commands
# Change password
POST /api/command/passwd
{
"oldPassword": "oldpass",
"newPassword": "newpass"
}
Radio Commands
# Check SIM status
POST /api/command/radio/check_sim_status
# Unlock SIM card
POST /api/command/radio/unlock_sim_card
{
"pin": "1234"
}
# Execute AT command
POST /api/command/radio/cmd
{
"command": "AT+CGMI"
}
# Force cellular scan
POST /api/command/radio/force_cellular_scan
# Get cellular scan results
POST /api/command/radio/get_cellular_scan
SMS Commands
See SMS Schema for complete SMS documentation.
# Get SMS configuration
GET /api?fields=sms
# Send SMS via outbox
POST /api/sms/outbox
{
"recipients": ["+1234567890", "+0987654321"],
"message": "Alert from device"
}
# Get sent messages
GET /api?fields=sms/outbox
# Get received messages
GET /api?fields=sms/inbox
# Delete message
DELETE /api/sms/inbox/{guid}
DELETE /api/sms/outbox/{guid}
# Delete all messages
DELETE /api/sms/inbox/all
DELETE /api/sms/outbox/all
# Configure SMS with commands
PUT /api/sms
{
"enabled": true,
"sentLimit": 500,
"receivedLimit": 500,
"resendLimit": 3,
"smsCommands": {
"enabled": true,
"rebootEnabled": true,
"pingEnabled": true,
"password": {
"enabled": true,
"useCustomPassword": false
},
"whitelist": {
"enabled": true,
"numbers": ["+1234567890"]
}
}
}
SMS Remote Commands (via SMS to device):
p <password> #reboot
p <password> #ping 8.8.8.8
p <password> #wanips
p <password> #cellular
Query Parameters
For GET /api
fields- Comma-separated list of resources (required)inactivity- Don’t update session timeout (optional, boolean)default- Return default values (optional, boolean)
Examples:
# Single resource
GET /api?fields=system
# Multiple resources
GET /api?fields=system,cellular,users
# Nested field
GET /api?fields=system/capabilities
# With inactivity flag
GET /api?fields=status&inactivity=true
# Get defaults
GET /api?fields=cellular&default=true
Available Resources
See Available Resources Reference for complete documentation.
Core Resources
system- System informationstatus- Status notificationsusers- User accountscustomRoles- Custom rolespermissions- PermissionsautoReboot- Scheduled rebootbrand- White-label branding
Network Resources
cellular- Cellular configwifi- WiFi configdns- DNS configdhcp- DHCP configni- Network interfacesroutes- Static routesnat- NAT rulesfirewall- Firewall rulesfilters- Traffic filterstrustedIp- Trusted IPswanmngr- WAN failover/load balancingddns- Dynamic DNS
VPN Resources
ovpnTunnels- OpenVPNipsecTunnels- IPsecgreTunnels- GRE tunnels
IoT Resources
loraNetwork- LoRa network serverlora- LoRa managementscada- SCADA protocolsmqttBroker- MQTT broker
Device Resources
docker- Docker containerscustomApps- Custom appspackages- Packageslicensing- Licenses
Communication
gps- GPSserial- Serial portssms- SMS (details)bluetooth- BluetoothbluetoothLowEnergy- BLE
Security
certificate- Certificatescacertificates- CA certssecureProtocols- TLS/SSLpasswordComplexityRules- Password rulesremoteAccess- HTTP/HTTPS/SSH accessradius- RADIUS authentication
Monitoring
stats- Statistics (33+ categories)eventlog- Event logsyslog- Syslog configalert- Alertssnmp- SNMP config
Notifications
smtp- SMTP emailsntp- NTP time syncnotificationEventGroup- Event groups
Response Format
Success
{
"success": true,
"result": {
// Data here
}
}
Error
{
"success": false,
"error": "Error message",
"code": 404
}
HTTP Status Codes
200- Success400- Bad request401- Unauthorized403- Forbidden404- Not found409- Conflict500- Server error
User Roles
Admin
- Full access to all endpoints
- Can manage users
- Can execute all commands
User (Engineer)
- Read/write most config
- Cannot manage other users
- Can execute most commands
Guest (Monitor)
- Read-only access
- Cannot modify config
- Cannot execute commands
Typical Workflow
# 1. Login
curl -X POST http://192.168.2.1/api/login \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"admin"}' \
-c cookies.txt
# 2. Get current config
curl -X GET "http://192.168.2.1/api?fields=cellular" \
-b cookies.txt
# 3. Update config
curl -X PUT http://192.168.2.1/api/cellular \
-H "Content-Type: application/json" \
-d '{"enabled":true}' \
-b cookies.txt
# 4. Check for unsaved changes
curl -X GET "http://192.168.2.1/api?fields=system/dbDirty" \
-b cookies.txt
# 5. Save config
curl -X POST http://192.168.2.1/api/command/save \
-b cookies.txt
# 6. Logout
curl -X POST http://192.168.2.1/api/logout \
-b cookies.txt
Tips
-
Always save: Configuration changes are not persistent until you call
/api/command/save -
Check dbDirty: Query
system/dbDirtyto see if there are unsaved changes -
Session management: Sessions expire after inactivity. Use
inactivity=truefor monitoring queries -
Batch queries: Request multiple resources in one call:
fields=system,cellular,users -
Nested access: Access nested fields directly:
fields=system/capabilities -
Error handling: Always check the
successfield in responses -
HTTPS: Use HTTPS in production for security
-
Permissions: Check user role before attempting operations
Common Patterns
Check device status
GET /api?fields=system/dbDirty,status
Full system snapshot
GET /api?fields=system,cellular,wifi,dns,users,status
Update and save
PUT /api/cellular {...}
POST /api/command/save
Monitor without timeout
GET /api?fields=status&inactivity=true
Reset to defaults
GET /api?fields=cellular&default=true
File Uploads
For endpoints that accept files (firmware, certificates, etc.):
curl -X POST http://192.168.2.1/api/command/firmware_upgrade \
-H "Content-Type: multipart/form-data" \
-F "file=@/path/to/firmware.bin" \
-b cookies.txt
Troubleshooting
401 Unauthorized
- Login first with
/api/login - Check if session cookie is present
- Session may have expired
409 Conflict
- Device may be in commissioning mode
- Check
/api/policyfor device state
Changes not persisting
- Call
/api/command/saveafter changes - Check
system/dbDirtystatus
Device unavailable
- Device may be rebooting
- Check
/api/policy - Wait for startup to complete
Related Documentation
- Available Resources Reference - Complete resource documentation
- Command Endpoints Reference - Complete command documentation
- API README - Getting started guide
- LoRa Operations Workflow - FOTA and multicast
- WAN Failover Guide - Failover configuration
Quick Reference Version: 1.1.0
Last Updated: February 2026