Collection of articles for working with Multitech devices in LoRaWAN networks.
This repository contains comprehensive API documentation for the Multi-Tech Systems (MTS) IoT device management platform (mPower Edge Intelligence).
The MTS Device API is a RESTful API that provides complete control and monitoring capabilities for MTS IoT gateway devices. The API enables configuration and management of:
api-documentation.yaml: Complete OpenAPI 3.0 specification
The API uses session-based authentication with cookies. To authenticate:
/api/login with credentials:
curl -X POST http://192.168.2.1/api/login \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "admin"}' \
-c cookies.txt
curl -X GET http://192.168.2.1/api?fields=system \
-b cookies.txt
curl -X POST http://192.168.2.1/api/logout \
-b cookies.txt
The primary endpoint for retrieving data is /api with a fields query parameter:
# Get system information
curl -X GET "http://192.168.2.1/api?fields=system" -b cookies.txt
# Get multiple resources
curl -X GET "http://192.168.2.1/api?fields=system,cellular,users" -b cookies.txt
# Get nested fields
curl -X GET "http://192.168.2.1/api?fields=system/capabilities" -b cookies.txt
Use PUT requests to update resource configurations:
# Update system settings
curl -X PUT http://192.168.2.1/api/system \
-H "Content-Type: application/json" \
-d '{"deviceName": "MyDevice"}' \
-b cookies.txt
# Update cellular configuration
curl -X PUT http://192.168.2.1/api/cellular \
-H "Content-Type: application/json" \
-d '{"enabled": true}' \
-b cookies.txt
Use POST requests to execute device commands:
# Save configuration
curl -X POST http://192.168.2.1/api/command/save -b cookies.txt
# Restart device
curl -X POST http://192.168.2.1/api/command/restart -b cookies.txt
# Ping test
curl -X POST http://192.168.2.1/api/command/ping \
-H "Content-Type: application/json" \
-d '{"host": "8.8.8.8", "count": 4}' \
-b cookies.txt
The API follows a consistent pattern for resource management:
| HTTP Method | Pattern | Description |
|---|---|---|
| GET | /api?fields=<resource> |
Retrieve resource data |
| PUT | /api/<resource> |
Update entire resource |
| POST | /api/<resource> |
Create new resource item |
| DELETE | /api/<resource>/<id> |
Delete resource item |
system - Device information and capabilitiesstatus - System status notificationsusers - User account managementcustomRoles - Custom role definitionspermissions - Permission managementcellular - Cellular connectivitywifi - WiFi access point and clientdns - DNS server configurationdhcp - DHCP server configurationni - Network interfacesroutes - Static routesnat - NAT configurationfirewall - Firewall rulesfilters - Traffic filtersovpnTunnels - OpenVPN tunnelsipsecTunnels - IPsec tunnelsgreTunnels - GRE tunnelsloraNetwork - LoRa network serverlora - LoRa gateway managementscada - SCADA protocol configurationmqtt - MQTT brokerdocker - Docker container managementcustomApps - Custom application managementpackages - Package managementlicensing - License managementgps - GPS configuration and dataserial - Serial port configurationsms - SMS messagingbluetooth - Bluetooth configurationbluetoothLowEnergy - BLE configurationcertificate - Device certificatescacertificates - CA certificatessecureProtocols - TLS/SSL protocolstrustedIp - Trusted IP addressesstats - Statistics and metricseventlog - Event logsyslog - Syslog configurationalert - Alert configurationsnmp - SNMP configurationCommands are executed via POST to /api/command/<command>:
save - Save configuration to persistent storagerevert - Revert to last saved configurationsave_apply - Save and apply configurationupload_config - Upload configuration filedownload_config - Download configuration filerestart - Restart devicereset_modem - Reset cellular modemreset_wifi - Reset WiFi modulereset_bluetooth - Reset Bluetooth modulefirmware_upgrade - Upgrade device firmwarefirmware_check - Check for firmware updatesradio/firmware_upgrade - Upgrade cellular radio firmwareping - Execute ping testcontinuous_ping_start - Start continuous pingcontinuous_ping_stop - Stop continuous pingpasswd - Change user passwordupload_lora_license - Upload LoRa licenseupload_lora_fota_file - Upload LoRa FOTA firmwaresms_send - Send SMS messageThe API implements role-based access control with three built-in roles:
Each endpoint in the API has associated permissions:
All API responses follow a consistent JSON format:
{
"success": true,
"result": {
// Response data varies by endpoint
}
}
{
"success": false,
"error": "Error message description",
"code": 404
}
200 OK - Request successful400 Bad Request - Invalid request data401 Unauthorized - Authentication required or failed403 Forbidden - Insufficient permissions404 Not Found - Resource not found409 Conflict - Device in commissioning mode or conflict state500 Internal Server Error - Server errorThe device uses a two-stage configuration model:
POST /api/command/save to persist changes# 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 configuration
curl -X GET "http://192.168.2.1/api?fields=cellular" -b cookies.txt
# 3. Update configuration
curl -X PUT http://192.168.2.1/api/cellular \
-H "Content-Type: application/json" \
-d '{"enabled": true, ...}' \
-b cookies.txt
# 4. Check if configuration is dirty (has unsaved changes)
curl -X GET "http://192.168.2.1/api?fields=system/dbDirty" -b cookies.txt
# 5. Save configuration
curl -X POST http://192.168.2.1/api/command/save -b cookies.txt
# 6. Optionally restart to apply changes
curl -X POST http://192.168.2.1/api/command/restart -b cookies.txt
# 7. Logout
curl -X POST http://192.168.2.1/api/logout -b cookies.txt
Check if device is available (not in commissioning mode):
curl -X GET http://192.168.2.1/api/policy
For first-time device setup:
curl -X POST http://192.168.2.1/api/commissioning \
-H "Content-Type: application/json" \
-d '{"password": "newpassword"}'
Get system status notifications:
curl -X GET "http://192.168.2.1/api?fields=status" -b cookies.txt
Clear a specific notification:
curl -X DELETE http://192.168.2.1/api/status/{guid} -b cookies.txt
Complete example of configuring cellular connectivity:
# Get current cellular configuration
curl -X GET "http://192.168.2.1/api?fields=cellular" -b cookies.txt
# Update cellular configuration
curl -X PUT http://192.168.2.1/api/cellular \
-H "Content-Type: application/json" \
-b cookies.txt \
-d '{
"enabled": true,
"providerProfiles": [
{
"_id": "550e8400-e29b-41d4-a716-446655440000",
"profileName": "My Carrier",
"cellularMode": "4g-preferred",
"dataCtx": {
"apnString": "internet",
"contextIpMode": "AUTO",
"authentication": {
"type": "NONE",
"username": "",
"password": ""
}
}
}
],
"simProfiles": [
{
"_id": "550e8400-e29b-41d4-a716-446655440001",
"profileName": "My SIM",
"providerProfileId": "550e8400-e29b-41d4-a716-446655440000",
"simIccid": "ANY",
"simPin": ""
}
]
}'
# Save configuration
curl -X POST http://192.168.2.1/api/command/save -b cookies.txt
# List all users (admin only)
curl -X GET "http://192.168.2.1/api?fields=users" -b cookies.txt
# Create new user
curl -X POST http://192.168.2.1/api/users \
-H "Content-Type: application/json" \
-b cookies.txt \
-d '{
"name": "engineer1",
"password": "password123",
"permission": "user",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com"
}'
# Update user
curl -X PUT http://192.168.2.1/api/users/engineer1 \
-H "Content-Type: application/json" \
-b cookies.txt \
-d '{
"email": "newemail@example.com",
"enabled": true
}'
# Delete user
curl -X DELETE http://192.168.2.1/api/users/engineer1 -b cookies.txt
# Save changes
curl -X POST http://192.168.2.1/api/command/save -b cookies.txt
# Get LoRa configuration
curl -X GET "http://192.168.2.1/api?fields=loraNetwork" -b cookies.txt
# Update LoRa network server mode
curl -X PUT http://192.168.2.1/api/loraNetwork \
-H "Content-Type: application/json" \
-b cookies.txt \
-d '{
"enabled": true,
"mode": "NETWORK_SERVER"
}'
# List registered gateways
curl -X GET http://192.168.2.1/api/lora/gateways -b cookies.txt
# Restart LoRa service
curl -X POST http://192.168.2.1/api/lora/restart -b cookies.txt
api-documentation.yaml fileOnline Swagger Editor:
Visit https://editor.swagger.io/ and paste the contents of api-documentation.yaml
api-documentation.yamlUse OpenAPI Generator to create client libraries in various languages:
# Install OpenAPI Generator
npm install @openapitools/openapi-generator-cli -g
# Generate Python client
openapi-generator-cli generate \
-i api-documentation.yaml \
-g python \
-o ./python-client
# Generate JavaScript/TypeScript client
openapi-generator-cli generate \
-i api-documentation.yaml \
-g typescript-axios \
-o ./typescript-client
# Generate Java client
openapi-generator-cli generate \
-i api-documentation.yaml \
-g java \
-o ./java-client
The current API version is included in the system information:
curl -X GET "http://192.168.2.1/api?fields=system/apiVersion" -b cookies.txt
passwordComplexityRulestrustedIp configurationIf you receive 401 errors:
If changes are lost after reboot:
/api/command/save after making changessystem/dbDirty to verify if there are unsaved changesIf you receive “device unavailable” errors:
/api/policy to verify device statemtsDeviceAPI/json/permissive/ and mtsDeviceAPI/json/strict/mtsDeviceAPI/controllers/permissions-*.jsonFor technical support and additional documentation:
This API documentation is provided for use with Multi-Tech Systems devices. Refer to your device license agreement for terms and conditions.
Document Version: 1.0.0
Last Updated: December 17, 2025
API Version: Based on mtsDeviceAPI and mtsDeviceUI projects