# Alibaba Cloud Light Message Queue MQTT API

> Alibaba Cloud Light Message Queue MQTT API on Apizie: 53 endpoints (ApsaraMQ for MQTT supports device verification using X.509 certificates. A certificate authority (CA)…, Device certificates, issued by certificate authority (CA) certificates, are used by the ApsaraMQ for MQTT…, Adds a device to the connection blacklist to disable connections from the device, Adds the information about identity authentication. The identity can be accurate to a client, …) returned as clean JSON through one API key. Send your own provider key in the x-upstream-key header. Call it over REST at https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/{endpoint} or from Claude, ChatGPT and Cursor through the Apizie MCP server. Free plan: 1,000 requests a month.

- Project key: `cloud:aliyun-onsmqtt`
- Category: Cloud
- Status: byok
- Source: https://api.alibabacloud.com/product/onsmqtt
- Page: https://zieapi.vercel.app/api/cloud/aliyun-onsmqtt
- OpenAPI: https://zieapi.vercel.app/api/cloud/aliyun-onsmqtt/openapi.json

Alibaba Cloud OpenAPI for Light Message Queue MQTT (onsmqtt, version 2020-04-20). Calls are signed with ACS3-HMAC-SHA256 using your AccessKey ID and secret.

## Endpoints

### ApsaraMQ for MQTT supports device verification using X.509 certificates. A certificate authority (CA)…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/active-ca-certificate` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttInstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance to which the CA certificate is bound |
| Sn | string | yes | The serial number of the CA certificate that you want to reactivate. The serial number is the unique identifier of a CA certificate. The… |

### Device certificates, issued by certificate authority (CA) certificates, are used by the ApsaraMQ for MQTT…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/active-device-certificate` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttInstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance to which the device certificate is bound |
| DeviceSn | string | yes | The serial number of the device certificate that you want to reactivate. The serial number is the unique identifier of a device certificate |
| CaSn | string | yes | The serial number of the CA certificate that issued the device certificate. The serial number is the unique identifier of a CA… |

### Adds a device to the connection blacklist to disable connections from the device
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/add-custom-auth-connect-black` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance |
| ClientId | string | yes | The client ID of the device whose connections you want to disable |

### Adds the information about identity authentication. The identity can be accurate to a client
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/add-custom-auth-identity` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | The ID of the Message Queue for MQTT instance |
| Username | string | yes | The username |
| Secret | string | yes | The AccessKey secret |
| IdentityType | string | yes | The identity type. Valid values: USER CLIENT |
| ClientId | string | no | The client ID if you set IdentityType to CLIENT |
| SignMode | string | yes | The signature verification mode. ORIGIN: compares the password and the AccessKey secret. SIGNED: uses the HMAC_SHA1 algorithm to sign the… |

### Grants permissions on topics. You must create a parent topic in the console before you call this API operation
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/add-custom-auth-permission` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance |
| IdentityType | string | yes | The identity type. Valid values: USER and CLIENT |
| Identity | string | yes | The username or client ID |
| PermitAction | string | yes | The permissions that you want to grant |
| Effect | string | yes | Specifies whether to allow or deny access |
| Topic | string | yes | The topics on which you want to grant permissions. Multi-level topics and wildcard characters are supported |

### Applies for a token from ApsaraMQ for MQTT. If token-based authentication is used for permission…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/apply-token` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| Resources | string | yes | The topics on the ApsaraMQ for MQTT instance. Separate multiple topics with commas (,). Each token can be used to access up to 100 topics.… |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance. The ID must be consistent with the ID of the instance that the ApsaraMQ for MQTT client uses.… |
| ExpireTime | integer | yes | The timestamp that indicates the point in time when the token expires. Unit: milliseconds. The minimum validity period of a token is 60… |
| Actions | string | yes | The permission type of the token. Valid values: R: read-only. You can only subscribe to the specified topics. W: write-only. You can only… |

### Queries the online status of multiple clients by client ID
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/batch-query-session-by-client-ids` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | The instance ID of ApsaraMQ for MQTT. Must match the instance ID used by the client. Find it on the Instance Details page in the console… |
| ClientIdList | string | yes | The client IDs to query (JSON-encoded) |

### Proactively closes an online connection. After you call this API operation, the device may reconnect to the…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/close-connection` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | ID of the Micro Message Queue MQTT version instance |
| ClientId | string | yes | Client ID of the device |

### Message producers and consumers must specify a unique Client ID when they connect to ApsaraMQ for MQTT to…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/create-group-id` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| GroupId | string | yes | The ID of the group to create. This ID must meet the following requirements: The ID must be 7 to 64 characters in length, start with… |
| InstanceId | string | yes | The ID of the instance to which the group ID belongs |
| Tag | string | no | An array of tag key-value pairs (JSON-encoded) |

