Downlink API

Send commands or data to your devices from your own systems.

How it works

  • Satellite devices sleep most of the time and can't be reached at will. A downlink you send is queued and delivered the next time the device uploads, so it may take minutes to hours depending on how often the device uploads.
  • A downlink not delivered within 7 days of being queued expires and is not sent.
  • The "sent" status means CeresGate has sent the downlink out; it does not mean the device received or executed it.
  • If no result is reported back, the downlink is sent again at the device's next upload, so a device may receive the same downlink more than once. Design device-side commands so that repeating them does no harm. After 5 attempts without a result, it is marked failed.
  • Besides the API, you can send and check downlinks by hand on the portal's Downlink page.

Getting an API key

The account administrator creates keys on the portal's API keys page. A key starts with cgk_ and is shown only once, when it is created: store it safely right away. CeresGate keeps only a hash of it and cannot show it again. An account can have up to 5 active keys; revoke a key as soon as it is no longer used or may have leaked.

Anyone holding a key can send downlinks to every device in the account, and actions taken with your keys are deemed yours. Never put a key in a web page or in public code.

Making requests

Base URL: https://api.ceresgate.sagoin.io/v1. Every request carries a key:

Authorization: Bearer cgk_…

Requests and responses are JSON; times are UTC (ISO 8601).

Send a downlink

curl -X POST https://api.ceresgate.sagoin.io/v1/devices/001013453258396/downlinks \
  -H "Authorization: Bearer $CERESGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-20261006-001" \
  -d '{"payload": "0102abcd"}'
  • payload: a hexadecimal string with an even number of characters, at most 512 characters (256 bytes). Upper or lower case.
  • Idempotency-Key (optional, 1–64 printable ASCII characters): when retrying after a network timeout, send the same value and the downlink is not queued twice; you get the original one back (HTTP 200). The same value with different content returns 409.
  • A device can have at most 20 downlinks waiting at a time.

Response 202 Accepted (queued):

{"id": "5f0c3a1e-…", "imsi": "001013453258396", "payload": "0102abcd", "status": "queued",
 "attempts": 0, "error": null, "created_at": "2026-10-06T02:00:00Z", "updated_at": "2026-10-06T02:00:00Z",
 "sent_at": null, "expires_at": "2026-10-13T02:00:00Z"}

Get one downlink

curl https://api.ceresgate.sagoin.io/v1/downlinks/5f0c3a1e-… \
  -H "Authorization: Bearer $CERESGATE_API_KEY"

List a device's downlinks

curl "https://api.ceresgate.sagoin.io/v1/devices/001013453258396/downlinks?status=queued&limit=50" \
  -H "Authorization: Bearer $CERESGATE_API_KEY"

Newest first. status (optional) filters by status; limit defaults to 50, at most 100. When next_before in the response is not null, pass before=<next_before> for the next page:

{"data": [ … ], "next_before": "9a1d…"}

Cancel

curl -X DELETE https://api.ceresgate.sagoin.io/v1/downlinks/5f0c3a1e-… \
  -H "Authorization: Bearer $CERESGATE_API_KEY"

Only a downlink that is still queued can be canceled.

Statuses

statusMeaning
queuedWaiting for the device's next upload
sendingTaken for delivery, waiting for the result
sentSent out (not proof that the device received or executed it)
failedDelivery failed; error says why (for example too_many_attempts: no result after 5 attempts)
expiredNot delivered within 7 days
canceledCanceled (by you, or automatically when the device is unbound)

Finished downlinks are kept for 30 days and then deleted automatically.

Errors

Error responses look like this:

{"error": {"code": "payload_too_long", "message": "payload must be at most 512 hex characters"}}
HTTPcodeWhen
400invalid_json, payload_empty, payload_not_hex, payload_odd_length, payload_too_long, invalid_imsi, invalid_idempotency_key, invalid_status, invalid_limit, invalid_beforeThe request is malformed
401unauthorizedNo key, a wrong key, or a revoked key
403device_not_foundThis IMSI is not a device of your account
403tenant_suspendedThe account is suspended (forwarding has stopped too)
404not_foundNo such downlink
409idempotency_conflictThe Idempotency-Key was already used for different content
409not_cancelableIt is no longer queued, so it can't be canceled
429too_many_queuedThe device already has 20 downlinks waiting
429—Too many requests; retry later
500internal_errorServer error; retry later