Downlink — queue data for sending
Queues a data frame for sending to a device. A downlink_data_resp with status: 1 means "accepted into the queue", not "delivered": when the frame goes on air depends on the device class. The server sends the frame to a class A device right after its next uplink, and to a class C device right after queuing.
Track the frame by the dataId from the response: the server sends downlink_status messages, and downlink_ack_req returns the current status on request.
Request and response: downlink_data_req → downlink_data_resp.
Access: a token of any level — the devices of its application and of applications that granted it access.
Request
Fields not marked as required may be omitted.
| Field | Type | Description |
|---|---|---|
cmd | string | downlink_data_req |
operation_id | string | Any string; the server returns it in the response to match the request and the response |
devEui | string | devEui or devAddr is required. Device DevEUI, 16 hex characters |
devAddr | string | devEui or devAddr is required. Device DevAddr, 8 hex characters |
data | string | data or object is required. Payload in hex. The size must not exceed the limit from max_dl_data_req |
object | object | data or object is required. Data as an object. The server converts it to hex with the application codec; the codec may choose fport itself |
fport | uint8 | Application port: the server accepts 0–255; use 1–223 for application data. Default 2 |
ttl | uint32 | How many seconds the frame may wait in the queue. Default 3600 (1 hour). A frame that is not sent in time gets status 8 (Expired) |
realTime | bool | Send only in the nearest receive window, no later than 2 seconds after the request; otherwise the server drops the frame with status 5 (Realtime Late). Default false |
dr | string | Data rate as a string, e.g. SF9BW125. Without the field the server chooses the data rate |
freq | float | Transmission frequency, MHz, within the device frequency plan. Without the field the server chooses the frequency |
gatewayEui | string | Gateway to transmit through. Applies to class C devices only |
power | uint8 | Transmit power, dBm, not above the frequency plan maximum. The server currently only validates the value, see "Good to know" |
lwClass | uint8 | Not used: the server takes the class from the device settings |
{
"cmd": "downlink_data_req",
"operation_id": "xyz",
"devEui": "6F1E570FFE14DBFC",
"fport": 2,
"data": "FFFFFFFFFFFF",
"ttl": 86400
}
Response
| Field | Type | Description |
|---|---|---|
cmd | string | downlink_data_resp |
operation_id | string | Value from the request |
status | uint8 | 1 — the frame is queued, 2 — error |
dataId | uint32 | Frame identifier, from 1 to 4294967295. Needed for downlink_ack_req and included in downlink_status |
devEui | string | DevEUI from the request; null if the device was addressed by devAddr |
devAddr | string | Device DevAddr |
time | string | Queuing time, UTC |
dataInQueue | uint8 | Always 1 — this is not the queue length |
error_code, error_text | uint8, string | Only on error, see below |
{
"cmd": "downlink_data_resp",
"operation_id": "xyz",
"status": 1,
"dataId": 3046127811,
"devEui": "6F1E570FFE14DBFC",
"devAddr": "78130AE1",
"time": "2026-10-08 09:15:03",
"dataInQueue": 1
}
Errors
error_code | error_text | What happened |
|---|---|---|
| 1 | Device not found | The device was not found or is not available with your token |
| 3 | error details | Invalid data: operation_id is not a string, devEui or devAddr is not hex, both data and object are given or neither is, data is not hex, or the codec failed to encode object |
| 4 | Payload max size exceed for current SF | The data does not fit into a frame at this data rate — see max_dl_data_req |
| 5 | Impossible datarate value | dr holds a data rate that is not in the device frequency plan |
| 6 | Frequency must be float | freq is not a number |
| 7 | Frequency not in band range | freq is outside the device frequency plan |
| 8 | — | power is not a positive integer or exceeds the frequency plan maximum |
Good to know
- The device does not acknowledge reception. The frame is sent as Unconfirmed Data Down. The final status 3 (Delivered) means the gateway radiated the frame, not that the device received it. The only way to make sure the device executed a command is its reply in an uplink.
- Class A waits for an uplink. The frame goes out after the device's next uplink — minutes or hours later, depending on how often the device reports. If the device reports less often than once an hour, increase
ttl; otherwise the frame expires before it goes out. A device receives no downlink before its first uplink after joining the network. - One frame per window. After an uplink the device receives one frame. If more frames remain in the queue, the server signals this to the device with the FPending flag. The most recently queued frame leaves the queue first.
realTimeis for replying right after an uplink and for class C. The flag makes sense in two cases: the request is sent right after receivingrealtime_datafrom a class A device, or the frame is intended for a class C device. A late frame is dropped rather than kept for the next window.drandfreqset the transmission parameters for the window the server chooses. Without them the server takes the parameters from the device settings and the frequency plan.- Class B is not supported by the server yet: no frame will be sent to such a device.
The object, ttl and power fields were added to the server in June 2026 and are not in the v0.17 description. The server validates power, but the current version does not apply it to the transmission: the gateway uses the default power of the frequency plan.
See also
- Sending data to a device — the whole scenario and frame statuses.
cancel_downlink_req— withdraw the scheduled frames of a device that have not left yet.