### Deletes a certificate authority (CA) certificate from an ApsaraMQ for MQTT broker. ApsaraMQ for MQTT allows…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/delete-ca-certificate` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttInstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance to which the CA certificate is bound |
| Sn | string | yes | The serial number of the CA certificate that you want to delete. The serial number is the unique identifier of a CA certificate. The… |

### Deletes a connection blacklist
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/delete-custom-auth-connect-black` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance |
| ClientId | string | yes | The ID of the ApsaraMQ for MQTT client |

### Deletes an identity for custom authorization
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/delete-custom-auth-identity` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance |
| Username | string | yes | The username |
| IdentityType | string | yes | The identity type. Valid values: USER CLIENT |
| ClientId | string | no | The client ID if you set IdentityType to CLIENT |

### Deletes permissions on a topic
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/delete-custom-auth-permission` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance |
| IdentityType | string | yes | The identity type. Valid values: USER CLIENT |
| Identity | string | yes | The username or client ID |
| Topic | string | yes | The topic on which you want to grant permissions. Multi-level topics and Wildcard characters are supported |

### Deletes the registration information about a specific device certificate from an ApsaraMQ for MQTT broker.…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/delete-device-certificate` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttInstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance to which the device certificate is bound |
| DeviceSn | string | yes | The serial number of the device certificate whose registration information you want to delete. The serial number is the unique identifier… |
| CaSn | string | yes | The serial number of the CA certificate to which the device certificate belongs. The serial number is the unique identifier of a CA… |

### Deletes a Group ID from an ApsaraMQ for MQTT instance
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/delete-group-id` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| GroupId | string | yes | The Group ID to delete |
| InstanceId | string | yes | The ApsaraMQ for MQTT instance ID |

### Deletes wildcard subscriptions in batches
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/delete-wildcard-by-topic` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | The ID of the instance to which the group ID that you want to delete belongs |
| FirstTopic | string | yes | The first-level topic |
| Wildcards | string | yes | The wildcard subscriptions to delete |

### Downgrades the virtual IP address (VIP) access of a specific instance during the disaster recovery of…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/disaster-downgrade` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance |
| DowngradeInstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance for which you want to downgrade the VIP access |

### Restores Internet access for an instance using its virtual IP address (VIP) for graceful recovery in a…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/disaster-recovery` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance |
| RecoveryInstanceId | string | yes | The ID of the instance to recover |

### Queries the details of a certificate authority (CA) certificate, such as the content and status of the…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/get-ca-certificate` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttInstanceId | string | yes | The instance ID bound to the CA certificate, which is the instance ID of the MQTT version of the cloud message queue |
| Sn | string | yes | The SN serial number of the CA certificate to be queried, used to uniquely identify a CA certificate |

### Queries the details of a device certificate. Device certificates are digital certificates issued to clients…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/get-device-certificate` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttInstanceId | string | yes | The instance ID to which the device certificate is bound, i.e., the instance ID of the Cloud Message Queue MQTT version |
| DeviceSn | string | yes | The SN serial number of the device certificate to be queried, used to uniquely identify a device certificate. Value range: no more than… |
| CaSn | string | yes | The SN serial number of the CA certificate to which the device certificate to be queried belongs, used to uniquely identify a CA… |

### Queries the access credential of a device. If unique-certificate-per-device authentication is used as the…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/get-device-credential` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| ClientId | string | yes | The client ID of the device whose access credential you want to query |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance. The ID must be consistent with the ID of the instance that the ApsaraMQ for MQTT client uses.… |

### Obtains the registration code of a specific certificate authority (CA) certificate. When you register a CA…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/get-register-code` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttInstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance |

### ApsaraMQ for MQTT supports X.509 certificate-based device verification. Clients use device certificates for…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/inactivate-ca-certificate` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttInstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance to which the CA certificate is attached |
| Sn | string | yes | The serial number (SN) of the CA certificate that you want to unregister. The SN uniquely identifies a CA certificate. The value can be up… |

### A device certificate is a digital certificate that a root Certificate Authority (CA) issues to a client…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/inactivate-device-certificate` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttInstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance to which the device certificate is attached |
| DeviceSn | string | yes | The serial number (SN) of the device certificate that you want to inactivate. The SN uniquely identifies a device certificate |
| CaSn | string | yes | The SN of the CA certificate to which the device certificate belongs. The SN uniquely identifies a CA certificate. The value can be up to… |

