This article is a machine translation of the contents of the following URL, which I wrote in Japanese:
Introduction
Hello, I'm @H0ukiStar.
Today, AWS IoT Core announced the following update.
Posted on: May 28, 2026
Today, AWS IoT Core launches two new MQTT connection management APIs, GetConnection and ListSubscriptions, enabling you to easily access MQTT client connection and subscription information for your Internet of Things (IoT) devices. These APIs help you troubleshoot connectivity issues, monitor client behavior, and audit connection patterns across your device fleet.
https://aws.amazon.com/about-aws/whats-new/2026/05/aws-iot-core-apis-mqtt/
Previously, checking device connection status required using Fleet Indexing or implementing your own state management with features such as Device Shadow. With this update, it is now possible to check device connection status directly using AWS IoT Core alone.
I previously introduced methods for checking connection status using Fleet Indexing and Device Shadow in the following article, so feel free to check it out as well.
Trying It Out
Let's try the new APIs.
At the time of writing, these APIs do not appear to be available in the AWS SDK yet, so the API requests must be signed manually using SigV4.
This time, I used awscurl for signing. You can install it with the following command:
pip install awscurl
You can also retrieve the API endpoint using the AWS CLI as shown below.
aws iot describe-endpoint --endpoint-type iot:Data-ATS
{
"endpointAddress": "abcd1234567890-ats.iot.ap-northeast-1.amazonaws.com"
}
GetConnection
This API allows you to retrieve information such as the connection status and Keep Alive configuration of a specified MQTT client.
Send the following request using awscurl.
awscurl \
--service iotdevicegateway \
--region ap-northeast-1 \
"https://abcd1234567890-ats.iot.ap-northeast-1.amazonaws.com/connections/<clientId>"
[!WARNING]
For SigV4 signing, you must specifyiotdevicegatewayas the service name instead ofiot.
You can retrieve information such as whether the client is currently connected and when the connection was established.
{
"connected": true,
"cleanSession": true,
"clientId": "clientId",
"thingName": "thingName",
"keepAliveDuration": 15,
"connectedSince": 1780061470032
}
You can also retrieve socket information by adding includeSocketInformation=true.
awscurl \
--service iotdevicegateway \
--region ap-northeast-1 \
"https://abcd1234567890-ats.iot.ap-northeast-1.amazonaws.com/connections/<clientId>?includeSocketInformation=true"
{
"connected": true,
"cleanSession": true,
"clientId": "clientId",
"thingName": "thingName",
"sourceIp": "sourceIp",
"sourcePort": sourcePort,
"targetIp": "targetIp",
"targetPort": 8883,
"keepAliveDuration": 15,
"connectedSince": 1780061470032
}
ListSubscriptions
This API allows you to retrieve the topics subscribed to by a specified client.
Send the following request using awscurl.
awscurl \
--service iotdevicegateway \
--region ap-northeast-1 \
"https://abcd1234567890-ats.iot.ap-northeast-1.amazonaws.com/connections/<clientId>/subscriptions"
[!WARNING]
For SigV4 signing, you must specifyiotdevicegatewayas the service name instead ofiot.
You can retrieve the topics currently subscribed to by the specified client as shown below.
{
"nextToken": "",
"subscriptions": [
{
"topicFilter": "$aws/things/<thingName>/shadow/update/delta",
"qos": 0
}
]
}
Conclusion
With the newly introduced GetConnection and ListSubscriptions APIs, it is now possible to retrieve MQTT client connection status and subscription information directly from AWS IoT Core.
Previously, checking connection status often required custom implementations using Fleet Indexing, Device Shadow, or Lifecycle Events. With these new APIs, monitoring client state should become much simpler.
Although the APIs do not yet appear to be available in the AWS SDK, they can already be used today by manually signing requests with SigV4.
If you're interested, give them a try.
Top comments (0)