The "describeMqSessions" action requires "clientNames" and returns information about the MQ sessions, which may be an MQTT or MQ API session.
Request examples
Minimal
{
"action": "describeMqSessions",
"params": {
"clientNames": [
"myClientIdentifier"
]
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}Maximal
{
"api": "mq",
"action": "describeMqSessions",
"params":
{
"clientNames": [
"a unique MQTT or MQ API client name"
],
"includeSubscribedTopics": true,
"includePublishedTopics": true,
"includeStats": true
},
"apiVersion": "1.0",
"debug": "max",
"requestId": "optionalUniqueRequestIdFromTheClient",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Response example
Maximal
{
"authToken": "bIn7dGR4koiQmx5G8hf1ypnan1U2ZQoiP2r46N5z4WVFmlzTdTZam3JeIiuZ0ryx",
"result": {
"data": [
{
"clientName": "client1",
"cleanSession": true,
"temporarySession": false,
"sessionStatus": "normal",
"username": "ADMIN",
"ipaddress": "127.0.0.1",
"port": 54076,
"mqttProtocol": "3.1.1",
"keepAliveSeconds": 0,
"connectionStatus": "connected",
"connectionDateTime": "2025-09-18T20:56:13",
"defaultBinaryFormat": "hex",
"defaultVariantFormat": "json",
"defaultResponseOptions": {
"binaryFormat": "hex",
"variantFormat": "json",
"dataFormat": "objects",
"numberFormat": "number"
},
"sessionType": "mqApi",
"stats": {
"minHealthySendRatePerMinute": 1,
"maxHealthySendRatePerMinute": 1000,
"maxHealthyBacklogRatePerMinute": 1,
"minHealthySubscribedTopicFiltersCount": 1,
"maxHealthySubscribedTopicFiltersCount": 1000,
"sessionHealth": "healthy|unhealthy|offline",
"totalMessagesPublished": 0,
"publishRatePerMinute": 0,
"publishRatePerMinuteLast10Minutes": 0,
"publishRatePerMinuteInSession": 0,
"publishRatePerHour": 0,
"totalMessagesReceived": 0,
"receiveMessagesPerMinute": 0,
"receiveMessagesPerMinuteLast10Minutes": 0,
"receiveMessagesPerMinuteSinceInSession": 0,
"receiveMessagesPerHour": 0,
"currentDeliveryBacklogged": 0,
"deliveryBacklogRatePerMinute": 0,
"deliveryBacklogRatePerMinuteLast10Minutes": 0,
"deliveryBacklogRatePerMinuteInSession": 0,
"deliveryBacklogRatePerHour": 0,
"deliveryBacklogRatePerDay": 0
},
"willTopic": "some/Topic/Name/",
"willQoS": 2,
"willPayload": "This message is sent when client disconnects.",
"willRetain": true,
"subscriberCount": 0,
"subscribedTopics": [],
"publishedTopics": [],
"metadata": {}
},
{
"clientName": "client2",
"sessionStatus": "normal",
"username": "some/Topic/Name/",
"ipaddress": "127.0.0.1",
"port": 60678,
"mqttProtocol": "3.1.1",
"keepAliveSeconds": 0,
"connectionStatus": "connected",
"connectionDateTime": "2025-09-17T16:01:59",
"lastFailedConnectDateTime": "2025-09-18T20:56:25",
"lastFailedConnectReason": "API session is already in use",
"defaultBinaryFormat": "hex",
"defaultVariantFormat": "json",
"defaultResponseOptions": {
"binaryFormat": "hex",
"variantFormat": "json",
"dataFormat": "objects",
"numberFormat": "number"
},
"sessionType": "mqApi",
"stats": {
"minHealthySendRatePerMinute": 1,
"maxHealthySendRatePerMinute": 1000,
"maxHealthyBacklogRatePerMinute": 1,
"minHealthySubscribedTopicFiltersCount": 1,
"maxHealthySubscribedTopicFiltersCount": 1000,
"sessionHealth": "unhealthy",
"totalMessagesPublished": 0,
"publishRatePerMinute": 0,
"publishRatePerMinuteLast10Minutes": 0,
"publishRatePerMinuteInSession": 0,
"publishRatePerHour": 0,
"totalMessagesReceived": 0,
"receiveMessagesPerMinute": 0,
"receiveMessagesPerMinuteLast10Minutes": 0,
"receiveMessagesPerMinuteSinceInSession": 0,
"receiveMessagesPerHour": 0,
"currentDeliveryBacklogged": 0,
"deliveryBacklogRatePerMinute": 0,
"deliveryBacklogRatePerMinuteLast10Minutes": 0,
"deliveryBacklogRatePerMinuteInSession": 0,
"deliveryBacklogRatePerHour": 0,
"deliveryBacklogRatePerDay": 0
},
"subscriberCount": 0,
"subscribedTopics": [],
"publishedTopics": [],
"metadata": {}
}
]
},
}
Properties
Request properties ("params")
| Property | Description | Default | Type | Limits (inclusive) |
|---|---|---|---|---|
clientNames |
The Connection authorization is done using an account name with a password or a client certificate. The The MQ API allows multiple processes to simultaneously use the same client name to manage sessions, subscribe to topics, send messages to topics, and retrieve messages from topics. The MQTT protocol allows only one connection per client identifier because each connection is stateful. If another client with the same |
Optional with default of ""
|
an array of "clientName" strings |
0 or more strings |
includePublishedTopics |
The |
Optional with default of true
|
Boolean |
|
includeStats |
The |
Optional with default of true
|
Boolean |
|
includeSubscribedTopics |
The |
Optional with default of true
|
Boolean |
|
Response properties ("result")
| Property | Description | Type | Limits (inclusive) |
|---|---|---|---|
data |
The |
array of objects | The action determines its contents. |
|
data .cleanSession |
The The |
Boolean |
|
|
data .clientName |
The "Clientname" property uniquely identifies an MQ session. |
string | |
|
data .connectionDateTime |
The "connectionDateTime" property specifies the date and time when the connection to the session was made. |
timestamp | An ISO 8601 timestamp |
|
data .connectionStatus |
The
|
string |
|
|
data .defaultBinaryFormat |
Defines the default value of "binaryFormat". |
string | One of the following: "base64", "hex", or "byteArray". |
|
data .defaultResponseOptions |
The JSON NAV allows you to choose how your program detects errors. By default, all error properties are included in each response – unless you override this behavior as shown in the example. The example omits the error object in all responses which makes it easier for statically typed languages, such as C, C++, Java, C#, and VB, because they prefer properties to always be present. To help these languages, the Example "defaultResponseOptions": {
"binaryFormat": "hex",
"dataFormat": "objects",
"numberFormat": "number",
"variantFormat": "json"
} |
object |
|
|
data defaultResponseOptions .binaryFormat |
The "binaryFormat" property designates the format of binary values embedded in JSON strings. See binaryFormat for more details. |
string | One of the following: "base64", "hex", or "byteArray". |
|
data defaultResponseOptions .dataFormat |
The There are three different (but similar) versions of the "dataFormat" property:
Two of those versions occur in a request, and another occurs in a response. They all indicate how data is formatted.
|
string |
|
|
data defaultResponseOptions .numberFormat |
The |
string |
|
|
data defaultResponseOptions .variantFormat |
The "variantFormat" property tells the server how to interpret the variant data included in a JSON Action request. For more details, see "variantFormat". |
string |
|
|
data .defaultVariantFormat |
The |
string |
|
|
data .ipaddress |
The "ipAddress" property specifies the PLC/Equipment IPV4 Address. |
string | A valid IP address |
|
data .keepAliveSeconds |
The |
integer | No limit |
|
data .lastFailedConnectDateTime |
The "lastFailedConnectDateTime" property specifies the last date and time the connection was interrupted. |
timestamp | An ISO 8601 timestamp |
|
data .lastFailedConnectReason |
The "lastFailedConnectReason" property specifies the reason why the connection was interrupted most recently. |
string | No limit |
|
data .metadata |
The "metadata" property contains user-defined properties that add keywords and tags about the code package. The server indexes this field with a full-text index so you can search for any word or phrase to find code packages. |
object | 0 or more key/value pairs |
|
data .mqttProtocol |
The "mqttProtocol" property specifies the version of MQTT protocol to use in your session. |
string enum |
|
|
data .port |
The |
integer | an integer port number |
|
data .publishedTopics |
The |
string | 1 to 65,500 bytes |
|
data .sessionStatus |
The
|
string enum |
|
|
data .sessionType |
The "sessionType" property specifies which type of session the requested client is currently running. |
string |
|
|
data .stats |
Contains stats about describeMqSessions. | object |
|
|
data stats .currentDeliveryBacklogged |
|||
|
data stats .deliveryBacklogRatePerDay |
|||
|
data stats .deliveryBacklogRatePerHour |
|||
|
data stats .deliveryBacklogRatePerMinute |
|||
|
data stats .deliveryBacklogRatePerMinuteInSession |
|||
|
data stats .deliveryBacklogRatePerMinuteLast10Minutes |
|||
|
data stats .maxHealthyBacklogRatePerMinute |
The A connected session is healthy when its message backlog rate does not exceed the maximum. The |
integer | Any positive integer |
|
data stats .maxHealthySendRatePerMinute |
The A connected session is healthy when its message send rate does not exceed the maximum. The |
integer | Any positive integer |
|
data stats .maxHealthySubscribedTopicFiltersCount |
The A connected session is healthy when it has subscribed to at most the maximum number of topic filters. The A topic filter may include MQTT wildcard characters, which allows one topic filter to subscribe to many topics. The |
integer | Any positive integer |
|
data stats .minHealthySendRatePerMinute |
The A connected session is healthy when its message send rate exceeds the minimum. The |
integer | Any positive number |
|
data stats .minHealthySubscribedTopicFiltersCount |
The A connected session is healthy when it has subscribed to at least the minimum number of topic filters. The A topic filter may include MQTT wildcard characters, which allows one topic filter to subscribe to many topics. The |
integer | Any positive number |
|
data stats .publishRatePerHour |
|||
|
data stats .publishRatePerMinute |
|||
|
data stats .publishRatePerMinuteInSession |
|||
|
data stats .publishRatePerMinuteLast10Minutes |
|||
|
data stats .receiveMessagesPerHour |
|||
|
data stats .receiveMessagesPerMinute |
|||
|
data stats .receiveMessagesPerMinuteLast10Minutes |
|||
|
data stats .receiveMessagesPerMinuteSinceInSession |
|||
|
data stats .sessionHealth |
The |
enum |
|
|
data stats .totalMessagesPublished |
|||
|
data stats .totalMessagesReceived |
|||
|
data .subscribedTopics |
The "subscribedTopics" property lists the topics that the specified topic is subscribed to. |
array | No limits |
|
data .subscriberCount |
Specifies the number of subscribers | integer | Number of subscribers |
|
data .temporarySession |
The When Use the |
Boolean |
|
|
data .username |
The "username" property specifies the name that uniquely identifies the account. |
string | 1 to 64 bytes |
|
data .willPayload |
The |
JSON | |
|
data .willQoS |
The property |
integer | |
|
data .willRetain |
When |
Boolean |
|
|
data .willTopic |
The "willTopic" property contains the topic that the FairCom server will use to publish the will message. If you set it to an empty string, "", null, or omit it, the FairCom server will not add the will message to the connection. |
UTF-8 string |