### Queries all certificate authority (CA) certificates that are registered with an ApsaraMQ for MQTT instance.…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/list-ca-certificate` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttInstanceId | string | yes | The instance ID of the Cloud Message Queue MQTT version, indicating which instance's CA certificates need to be viewed |
| PageNo | string | yes | Indicates the page number of the returned results. The starting page is counted from 1 |
| PageSize | string | yes | The maximum number of query records to display per page. Value range: 1 to 100 |

### Queries all device certificates that are registered with an ApsaraMQ for MQTT instance. Device certificates…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/list-device-certificate` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttInstanceId | string | yes | The instance ID of the Cloud Message Queue MQTT version, indicating which instance's device certificates need to be viewed |
| PageNo | string | yes | Indicates which page of the results to return. The starting page is counted from 1 |
| PageSize | string | yes | The maximum number of query records to display per page. Value range: 1 to 100 |

### Queries all device certificates that are issued by a certificate authority (CA) certificate and registered…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/list-device-certificate-by-ca-sn` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttInstanceId | string | yes | The instance ID bound to the CA certificate, which is the instance ID of the MQTT version of the cloud message queue |
| PageNo | string | yes | Indicates the page number of the returned results. The starting page is counted from 1 |
| PageSize | string | yes | The maximum number of query records to display per page. Value range: 1 to 100 |
| CaSn | string | yes | The SN serial number of the CA certificate to be queried, indicating which CA certificate's registered device certificates are to be… |

### Queries clients that have applied for access credentials in unique-certificate-per-device authentication…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/list-device-credential-client-id` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | The ID of the Cloud Message Queue MQTT version instance, which must match the actual instance ID used by the client. You can obtain this… |
| GroupId | string | yes | Group ID of the MQTT version of the micro message queue |
| PageNo | string | no | Indicates the page number of the returned results. The starting page is counted from 1 |
| PageSize | string | yes | The maximum number of query records to display per page. Value range: 1 to 100 |
| NextToken | string | no | Token for starting the next page query |

### You can call the ListGroupId operation to query all Group IDs in an instance
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/list-group-id` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | The ID of the instance for which you want to list group IDs |
| Tag | string | no | The list of tags (JSON-encoded) |

### You can call this operation to query a list of instances
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/list-instances` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| Tags | string | no | A list of resource tags in JSON format |

### Lists the tags that are attached to one or more resources
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/list-tag-resources` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| ResourceType | string | yes | The resource type. The only valid value is instance |
| ResourceId | string | no | A list of resource IDs (JSON-encoded) |
| Tag | string | no | A list of resource tags. ResourceId and Tag cannot both be empty (JSON-encoded) |
| NextToken | string | no | The token to start the next query |

### Queries a client ID in a connection blacklist
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/query-custom-auth-connect-black` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance |
| ClientId | string | no | The ID of the client to be queried |
| NextToken | string | no | The token that marks the end position of the previous returned page. To obtain the next batch of data, call the operation again by using… |
| Size | integer | yes | The number of clients to be queried. Maximum value: 100 |

### Queries custom identity authentication
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/query-custom-auth-identity` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance |
| Username | string | no | The username |
| IdentityType | string | no | The identity type |
| ClientId | string | no | The client ID of the device. You can specify this parameter when the identity type is CLIENT |
| NextToken | string | no | The token that marks the end position of the current query. You can pass this token as a parameter in the next call to continue… |
| Size | integer | yes | The number of entries to query. Maximum value: 100 |

### Queries the authorization information about a topic
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/query-custom-auth-permission` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance |
| IdentityType | string | no | The identity type |
| Identity | string | no | The username or client ID |
| Topic | string | no | The topic whose authorization information you want to query. Multi-level topics and wildcard characters are supported |
| NextToken | string | no | The token that marks the end position of the previous returned page. To obtain the next batch of data, call the operation again by using… |
| Size | integer | yes | The number of queries to be returned. Maximum value: 100 |

### Queries the device trace of an ApsaraMQ for MQTT client by paging. When a device encounters an exception,…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/query-mqtt-trace-device` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttRegionId | string | yes | The region ID of the ApsaraMQ for MQTT instance. For more information, see https://help.aliyun.com/document_detail/181438.html |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance. This value must match the instance ID that the client actually uses. You can view the instance… |
| Reverse | string | no | Specifies whether to display the results in reverse chronological order. Valid values: true: Results are displayed in reverse… |
| ClientId | string | yes | The client ID of the device whose trace information you want to query |
| BeginTime | integer | yes | The beginning of the time range to query. Unit: milliseconds |
| EndTime | integer | yes | The end of the time range to query. Unit: milliseconds |
| CurrentPage | integer | yes | The number of the page to return. Pages start from page 1. If the value of this parameter exceeds the total number of pages, an empty… |
| PageSize | integer | yes | The maximum number of MSMQ to display on each page for paging. Minimum value: 1. Maximum value: 100 |

