Devices
--url 'https://asms.lt/api/devices/' \
--header 'Authorization: Bearer {api_key}' \
| Parameters | Details | Description |
|---|---|---|
| page | Optional Integer | The page number that you want results from. Defaults to 1. |
| results_per_page | Optional Integer | How many results you want per page. Allowed values are: 10, 25, 50, 100, 250, 500, 1000. Defaults to 25. |
| search | Optional String | The search string. |
| search_by | Optional String | What field are you searching by. Allowed values are: name, ip. |
| user_id | Optional Integer | Filter results by user ID. |
| datetime_field | Optional String | Allowed values: last_ping_datetime, last_sent_datetime, last_received_datetime, datetime, last_datetime |
| datetime_start | Optional String | Filter results starting from this datetime. Y-m-d H:i:s format. |
| datetime_end | Optional String | Filter results up to this datetime. Y-m-d H:i:s format. |
| order_by | Optional String | What field to order the results by. Allowed values are: device_id, name, last_ping_datetime, last_sent_datetime, last_received_datetime, datetime, last_datetime, total_sent_sms, total_pending_sms, total_failed_sms, total_received_sms. |
| order_type | Optional String | The ordering of the results. Allowed values are: ASC for ascending ordering, and DESC for descending ordering. |
{
"data": [
{
"id": 1,
"user_id": 1,
"name": "Example",
"notifications": [],
"email_reports": [],
"email_reports_count": 1,
"email_reports_last_datetime": "2026-11-23 04:26:08",
"settings": [],
"sims": [],
"device_fcm_token": "Example",
"device_model": "Example",
"device_brand": "Example",
"device_os": "Example",
"device_battery": 1,
"device_is_charging": true,
"ip": "Example",
"total_sent_sms": 1,
"total_pending_sms": 1,
"total_received_sms": 1,
"total_failed_sms": 1,
"last_sent_datetime": null,
"last_ping_datetime": null,
"last_received_datetime": null,
"datetime": "2026-11-23 04:26:08",
"last_datetime": null
}
],
"meta": {
"page": 1,
"total_pages": 1,
"results_per_page": 25,
"total_results": 1
},
"links": {
"first": "https://asms.lt/api/devices?page=1",
"last": "https://asms.lt/api/devices?page=1",
"next": null,
"prev": null,
"self": "https://asms.lt/api/devices?page=1"
}
}
--url 'https://asms.lt/api/devices/{device_id}' \
--header 'Authorization: Bearer {api_key}' \
{
"data": {
"id": 1,
"user_id": 1,
"name": "Example",
"notifications": [],
"email_reports": [],
"email_reports_count": 1,
"email_reports_last_datetime": "2026-11-23 04:26:08",
"settings": [],
"sims": [],
"device_fcm_token": "Example",
"device_model": "Example",
"device_brand": "Example",
"device_os": "Example",
"device_battery": 1,
"device_is_charging": true,
"ip": "Example",
"total_sent_sms": 1,
"total_pending_sms": 1,
"total_received_sms": 1,
"total_failed_sms": 1,
"last_sent_datetime": null,
"last_ping_datetime": null,
"last_received_datetime": null,
"datetime": "2026-11-23 04:26:08",
"last_datetime": null
}
}
Live connection status of the device. is_online means the device pinged within the last 20 minutes: the app checks in every 15 minutes while idle and right after every wake up.
--url 'https://asms.lt/api/devices/{device_id}/status' \
--header 'Authorization: Bearer {api_key}' \
{
"data": {
"id": 1,
"name": "Example",
"is_online": true,
"online_threshold_minutes": 20,
"last_ping_datetime": "2026-11-23 04:26:08",
"seconds_since_last_ping": 4,
"device_battery": 87,
"device_is_charging": false,
"total_pending_sms": 0,
"can_wake": true,
"wake_available_in_seconds": 21,
"last_wake_datetime": "2026-11-23 04:26:08",
"last_wake_push_status": "accepted",
"pinged_since_last_wake": true
}
}
Sends a high priority push to the Android app. The app wakes up, fetches its pending SMS and pings back, which updates last_ping_datetime. Call the status endpoint a few seconds later: pinged_since_last_wake becomes true once the device has answered. One wake up per device every 30 seconds.
--url 'https://asms.lt/api/devices/{device_id}/wake' \
--header 'Authorization: Bearer {api_key}' \
{
"data": {
"id": 1,
"name": "Example",
"wake_datetime": "2026-11-23 04:26:08",
"push_status": "accepted",
"last_ping_datetime": "2026-11-23 04:26:08",
"wake_available_in_seconds": 30
}
}
| 409 | This device cannot be woken up yet because it has no push token. Open the app on the device and connect it again. |
| 429 | This device was just woken up. Please wait 30 seconds before trying again. |
| 502 | The push service did not accept the wake up (UNREGISTERED). If this keeps happening, open the app on the device and connect it again. |
| 503 | Waking up devices is not configured on this platform. |
Creates a one-time pairing code for the device, valid for 15 minutes. The Android app exchanges it for its credentials, so nobody has to type the API key, the device ID or the site URL. A new code replaces the previous one.
--url 'https://asms.lt/api/devices/{device_id}/pairing-code' \
--header 'Authorization: Bearer {api_key}' \
{
"data": {
"device_id": 1,
"device_name": "Example",
"code": "K7QM42XD",
"code_formatted": "K7QM-42XD",
"expires_in": 900,
"expires_at": "2026-11-23 04:26:08",
"pair_url": "https://asms.lt/?pair=K7QM42XD",
"apk_url": "https://asms.lt/uploads/main/app.apk"
}
}
Used by the Android app: exchanges a pairing code for the API key and the device ID, without an API key. Each code works once, and a network can make 20 attempts per 10 minutes.
--url 'https://asms.lt/api/devices/pair' \
--header 'Content-Type: multipart/form-data' \
--form 'code=K7QM-42XD'
{
"data": {
"api_key": "{api_key}",
"device_id": 1,
"device_name": "Example"
}
}
| 404 | This pairing code is not valid or has expired. Open Connect device on the dashboard and use the code shown there. |
| 429 | Too many pairing attempts from this network. Please wait a few minutes and try again. |
| Parameters | Details | Description |
|---|---|---|
| name | Required String | - |
| notifications | Optional Array | Notification handler ids |
| email_reports | Optional Array | Notification handler ids |
| sms_in_between_delay_minimum | Optional Integer | Allowed values: 1 - 300 |
| sms_in_between_delay_maximum | Optional Integer | Allowed values: 1 - 300 |
| auto_tags_condition | Optional Array | Allowed values: exact, not_exact, contains, not_contains, starts_with, not_starts_with, ends_with, not_ends_with, bigger_than, lower_than |
| auto_tags_sms | Optional Array | Received SMS |
| auto_tags_action | Optional Array | Allowed values: add, remove |
| auto_tags_custom_parameter_key | Optional Array | Custom parameter key |
| auto_tags_custom_parameter_value | Optional Array | Custom parameter value |
| auto_reply_condition | Optional Array | Allowed values: exact, contains, starts_with, ends_with |
| auto_reply_received_sms | Optional Array | Received SMS |
| auto_reply_sent_sms | Optional Array | Sent SMS |
| auto_reply_cooldown_minutes | Optional Array | Allowed values: 0 - 10080 |
| auto_reply_schedule_type | Optional Array | Allowed values: always, custom_hours, outside_custom_hours |
| auto_reply_schedule_timezone | Optional Array | Timezone |
| auto_reply_schedule_days | Optional Array | Allowed values: 1 - 7 |
| auto_reply_schedule_start_time | Optional Array | Start time. HH:MM |
| auto_reply_schedule_end_time | Optional Array | End time. HH:MM |
| auto_reply_rule_id | Optional Integer | - |
--url 'https://asms.lt/api/devices' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example name' \
{
"data": {
"id": 1,
"user_id": 1,
"name": "Example",
"notifications": [],
"email_reports": [],
"email_reports_count": 1,
"email_reports_last_datetime": "2026-11-23 04:26:08",
"settings": {},
"sims": [],
"device_fcm_token": null,
"device_model": null,
"device_brand": null,
"device_os": null,
"device_battery": 1,
"device_is_charging": true,
"ip": null,
"total_sent_sms": 1,
"total_pending_sms": 1,
"total_received_sms": 1,
"total_failed_sms": 1,
"last_sent_datetime": null,
"last_ping_datetime": null,
"last_received_datetime": null,
"datetime": "2026-11-23 04:26:08",
"last_datetime": null
}
}
| Parameters | Details | Description |
|---|---|---|
| name | Optional String | - |
| notifications | Optional Array | Notification handler ids |
| email_reports | Optional Array | Notification handler ids |
| sms_in_between_delay_minimum | Optional Integer | Allowed values: 1 - 300 |
| sms_in_between_delay_maximum | Optional Integer | Allowed values: 1 - 300 |
| auto_tags_condition | Optional Array | Allowed values: exact, not_exact, contains, not_contains, starts_with, not_starts_with, ends_with, not_ends_with, bigger_than, lower_than |
| auto_tags_sms | Optional Array | Received SMS |
| auto_tags_action | Optional Array | Allowed values: add, remove |
| auto_tags_custom_parameter_key | Optional Array | Custom parameter key |
| auto_tags_custom_parameter_value | Optional Array | Custom parameter value |
| auto_reply_condition | Optional Array | Allowed values: exact, contains, starts_with, ends_with |
| auto_reply_received_sms | Optional Array | Received SMS |
| auto_reply_sent_sms | Optional Array | Sent SMS |
| auto_reply_cooldown_minutes | Optional Array | Allowed values: 0 - 10080 |
| auto_reply_schedule_type | Optional Array | Allowed values: always, custom_hours, outside_custom_hours |
| auto_reply_schedule_timezone | Optional Array | Timezone |
| auto_reply_schedule_days | Optional Array | Allowed values: 1 - 7 |
| auto_reply_schedule_start_time | Optional Array | Start time. HH:MM |
| auto_reply_schedule_end_time | Optional Array | End time. HH:MM |
| auto_reply_rule_id | Optional Integer | - |
--url 'https://asms.lt/api/devices/{device_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
{
"data": {
"id": 1,
"user_id": 1,
"name": "Example",
"notifications": [],
"email_reports": [],
"email_reports_count": 1,
"email_reports_last_datetime": "2026-11-23 04:26:08",
"settings": {},
"sims": [],
"device_fcm_token": "Example",
"device_model": "Example",
"device_brand": "Example",
"device_os": "Example",
"device_battery": 1,
"device_is_charging": true,
"ip": "Example",
"total_sent_sms": 1,
"total_pending_sms": 1,
"total_received_sms": 1,
"total_failed_sms": 1,
"last_sent_datetime": null,
"last_ping_datetime": null,
"last_received_datetime": null,
"last_datetime": null,
"datetime": "2026-11-23 04:26:08"
}
}
--url 'https://asms.lt/api/devices/{device_id}' \
--header 'Authorization: Bearer {api_key}' \