Skip to main content
Technical Preview

Overview

One client-mode connector, Mender, for the Mender Management APIs on hosted Mender (https://hosted.mender.io). Mender is an open-source over-the-air (OTA) update manager for Linux edge devices. The connector covers four of its services, all behind the same token:
  • Device inventory: list, read and search devices, tag them and put them in groups;
  • Device authentication: list pending devices and accept or reject them;
  • Deployments: list releases, start a deployment to devices or to a group, read its statistics and abort it;
  • Mender Connect: ask an online device to check for an update or re-send its inventory right now.
Use it to drive gateway updates from the plant floor: tag each gateway with its UNS location, accept a newly installed gateway when commissioning finishes, roll a release out to one line only when that line reports it is idle, and abort a rollout when an alarm fires. All paths start with /api/management. Topics use cloud-iot/mender/<object>/<verb>; replies land on <topic>/response. For hosted Mender in the EU, change BASE_ADDRESS to https://eu.hosted.mender.io. For a self-hosted Mender Server, use your own server address.
Never commit a token. Store it as a broker secret (for example MENDER_TOKEN) and map it into payloads with GET SECRET. A Personal Access Token has every permission of the user who created it, including starting deployments to your whole fleet. Use a user with a restricted role where your plan allows it, and protect the cloud-iot/mender/# topics with a rule.

Authentication

Every event except Login sends Authorization: Bearer <token>. Use a Personal Access Token: create it on the My profile page of the Mender UI, or call POST /api/management/v1/useradm/settings/tokens as described in Using the APIs. Tokens last up to one year, and Mender revokes them when your plan or add-ons change. Pass the token as token on every payload. A missing, expired or invalid token returns 401. Login exchanges email:password for a user JWT that expires after about a week. Pass basic_auth as the Base64 of email:password; the response is the JWT as plain text. Prefer a Personal Access Token on a broker: no password is stored, and accounts with two-factor authentication cannot use Basic login.

Basic Syntax

MQTT examples

Request bodies go under body, so control fields like token, device_id and group are not sent to Mender. Accept a new gateway: list pending devices by publishing to cloud-iot/mender/auth-device/list:
Each device in the reply has an id and an auth_sets list. Accept it on cloud-iot/mender/auth-device/set-status:
Tag a device with its UNS location and put it in a group: publish to cloud-iot/mender/device-tags/add:
Then {"token": "<token>", "device_id": "<device id>", "body": {"group": "line-1"}} on cloud-iot/mender/device-group/assign. A device belongs to one group at a time. Find devices by inventory attribute: publish to cloud-iot/mender/device/search:
Roll a release out to one line: publish to cloud-iot/mender/deployment/create-group:
Mender returns 201 and puts the new deployment id in the Location header; ListDeployments with "query": "status=inprogress" also returns it. To deploy to specific devices instead, use cloud-iot/mender/deployment/create with "devices": ["<device id>", ...] in the body. Get artifact names from cloud-iot/mender/release/list. Track and abort a rollout: publish {"token": "<token>", "deployment_id": "<id>"} to cloud-iot/mender/deployment/statistics for per-status device counts (pending, downloading, installing, success, failure and more). To stop it, publish {"token": "<token>", "deployment_id": "<id>", "body": {"status": "aborted"}} to cloud-iot/mender/deployment/abort. Ask a device to check now: publish {"token": "<token>", "device_id": "<device id>"} to cloud-iot/mender/device/check-update or cloud-iot/mender/device/send-inventory. These need Mender Connect running on the device and return 202; the device has to be online.

Helper actions

Keep the token in a broker secret, watch for new gateways on a timer, and let operators or line logic trigger rollouts and tags with small payloads:
MenderPollPendingDevices publishes the pending device list to cloud-iot/mender/auth-device/list/response every ten minutes. MenderDeployToGroupOnRequest uses the artifact name as the deployment name. Restrict who can publish to ops/mender/# and read cloud-iot/mender/# with a rule: these topics can push software to devices and their payloads carry the token.

Notes

  • Errors come back on the response topic: 401 for a missing or invalid token, 403 when your plan or role does not allow the call, 404 for an unknown device, group or deployment, 400 or 422 for a bad body or an artifact that does not exist, 409 when a deployment has no target devices or a device is not connected, and 429 when rate limited.
  • CountDevices always sends status=, so pass one of accepted, pending, rejected, preauthorized or noauth. The query field on list events must be URL-encoded.
  • Device ids are Mender’s own ids, not your device serial numbers. Find them with SearchDevices or ListDevices.
  • Artifact upload, device decommissioning, configuration (deviceconfig), remote terminal and file transfer, and user management are not part of this template. Upload artifacts with mender-cli or the UI.
Last modified on October 21, 2026