### Queries messages on a device within a specific period of time. If a message is not sent or received as…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/query-mqtt-trace-message-of-client` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttRegionId | string | yes | The ID of the region where the ApsaraMQ for MQTT instance resides. For more information, see… |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance. The ID must be consistent with the ID of the instance that the ApsaraMQ for MQTT client uses.… |
| ClientId | string | yes | The client ID of the device whose messages you want to query |
| BeginTime | integer | yes | The beginning of the time range to query. The value of this parameter is a UNIX timestamp in milliseconds |
| EndTime | integer | yes | The end of the time range to query. The value of this parameter is a UNIX timestamp in milliseconds |
| CurrentPage | integer | yes | The number of the page to return. Pages start from page 1. If the input parameter value is greater than the total number of pages, the… |
| PageSize | integer | yes | The number of entries to return on each page. Valid values: 1 to 100 |
| Reverse | string | no | Specifies whether the returned results are displayed in reverse chronological order. Valid values: true: The returned results are… |

### Queries the trace of a message. If a message is not sent or received as expected, you can call this…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/query-mqtt-trace-message-publish` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttRegionId | string | yes | The ID of the region where the ApsaraMQ for MQTT instance resides. For more information, see… |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance. The ID must be consistent with the ID of the instance that the ApsaraMQ for MQTT client uses.… |
| MsgId | string | yes | The message ID |
| BeginTime | integer | yes | The beginning of the time range to query. The value of this parameter is a UNIX timestamp in milliseconds |
| EndTime | integer | yes | The end of the time range to query. The value of this parameter is a UNIX timestamp in milliseconds |

### Queries the delivery trace of a message. If a message is not sent or received as expected, you can call this…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/query-mqtt-trace-message-subscribe` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttRegionId | string | yes | The ID of the region where the ApsaraMQ for MQTT instance resides. For more information, see… |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance. The ID must be consistent with the ID of the instance that the ApsaraMQ for MQTT client uses.… |
| Reverse | string | no | Specifies whether the returned results are displayed in reverse chronological order. Valid values: true: The returned results are… |
| ClientId | string | no | The ID of the client that subscribes to the message. If you do not specify this parameter, the IDs of all clients that subscribe to the… |
| BeginTime | integer | yes | The beginning of the time range to query. The value of this parameter is a UNIX timestamp in milliseconds |
| EndTime | integer | yes | The end of the time range to query. The value of this parameter is a UNIX timestamp in milliseconds |
| CurrentPage | integer | yes | The number of the page to return. Pages start from page 1. If the input parameter value is greater than the total number of pages, the… |
| PageSize | integer | yes | The number of entries to return on each page. Valid values: 1 to 100 |
| MsgId | string | yes | The message ID |

### Queries the running status of an ApsaraMQ for MQTT client. You can troubleshoot issues based on the queried…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/query-session-by-client-id` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| ClientId | string | yes | The ID of the ApsaraMQ for MQTT client that you want to query |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance. The ID must be consistent with the ID of the instance that the ApsaraMQ for MQTT client uses.… |

### Queries the status of a token. If token-based authentication is used for permission authentication on an…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/query-token` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| Token | string | yes | The token that you want to query |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance. The ID must be consistent with the ID of the instance that the ApsaraMQ for MQTT client uses.… |

### Queries all wildcards and the upper limit under a specific topic
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/query-wildcard-by-topic` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance |
| FirstTopic | string | yes | The parent topic |
| PageNo | integer | no | The page number of the results to return. Pages start from page 1 |
| PageSize | integer | no | The maximum number of records to display per page. Valid values: 1 to 100 |

### Updates the access credential of a device
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/refresh-device-credential` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| ClientId | string | yes | The client ID of the device whose access credential you want to update |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance. The ID must be consistent with the ID of the instance that the ApsaraMQ for MQTT client uses.… |

### RegisterCaCertificate
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/register-ca-certificate` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttInstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance to which you want to bind the CA certificate |
| CaName | string | yes | The name of the CA certificate that you want to register with an ApsaraMQ for MQTT broker |
| CaContent | string | yes | The content of the CA certificate that you want to register with an ApsaraMQ for MQTT broker. In the example, indicates a line feed |
| VerificationContent | string | yes | The content of the validation certificate issued by the CA certificate that you want to register with an ApsaraMQ for MQTT broker. The… |

### Registers an access credential for a device. In unique-certificate-per-device authentication mode, an…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/register-device-credential` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| ClientId | string | yes | The client ID of the device for which you want to create an access credential |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance. The ID must be consistent with the ID of the instance that the ApsaraMQ for MQTT client uses.… |

### Revokes a token
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/revoke-token` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| Token | string | yes | The token that you want to revoke |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance. The ID must be consistent with the ID of the instance that the ApsaraMQ for MQTT client uses.… |

### Sends a single message from an application on a cloud server to ApsaraMQ for MQTT
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/send-message` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttTopic | string | yes | The topic to which you want to send a message on the ApsaraMQ for MQTT instance |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance. The ID must be consistent with the ID of the instance that the ApsaraMQ for MQTT client uses.… |
| Payload | string | yes | The message content, which is the payload of the message. We recommend that you encode the content in Base64 to prevent non-printable… |

### Configures a multi-domain certificate
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/set-sni-config` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| MqttInstanceId | string | yes | The instance ID |
| DefaultCertificate | string | yes | The default certificate. This certificate is returned if no matching domain name is found in the server certificate list |
| SniConfig | string | no | The Server Name Indication (SNI) configuration that maps domain names to certificates. Format: DomainName#CertificateID#Password(if… |

### Adds tags to resources
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/tag-resources` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| ResourceType | string | yes | The resource type. The value must be instance |
| ResourceId | string | yes | A list of resource IDs (JSON-encoded) |
| Tag | string | yes | A list of tags. You can add up to 20 tags at a time. A resource can have a maximum of 20 tags (JSON-encoded) |

### Deregisters the access credential of a device. After the access credential of a device is deregistered, you…
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/un-register-device-credential` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| ClientId | string | yes | The client ID of the device whose access credential you want to deregister |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance. The ID must be consistent with the ID of the instance that the ApsaraMQ for MQTT client uses.… |

### Removes tags from resources
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/untag-resources` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| TagKey | string | no | A list of tag keys to remove (JSON-encoded) |
| ResourceId | string | yes | A list of resource IDs (JSON-encoded) |
| ResourceType | string | yes | The type of the resource. The value must be \`instance\` |
| All | string | no | Specifies whether to remove all tags from the resources. This parameter takes effect only when `TagKey.N` is empty. Valid values: true… |

### Updates the information about custom identity authentication
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/update-custom-auth-identity` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | The ID of the ApsaraMQ for MQTT instance |
| Username | string | yes | The username. The value cannot exceed 64 characters in length |
| Secret | string | yes | The AccessKey secret |
| IdentityType | string | yes | The identity type. Valid values: USER CLIENT |
| ClientId | string | no | The client ID if you set IdentityType to CLIENT |
| SignMode | string | yes | The signature verification mode. ORIGIN: compares the password and the AccessKey secret. SIGNED: uses the HMAC_SHA1 algorithm to sign the… |

### Updates the permissions on a topic
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/update-custom-auth-permission` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |
| InstanceId | string | yes | ID of the Cloud Message Queue MQTT version instance |
| IdentityType | string | yes | The identity type. Valid values: USER CLIENT |
| Identity | string | yes | Username or Client ID |
| PermitAction | string | yes | The permissions that you want to grant |
| Effect | string | yes | Specifies whether to allow or deny access |
| Topic | string | yes | Authorized Topic, supporting multi-level MQTT topics and wildcards |

### version
`POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/version` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | no | Regional endpoint, for example https://onsmqtt.ap-southeast-1.aliyuncs.com |

## Example
```
curl "https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/active-ca-certificate" \
  -H "x-api-key: $APIZIE_KEY" \
  -H "x-upstream-key: $PROVIDER_KEY"
```

## FAQ

### How do I call the Alibaba Cloud Light Message Queue MQTT API?
Create a free Apizie key, then send POST https://zieapi.vercel.app/v1/cloud:aliyun-onsmqtt/active-ca-certificate with the header x-api-key. Every endpoint returns { project, data, timestamp }.

### Is the Alibaba Cloud Light Message Queue MQTT API free on Apizie?
Yes. The Free plan includes 1,000 requests a month at 100 requests a minute, no credit card. Alibaba Cloud Light Message Queue MQTT itself also needs your own key from aliyuncs.com.

### Can AI agents use the Alibaba Cloud Light Message Queue MQTT API?
Yes. Add the Apizie MCP server (https://zieapi.vercel.app/mcp) to Claude, ChatGPT, Cursor or VS Code, then ask in plain language. The agent calls run_scraper with project key cloud:aliyun-onsmqtt.

### What is the status of the Alibaba Cloud Light Message Queue MQTT API?
Needs your own provider key (bring your own key)
