Download OpenAPI specification:Download
Describe a plugin according to its release.json
and README.md
.
name required | string Example: emqx_plugin_template-5.0-rc.1 ^[A-Za-z]+[A-Za-z0-9-_.]*$ |
{- "name": "emqx_plugin_template-5.0-rc.1",
- "author": [
- "EMQX Team"
], - "builder": {
- "contact": "emqx-support@emqx.io",
- "name": "EMQX Team",
- "website": "www.emqx.com"
}, - "built_on_otp_release": "24",
- "compatibility": {
- "emqx": "~>5.0"
}, - "git_commit_or_build_date": "2021-12-25",
- "functionality": [
- "Demo"
], - "git_ref": "ddab50fafeed6b1faea70fc9ffd8c700d7e26ec1",
- "metadata_vsn": "0.1.0",
- "rel_vsn": "5.0-rc.1",
- "rel_apps": [
- "emqx_plugin_template-5.0.0",
- "map_sets-1.1.0"
], - "description": "This is an demo plugin description",
- "running_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": "running"
}
], - "readme": "This is an demo plugin."
}
Uninstalls a previously uploaded plugin package.
name required | string Example: emqx_plugin_template-5.0-rc.1 ^[A-Za-z]+[A-Za-z0-9-_.]*$ |
{- "code": "PARAM_ERROR",
- "message": "string"
}
Update plugin config. Config schema defined by user's schema.avsc file.
name required | string Example: emqx_plugin_template-5.0-rc.1 ^[A-Za-z]+[A-Za-z0-9-_.]*$ |
{ }
{- "code": "BAD_CONFIG",
- "message": "string"
}
start/stop a installed plugin.
- start: start the plugin.
- stop: stop the plugin.
name required | string Example: emqx_plugin_template-5.0-rc.1 ^[A-Za-z]+[A-Za-z0-9-_.]*$ |
action required | string Enum: "start" "stop" Action |
{- "code": "NOT_FOUND",
- "message": "string"
}
Plugins are launched in top-down order.
Use POST /plugins/{name}/move
to change the boot order.
[- {
- "name": "emqx_plugin_template-5.0-rc.1",
- "author": [
- "EMQX Team"
], - "builder": {
- "contact": "emqx-support@emqx.io",
- "name": "EMQX Team",
- "website": "www.emqx.com"
}, - "built_on_otp_release": "24",
- "compatibility": {
- "emqx": "~>5.0"
}, - "git_commit_or_build_date": "2021-12-25",
- "functionality": [
- "Demo"
], - "git_ref": "ddab50fafeed6b1faea70fc9ffd8c700d7e26ec1",
- "metadata_vsn": "0.1.0",
- "rel_vsn": "5.0-rc.1",
- "rel_apps": [
- "emqx_plugin_template-5.0.0",
- "map_sets-1.1.0"
], - "description": "This is an demo plugin description",
- "running_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": "running"
}
], - "readme": "This is an demo plugin."
}
]
Setting the boot order of plugins.
name required | string Example: emqx_plugin_template-5.0-rc.1 ^[A-Za-z]+[A-Za-z0-9-_.]*$ |
string or string or string
|
{- "position": "after:emqx_plugin_demo-5.1-rc.2"
}
{- "code": "MOVE_FAILED",
- "message": "string"
}
Upload a plugin tarball (plugin-vsn.tar.gz).Follow emqx-plugin-template to develop plugin.
plugin | string <binary> |
{- "code": "UNEXPECTED_ERROR",
- "message": "string"
}
Move authenticator in global authentication chain.
id required | string Authenticator ID. |
position required | string Example: before:password_based:built_in_database Position of authenticator in chain. Possible values are 'front', 'rear', 'before:{other_authenticator}', 'after:{other_authenticator}'. |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get user from authenticator in global authentication chain.
id required | string Authenticator ID. |
user_id required | string User ID. |
{- "user_id": "user1"
}
Update user in authenticator in global authentication chain.
id required | string Authenticator ID. |
user_id required | string User ID. |
password required | string |
is_superuser | boolean Default: false |
{- "password": "******"
}
{- "regular_user": {
- "value": {
- "user_id": "user1"
}, - "summary": "Regular user"
}, - "super_user": {
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}, - "summary": "Superuser"
}
}
Delete user in authenticator in global authentication chain.
id required | string Authenticator ID. |
user_id required | string User ID. |
{- "code": "NOT_FOUND",
- "message": "string"
}
Import users into authenticator in global authentication chain.
id required | string Authenticator ID. |
type required | string Enum: "plain" "hash" Example: type=hash The import file template type, enum with |
Import body
filename | string <binary> |
{- "total": 0,
- "success": 0,
- "override": 0,
- "skipped": 0,
- "failed": 0
}
List users in authenticator in global authentication chain.
id required | string Authenticator ID. |
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page(max 10000) |
like_user_id | string Fuzzy search user_id (username or clientid). |
is_superuser | boolean Is superuser |
{- "data": [
- {
- "user_id": "user1"
}, - {
- "is_superuser": true,
- "user_id": "user2"
}
], - "meta": {
- "count": 300,
- "limit": 20,
- "page": 0
}
}
Create users for authenticator in global authentication chain.
id required | string Authenticator ID. |
user_id required | string |
password required | string |
is_superuser | boolean Default: false |
{- "password": "******",
- "user_id": "user1"
}
{- "user_id": "user1"
}
Get authenticator status from global authentication chain.
id required | string Authenticator ID. |
{- "status": "connected",
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": "connected"
}
], - "metrics": {
- "nomatch": 0,
- "total": 0,
- "success": 0,
- "failed": 0,
- "rate": 0,
- "rate_last5m": 0,
- "rate_max": 0
}, - "resource_metrics": {
- "success": 0,
- "matched": 0,
- "failed": 0,
- "rate": 0,
- "rate_last5m": 0,
- "rate_max": 0
}, - "node_error": [ ],
- "node_metrics": [
- {
- "node": "emqx@127.0.0.1",
- "metrics": {
- "nomatch": 0,
- "total": 0,
- "matched": 0,
- "failed": 0,
- "rate": 0,
- "rate_last5m": 0,
- "rate_max": 0
}
}
], - "node_resource_metrics": [
- {
- "node": "emqx@127.0.0.1",
- "metrics": {
- "success": 0,
- "matched": 0,
- "failed": 0,
- "rate": 0,
- "rate_last5m": 0,
- "rate_max": 0
}
}
]
}
Get authenticator from global authentication chain.
id required | string Authenticator ID. |
{- "mechanism": "jwt",
- "secret": "mysecret",
- "algorithm": "hmac-based",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
Update authenticator from global authentication chain.
id required | string Authenticator ID. |
mechanism required | string Value: "password_based" Authentication mechanism. |
backend required | string Value: "ldap" Backend type. |
query_timeout | string Default: "5s" Timeout for the LDAP query. |
enable | boolean Default: true Set to |
server required | string The IPv4 or IPv6 address or the hostname to connect to. |
pool_size | integer >= 1 Default: 8 Size of the connection pool towards the bridge target service. |
username required | string The username associated with the bridge in the external database used for authentication or identification purposes. |
password | string <password> The password associated with the bridge, used for authentication with the external database. |
base_dn required | string The name of the base object entry (or possibly the root) relative to |
filter | string Default: "(objectClass=mqttUser)" The filter that defines the conditions that must be fulfilled in order |
request_timeout | string Default: "10s" Sets the maximum time in milliseconds that is used for each individual request. |
object (ldap.ssl) | |
password_attribute | string Default: "userPassword" Indicates which attribute is used to represent the user's password. |
is_superuser_attribute | string Default: "isSuperuser" Indicates which attribute is used to represent whether the user is a superuser. |
{- "mechanism": "jwt",
- "secret": "mysecret",
- "algorithm": "hmac-based",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
List authenticators for global authentication.
[- {
- "mechanism": "jwt",
- "secret": "mysecret",
- "algorithm": "hmac-based",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}, - {
- "mechanism": "password_based",
- "backend": "built_in_database",
- "password_hash_algorithm": {
- "name": "sha256",
- "salt_position": "suffix"
}, - "user_id_type": "username"
}, - {
- "ssl": {
- "enable": false
}, - "connect_timeout": "5s",
- "mechanism": "password_based",
- "pool_size": 8,
- "body": {
- "password": "${password}",
- "username": "${username}"
}, - "headers": {
- "content-type": "application/json"
}, - "method": "post",
- "backend": "http",
- "request_timeout": "5s",
- "enable_pipelining": 100
}, - {
- "mechanism": "password_based",
- "filter": {
- "username": "${username}"
}, - "server": "127.0.0.1:27017",
- "database": "example",
- "backend": "mongodb",
- "password_hash_algorithm": {
- "name": "sha256",
- "salt_position": "suffix"
}, - "collection": "users",
- "is_superuser_field": "is_superuser",
- "password_hash_field": "password_hash",
- "salt_field": "salt"
}, - {
- "mechanism": "password_based",
- "cmd": "HMGET ${username} password_hash salt",
- "server": "127.0.0.1:6379",
- "database": 0,
- "backend": "redis",
- "password_hash_algorithm": {
- "name": "sha256",
- "salt_position": "suffix"
}, - "redis_type": "single"
}
]
Create authenticator for global authentication.
mechanism required | string Value: "password_based" Authentication mechanism. |
backend required | string Value: "ldap" Backend type. |
query_timeout | string Default: "5s" Timeout for the LDAP query. |
enable | boolean Default: true Set to |
server required | string The IPv4 or IPv6 address or the hostname to connect to. |
pool_size | integer >= 1 Default: 8 Size of the connection pool towards the bridge target service. |
username required | string The username associated with the bridge in the external database used for authentication or identification purposes. |
password | string <password> The password associated with the bridge, used for authentication with the external database. |
base_dn required | string The name of the base object entry (or possibly the root) relative to |
filter | string Default: "(objectClass=mqttUser)" The filter that defines the conditions that must be fulfilled in order |
request_timeout | string Default: "10s" Sets the maximum time in milliseconds that is used for each individual request. |
object (ldap.ssl) | |
password_attribute | string Default: "userPassword" Indicates which attribute is used to represent the user's password. |
is_superuser_attribute | string Default: "isSuperuser" Indicates which attribute is used to represent whether the user is a superuser. |
{- "mechanism": "jwt",
- "secret": "mysecret",
- "algorithm": "hmac-based",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
{- "mechanism": "jwt",
- "secret": "mysecret",
- "algorithm": "hmac-based",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
Reorder all authenticators in global authentication chain.
id required | string Authenticator ID. |
[- {
- "id": "password_based:built_in_database"
}
]
{- "code": "BAD_REQUEST",
- "message": "string"
}
Start bridge on all nodes in the cluster.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
operation required | string Value: "start" Example: start Operation can be one of: 'start'. |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Enable or Disable bridge on all nodes in the cluster.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
enable required | boolean Example: true Whether to enable this bridge. |
{- "code": "NOT_FOUND",
- "message": "string"
}
[- {
- "name": "my_http_action",
- "status": "connected",
- "type": "http",
- "enable": true,
- "parameters": {
- "path": "/room/${room_no}",
- "body": "${.}",
- "headers": { },
- "method": "post"
}, - "connector": "my_http_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "resource_opts": {
- "query_mode": "async",
- "health_check_interval": "15s",
- "worker_pool_size": 16
}
}, - {
- "name": "mqtt_action",
- "status": "connected",
- "type": "mqtt",
- "description": "My example mqtt action",
- "enable": true,
- "parameters": {
- "retain": false,
- "payload": "${.payload}",
- "topic": "remote/topic",
- "qos": 2
}, - "connector": "mqtt_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "resource_opts": {
- "health_check_interval": "30s"
}
}
]
Create a new bridge by type and name.
type required | string Value: "mqtt" |
name required | string |
local_topic | string MQTT topic or topic filter as data source (action input). If rule action is used as data source, this config should be left empty, otherwise messages will be duplicated in the remote system. |
required | object (bridge_mqtt_publisher.action_parameters) |
enable | boolean Default: true Enable (true) or disable (false) this action. |
connector required | string Name of the connector specified by the action, used for external resource selection. |
tags | Array of strings Tags to annotate this config entry. |
description | string Default: "" Descriptive text. |
object (bridge_mqtt_publisher.action_resource_opts) |
{- "name": "my_http_action",
- "type": "http",
- "enable": true,
- "parameters": {
- "path": "/room/${room_no}",
- "body": "${.}",
- "headers": { },
- "method": "post"
}, - "connector": "my_http_connector",
- "resource_opts": {
- "query_mode": "async",
- "health_check_interval": "15s",
- "worker_pool_size": 16
}
}
{- "name": "my_http_action",
- "status": "connected",
- "type": "http",
- "enable": true,
- "parameters": {
- "path": "/room/${room_no}",
- "body": "${.}",
- "headers": { },
- "method": "post"
}, - "connector": "my_http_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "resource_opts": {
- "query_mode": "async",
- "health_check_interval": "15s",
- "worker_pool_size": 16
}
}
Test creating a new bridge.
type required | string Value: "mqtt" |
name required | string |
local_topic | string MQTT topic or topic filter as data source (action input). If rule action is used as data source, this config should be left empty, otherwise messages will be duplicated in the remote system. |
required | object (bridge_mqtt_publisher.action_parameters) |
enable | boolean Default: true Enable (true) or disable (false) this action. |
connector required | string Name of the connector specified by the action, used for external resource selection. |
tags | Array of strings Tags to annotate this config entry. |
description | string Default: "" Descriptive text. |
object (bridge_mqtt_publisher.action_resource_opts) |
{- "name": "my_http_action",
- "type": "http",
- "enable": true,
- "parameters": {
- "path": "/room/${room_no}",
- "body": "${.}",
- "headers": { },
- "method": "post"
}, - "connector": "my_http_connector",
- "resource_opts": {
- "query_mode": "async",
- "health_check_interval": "15s",
- "worker_pool_size": 16
}
}
{- "code": "TEST_FAILED",
- "message": "string"
}
[- {
- "name": "myAction",
- "status": "connected",
- "type": "action_type",
- "enable": true,
- "rules": [
- "rule1",
- "rule2"
], - "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": "connected",
- "status_reason": ""
}
], - "created_at": 1736512728666,
- "status_reason": "",
- "last_modified_at": 1736512728666
}
]
Get a bridge by id.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
{- "name": "my_http_action",
- "status": "connected",
- "type": "http",
- "enable": true,
- "parameters": {
- "path": "/room/${room_no}",
- "body": "${.}",
- "headers": { },
- "method": "post"
}, - "connector": "my_http_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "resource_opts": {
- "query_mode": "async",
- "health_check_interval": "15s",
- "worker_pool_size": 16
}
}
Update a bridge by id.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
local_topic | string MQTT topic or topic filter as data source (action input). If rule action is used as data source, this config should be left empty, otherwise messages will be duplicated in the remote system. |
required | object (bridge_mqtt_publisher.action_parameters) |
enable | boolean Default: true Enable (true) or disable (false) this action. |
connector required | string Name of the connector specified by the action, used for external resource selection. |
tags | Array of strings Tags to annotate this config entry. |
description | string Default: "" Descriptive text. |
object (bridge_mqtt_publisher.action_resource_opts) |
{- "enable": true,
- "parameters": {
- "path": "/room/${room_no}",
- "body": "${.}",
- "headers": { },
- "method": "post"
}, - "connector": "my_http_connector",
- "resource_opts": {
- "query_mode": "async",
- "health_check_interval": "15s",
- "worker_pool_size": 16
}
}
{- "name": "my_http_action",
- "status": "connected",
- "type": "http",
- "enable": true,
- "parameters": {
- "path": "/room/${room_no}",
- "body": "${.}",
- "headers": { },
- "method": "post"
}, - "connector": "my_http_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "resource_opts": {
- "query_mode": "async",
- "health_check_interval": "15s",
- "worker_pool_size": 16
}
}
Delete a bridge by id.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
also_delete_dep_actions | boolean Default: false Whether to cascade delete dependent actions. |
{- "rules": [
- "string"
], - "code": "BAD_REQUEST",
- "message": "string"
}
Get bridge metrics by id.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
{- "metrics": {
- "dropped": 0,
- "dropped.other": 0,
- "dropped.queue_full": 0,
- "dropped.resource_not_found": 0,
- "dropped.resource_stopped": 0,
- "matched": 0,
- "queuing": 0,
- "retried": 0,
- "failed": 0,
- "inflight": 0,
- "success": 0,
- "rate": 0,
- "rate_max": 0,
- "rate_last5m": 0,
- "received": 0
}, - "node_metrics": [
- {
- "node": "emqx@127.0.0.1",
- "metrics": {
- "dropped": 0,
- "dropped.other": 0,
- "dropped.queue_full": 0,
- "dropped.resource_not_found": 0,
- "dropped.resource_stopped": 0,
- "matched": 0,
- "queuing": 0,
- "retried": 0,
- "failed": 0,
- "inflight": 0,
- "success": 0,
- "rate": 0,
- "rate_max": 0,
- "rate_last5m": 0,
- "received": 0
}
}
]
}
Start bridge on a specific node.
node required | |
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
operation required | string Value: "start" Example: start Operation can be one of: 'start'. |
{- "code": "BAD_REQUEST",
- "message": "string"
}
EMQX metrics
aggregate | boolean Whether to aggregate all nodes Metrics. Default value is 'true'. |
node | string Specify which specific node to fetch data from. If not provided, return values for all nodes. This parameter only works when 'aggregate' is 'false'. |
[ ]
EMQX stats
aggregate | boolean Calculation aggregate for all nodes |
{- "channels.count": 0,
- "channels.max": 0,
- "connections.count": 0,
- "connections.max": 0,
- "delayed.count": 0,
- "delayed.max": 0,
- "live_connections.count": 0,
- "live_connections.max": 0,
- "cluster_sessions.count": 0,
- "cluster_sessions.max": 0,
- "retained.count": 0,
- "retained.max": 0,
- "sessions.count": 0,
- "sessions.max": 0,
- "suboptions.count": 0,
- "suboptions.max": 0,
- "subscribers.count": 0,
- "subscribers.max": 0,
- "subscriptions.count": 0,
- "subscriptions.max": 0,
- "subscriptions.shared.count": 0,
- "subscriptions.shared.max": 0,
- "topics.count": 0,
- "topics.max": 0
}
Current monitor (statistics) data, e.g. number of connections and connection rate in the whole cluster.
{- "dropped_msg_rate": 0,
- "sent_msg_rate": 0,
- "persisted_rate": 0,
- "received_msg_rate": 0,
- "transformation_failed_rate": 0,
- "validation_failed_rate": 0,
- "transformation_succeeded_rate": 0,
- "validation_succeeded_rate": 0,
- "disconnected_durable_sessions": 0,
- "subscriptions_durable": 0,
- "subscriptions": 0,
- "topics": 0,
- "connections": 0,
- "live_connections": 0,
- "retained_msg_count": 0,
- "shared_subscriptions": 0
}
Node monitor (statistics) data, e.g. number of connections and connection rate on the specified node.
node required | string Example: emqx@127.0.0.1 EMQX node name. |
{- "dropped_msg_rate": 0,
- "sent_msg_rate": 0,
- "persisted_rate": 0,
- "received_msg_rate": 0,
- "transformation_failed_rate": 0,
- "validation_failed_rate": 0,
- "transformation_succeeded_rate": 0,
- "validation_succeeded_rate": 0,
- "disconnected_durable_sessions": 0,
- "subscriptions_durable": 0,
- "subscriptions": 0,
- "topics": 0,
- "connections": 0,
- "live_connections": 0,
- "node_uptime": 0,
- "retained_msg_count": 0,
- "shared_subscriptions": 0
}
List the monitor (statistics) data on the specified node.
node required | string Example: emqx@127.0.0.1 EMQX node name. |
latest | integer >= 1 Example: latest=300 The latest N seconds data. Like 300 for 5 min. |
[- {
- "time_stamp": 0,
- "disconnected_durable_sessions": 0,
- "subscriptions_durable": 0,
- "subscriptions": 0,
- "topics": 0,
- "connections": 0,
- "live_connections": 0,
- "received": 0,
- "sent": 0,
- "validation_succeeded": 0,
- "validation_failed": 0,
- "transformation_succeeded": 0,
- "transformation_failed": 0,
- "dropped": 0,
- "persisted": 0
}
]
List monitor (statistics) data for the whole cluster.
latest | integer >= 1 Example: latest=300 The latest N seconds data. Like 300 for 5 min. |
[- {
- "time_stamp": 0,
- "disconnected_durable_sessions": 0,
- "subscriptions_durable": 0,
- "subscriptions": 0,
- "topics": 0,
- "connections": 0,
- "live_connections": 0,
- "received": 0,
- "sent": 0,
- "validation_succeeded": 0,
- "validation_failed": 0,
- "transformation_succeeded": 0,
- "transformation_failed": 0,
- "dropped": 0,
- "persisted": 0
}
]
Enable or disable delayed, set max delayed messages
enable | boolean Default: true Enable this feature |
max_delayed_messages | integer Default: 0 Maximum number of delayed messages (0 is no limit). |
{- "enable": true,
- "max_delayed_messages": 0
}
{- "enable": true,
- "max_delayed_messages": 0
}
View delayed message
node required | string The node where message from |
msgid required | string Delayed Message ID |
{- "msgid": 0,
- "node": "string",
- "publish_at": "string",
- "delayed_interval": 1,
- "delayed_remaining": 0,
- "expected_at": "string",
- "topic": "/sys/#",
- "qos": 0,
- "from_clientid": "string",
- "from_username": "string"
}
Update all rewrite rules
action required | string Enum: "subscribe" "publish" "all" Topic rewriting takes effect on the type of operation: |
source_topic required | string Source topic, specified by the client. |
dest_topic required | string Destination topic. |
re required | string Regular expressions |
[- {
- "action": "publish",
- "source_topic": "x/#",
- "dest_topic": "z/y/$1",
- "re": "^x/y/(.+)$"
}
]
[- {
- "action": "publish",
- "source_topic": "x/#",
- "dest_topic": "z/y/$1",
- "re": "^x/y/(.+)$"
}
]
Get topic metrics
topic required | string Example: testtopic/1 Topic string. Notice: Topic string in url path must be encoded |
{- "topic": "testtopic/1",
- "create_time": "2022-01-14T21:48:47+08:00",
- "reset_time": "2022-01-14T21:48:47+08:00",
- "metrics": {
- "message.dropped.count": 0,
- "message.in.count": 0,
- "message.out.count": 0,
- "message.qos0.in.count": 0,
- "message.qos0.out.count": 0,
- "message.qos1.in.count": 0,
- "message.qos1.out.count": 0,
- "message.qos2.in.count": 0,
- "message.qos2.out.count": 0,
- "message.dropped.rate": 0,
- "message.in.rate": 0,
- "message.out.rate": 0,
- "message.qos0.in.rate": 0,
- "message.qos0.out.rate": 0,
- "message.qos1.in.rate": 0,
- "message.qos1.out.rate": 0,
- "message.qos2.in.rate": 0,
- "message.qos2.out.rate": 0
}
}
[- {
- "topic": "testtopic/1",
- "create_time": "2022-01-14T21:48:47+08:00",
- "reset_time": "2022-01-14T21:48:47+08:00",
- "metrics": {
- "message.dropped.count": 0,
- "message.in.count": 0,
- "message.out.count": 0,
- "message.qos0.in.count": 0,
- "message.qos0.out.count": 0,
- "message.qos1.in.count": 0,
- "message.qos1.out.count": 0,
- "message.qos2.in.count": 0,
- "message.qos2.out.count": 0,
- "message.dropped.rate": 0,
- "message.in.rate": 0,
- "message.out.rate": 0,
- "message.qos0.in.rate": 0,
- "message.qos0.out.rate": 0,
- "message.qos1.in.rate": 0,
- "message.qos1.out.rate": 0,
- "message.qos2.in.rate": 0,
- "message.qos2.out.rate": 0
}
}
]
Reset telemetry status
topic | string Topic Name. If this parameter is not present,all created topic metrics will be reset. |
action required | string Action. Only support reset |
{- "action": "reset"
}
{- "code": "TOPIC_NOT_FOUND",
- "message": "string"
}
Create topic metrics
topic required | string Raw topic string |
{- "topic": "testtopic/1"
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
List delayed messages
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page(max 10000) |
{- "data": [
- {
- "msgid": 0,
- "node": "string",
- "publish_at": "string",
- "delayed_interval": 1,
- "delayed_remaining": 0,
- "expected_at": "string",
- "topic": "/sys/#",
- "qos": 0,
- "from_clientid": "string",
- "from_username": "string",
- "payload": "string"
}
], - "meta": {
- "page": 1,
- "limit": 1,
- "count": 0
}
}
Observe or Cancel observe a resource
clientid required | string Example: urn:oma:lwm2m:oma:2 |
path required | string Example: path=/3/0/7 |
enable required | boolean Example: enable=true |
{- "code": "CLIENT_NOT_FOUND",
- "message": "string"
}
Look up a resource
clientid required | string Example: urn:oma:lwm2m:oma:2 |
path required | string Example: path=/3/0/7 |
action required | string Example: action=discover |
{- "clientid": "urn:oma:lwm2m:oma:2",
- "path": "/3/0/7",
- "action": "discover",
- "codeMsg": "reply_not_received",
- "content": [
- {
- "operations": "E",
- "dataType": "Integer",
- "path": "urn:oma:lwm2m:oma:2",
- "name": "lwm2m-test"
}
]
}
Send a read command to a resource
clientid required | string Example: urn:oma:lwm2m:oma:2 |
path required | string Example: path=/3/0/7 |
{- "code": "CLIENT_NOT_FOUND",
- "message": "string"
}
Send a write command to a resource
clientid required | string Example: urn:oma:lwm2m:oma:2 |
path required | string Example: path=/3/0/7 |
type required | string Enum: "Integer" "Float" "Time" "String" "Boolean" "Opaque" "Objlnk" Example: type=Integer |
value required | string Example: value=123 |
{- "code": "CLIENT_NOT_FOUND",
- "message": "string"
}
Stop/Restart bridges on a specific node.
node required | |
id required | string Example: http:http_example The bridge Id. Must be of format {type}:{name} |
operation required | string Enum: "start" "stop" "restart" Example: start Operations can be one of: stop, restart |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Test creating a new bridge by given ID
The ID must be of format '{type}:{name}'
type required | string Enum: "webhook" "http" The action type. |
name required | string Action name, used as a human-readable identifier. |
enable | boolean Default: true Enable or disable this action. |
tags | Array of strings Tags to annotate this config entry. |
description | string Default: "" Descriptive text. |
connect_timeout | string Default: "15s" The timeout when connecting to the HTTP server. |
retry_interval | string Deprecated |
pool_type | string Default: "random" Enum: "random" "hash" The type of the pool. Can be one of |
pool_size | integer >= 1 Default: 8 The pool size. |
enable_pipelining | integer >= 1 Default: 100 The maximum number of HTTP requests that can be sent before an HTTP response is received. |
request | object Deprecated This field is never used, so we deprecated it since 5.3.2. |
object (emqx.ssl_client_opts) | |
url required | string The URL of the HTTP action. |
direction | string Deprecated Value: "egress" |
local_topic | string The MQTT topic filter to be forwarded to the HTTP server. All MQTT 'PUBLISH' messages with the topic |
method | string Default: "post" Enum: "post" "put" "get" "delete" The method of the HTTP request. All the available methods are: post, put, get, delete. |
headers | object Default: {"accept":"application/json","cache-control":"no-cache","connection":"keep-alive","content-type":"application/json","keep-alive":"timeout=5"} The headers of the HTTP request. |
body | string The body of the HTTP request. |
max_retries | integer >= 0 Default: 2 HTTP request max retry times if failed. |
request_timeout | string Deprecated Default: "15s" HTTP request timeout. |
object (bridge_http.v1_resource_opts) |
{- "name": "http_example",
- "type": "http",
- "ssl": {
- "enable": false
}, - "connect_timeout": "15s",
- "pool_size": 4,
- "enable": true,
- "body": "${payload}",
- "method": "post",
- "max_retries": 3,
- "request_timeout": "15s",
- "pool_type": "random",
- "resource_opts": {
- "query_mode": "async",
- "health_check_interval": 15000,
- "max_buffer_bytes": 104857600,
- "inflight_window": 100,
- "worker_pool_size": 1
}, - "enable_pipelining": 100,
- "local_topic": "emqx_http/#"
}
{- "code": "TEST_FAILED",
- "message": "string"
}
Enable or Disable bridges on all nodes in the cluster.
id required | string Example: http:http_example The bridge Id. Must be of format {type}:{name} |
enable required | boolean Example: true Whether to enable this bridge |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get bridge metrics by Id
id required | string Example: http:http_example The bridge Id. Must be of format {type}:{name} |
{- "metrics": {
- "dropped": 0,
- "dropped.other": 0,
- "dropped.queue_full": 0,
- "dropped.resource_not_found": 0,
- "dropped.resource_stopped": 0,
- "matched": 0,
- "queuing": 0,
- "retried": 0,
- "failed": 0,
- "inflight": 0,
- "success": 0,
- "rate": 0,
- "rate_max": 0,
- "rate_last5m": 0,
- "received": 0
}, - "node_metrics": [
- {
- "node": "emqx@127.0.0.1",
- "metrics": {
- "dropped": 0,
- "dropped.other": 0,
- "dropped.queue_full": 0,
- "dropped.resource_not_found": 0,
- "dropped.resource_stopped": 0,
- "matched": 0,
- "queuing": 0,
- "retried": 0,
- "failed": 0,
- "inflight": 0,
- "success": 0,
- "rate": 0,
- "rate_max": 0,
- "rate_last5m": 0,
- "received": 0
}
}
]
}
Get a bridge by Id
id required | string Example: http:http_example The bridge Id. Must be of format {type}:{name} |
{- "name": "http_example",
- "type": "http",
- "ssl": {
- "enable": false
}, - "connect_timeout": "15s",
- "pool_size": 4,
- "enable": true,
- "body": "${payload}",
- "method": "post",
- "max_retries": 3,
- "request_timeout": "15s",
- "pool_type": "random",
- "resource_opts": {
- "query_mode": "async",
- "health_check_interval": 15000,
- "max_buffer_bytes": 104857600,
- "inflight_window": 100,
- "worker_pool_size": 1
}, - "enable_pipelining": 100,
- "local_topic": "emqx_http/#"
}
Update a bridge by Id
id required | string Example: http:http_example The bridge Id. Must be of format {type}:{name} |
enable | boolean Default: true Enable or disable this action. |
tags | Array of strings Tags to annotate this config entry. |
description | string Default: "" Descriptive text. |
connect_timeout | string Default: "15s" The timeout when connecting to the HTTP server. |
retry_interval | string Deprecated |
pool_type | string Default: "random" Enum: "random" "hash" The type of the pool. Can be one of |
pool_size | integer >= 1 Default: 8 The pool size. |
enable_pipelining | integer >= 1 Default: 100 The maximum number of HTTP requests that can be sent before an HTTP response is received. |
request | object Deprecated This field is never used, so we deprecated it since 5.3.2. |
object (emqx.ssl_client_opts) | |
url required | string The URL of the HTTP action. |
direction | string Deprecated Value: "egress" |
local_topic | string The MQTT topic filter to be forwarded to the HTTP server. All MQTT 'PUBLISH' messages with the topic |
method | string Default: "post" Enum: "post" "put" "get" "delete" The method of the HTTP request. All the available methods are: post, put, get, delete. |
headers | object Default: {"accept":"application/json","cache-control":"no-cache","connection":"keep-alive","content-type":"application/json","keep-alive":"timeout=5"} The headers of the HTTP request. |
body | string The body of the HTTP request. |
max_retries | integer >= 0 Default: 2 HTTP request max retry times if failed. |
request_timeout | string Deprecated Default: "15s" HTTP request timeout. |
object (bridge_http.v1_resource_opts) |
{- "ssl": {
- "enable": false
}, - "connect_timeout": "15s",
- "pool_size": 4,
- "enable": true,
- "body": "${payload}",
- "method": "post",
- "max_retries": 3,
- "request_timeout": "15s",
- "pool_type": "random",
- "resource_opts": {
- "query_mode": "async",
- "health_check_interval": 15000,
- "max_buffer_bytes": 104857600,
- "inflight_window": 100,
- "worker_pool_size": 1
}, - "enable_pipelining": 100,
- "local_topic": "emqx_http/#"
}
{- "name": "http_example",
- "type": "http",
- "ssl": {
- "enable": false
}, - "connect_timeout": "15s",
- "pool_size": 4,
- "enable": true,
- "body": "${payload}",
- "method": "post",
- "max_retries": 3,
- "request_timeout": "15s",
- "pool_type": "random",
- "resource_opts": {
- "query_mode": "async",
- "health_check_interval": 15000,
- "max_buffer_bytes": 104857600,
- "inflight_window": 100,
- "worker_pool_size": 1
}, - "enable_pipelining": 100,
- "local_topic": "emqx_http/#"
}
Delete a bridge by Id
id required | string Example: http:http_example The bridge Id. Must be of format {type}:{name} |
{- "rules": [
- "string"
], - "code": "BAD_REQUEST",
- "message": "string"
}
Stop/Restart bridges on all nodes in the cluster.
id required | string Example: http:http_example The bridge Id. Must be of format {type}:{name} |
operation required | string Enum: "start" "stop" "restart" Example: start Operations can be one of: stop, restart |
{- "code": "BAD_REQUEST",
- "message": "string"
}
[- {
- "name": "http_example",
- "type": "http",
- "ssl": {
- "enable": false
}, - "connect_timeout": "15s",
- "pool_size": 4,
- "enable": true,
- "body": "${payload}",
- "method": "post",
- "max_retries": 3,
- "request_timeout": "15s",
- "pool_type": "random",
- "resource_opts": {
- "query_mode": "async",
- "health_check_interval": 15000,
- "max_buffer_bytes": 104857600,
- "inflight_window": 100,
- "worker_pool_size": 1
}, - "enable_pipelining": 100,
- "local_topic": "emqx_http/#"
}, - {
- "name": "mqtt_example",
- "type": "mqtt",
- "keepalive": "300s",
- "ssl": {
- "enable": false
}, - "server": "127.0.0.1:1883",
- "enable": true,
- "password": "******",
- "username": "foo",
- "proto_ver": "v4",
- "clean_start": true,
- "retry_interval": "15s",
- "max_inflight": 100,
- "resource_opts": {
- "query_mode": "sync",
- "health_check_interval": "15s",
- "max_buffer_bytes": 104857600
}, - "ingress": {
- "local": {
- "retain": "${retain}",
- "payload": "${payload}",
- "topic": "from_aws/${topic}",
- "qos": "${qos}"
}, - "remote": {
- "topic": "aws/#",
- "qos": 1
}
}, - "egress": {
- "local": {
- "topic": "emqx/#"
}, - "remote": {
- "retain": false,
- "payload": "${payload}",
- "topic": "from_emqx/${topic}",
- "qos": "${qos}"
}
}
}
]
Create a new bridge by type and name
type required | string Enum: "webhook" "http" The action type. |
name required | string Action name, used as a human-readable identifier. |
enable | boolean Default: true Enable or disable this action. |
tags | Array of strings Tags to annotate this config entry. |
description | string Default: "" Descriptive text. |
connect_timeout | string Default: "15s" The timeout when connecting to the HTTP server. |
retry_interval | string Deprecated |
pool_type | string Default: "random" Enum: "random" "hash" The type of the pool. Can be one of |
pool_size | integer >= 1 Default: 8 The pool size. |
enable_pipelining | integer >= 1 Default: 100 The maximum number of HTTP requests that can be sent before an HTTP response is received. |
request | object Deprecated This field is never used, so we deprecated it since 5.3.2. |
object (emqx.ssl_client_opts) | |
url required | string The URL of the HTTP action. |
direction | string Deprecated Value: "egress" |
local_topic | string The MQTT topic filter to be forwarded to the HTTP server. All MQTT 'PUBLISH' messages with the topic |
method | string Default: "post" Enum: "post" "put" "get" "delete" The method of the HTTP request. All the available methods are: post, put, get, delete. |
headers | object Default: {"accept":"application/json","cache-control":"no-cache","connection":"keep-alive","content-type":"application/json","keep-alive":"timeout=5"} The headers of the HTTP request. |
body | string The body of the HTTP request. |
max_retries | integer >= 0 Default: 2 HTTP request max retry times if failed. |
request_timeout | string Deprecated Default: "15s" HTTP request timeout. |
object (bridge_http.v1_resource_opts) |
{- "name": "http_example",
- "type": "http",
- "ssl": {
- "enable": false
}, - "connect_timeout": "15s",
- "pool_size": 4,
- "enable": true,
- "body": "${payload}",
- "method": "post",
- "max_retries": 3,
- "request_timeout": "15s",
- "pool_type": "random",
- "resource_opts": {
- "query_mode": "async",
- "health_check_interval": 15000,
- "max_buffer_bytes": 104857600,
- "inflight_window": 100,
- "worker_pool_size": 1
}, - "enable_pipelining": 100,
- "local_topic": "emqx_http/#"
}
{- "name": "http_example",
- "type": "http",
- "ssl": {
- "enable": false
}, - "connect_timeout": "15s",
- "pool_size": 4,
- "enable": true,
- "body": "${payload}",
- "method": "post",
- "max_retries": 3,
- "request_timeout": "15s",
- "pool_type": "random",
- "resource_opts": {
- "query_mode": "async",
- "health_check_interval": 15000,
- "max_buffer_bytes": 104857600,
- "inflight_window": 100,
- "worker_pool_size": 1
}, - "enable_pipelining": 100,
- "local_topic": "emqx_http/#"
}
Serves as a health check for the node.
Returns response to describe the status of the node and the application.
This endpoint requires no authentication.
Returns status code 200 if the EMQX application is up and running, 503 otherwise.
This API was introduced in v5.0.10.
The GET /status
endpoint (without the /api/...
prefix) is also an alias to this endpoint and works in the same way.
This alias has been available since v5.0.0.
Starting from v5.0.25 or e5.0.4, you can also use 'format' parameter to get JSON format information.
format | string Default: "text" Specify the response format, 'text' (default) to return the HTTP body in free text, |
Topics list
topic | string Topic Name |
node | string Example: node=emqx@127.0.0.1 Node Name |
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page(max 10000) |
{- "data": [
- {
- "topic": "string",
- "node": "string",
- "session": "string"
}
], - "meta": {
- "page": 1,
- "limit": 50,
- "count": 0,
- "hasnext": true
}
}
Get node run-time stats. Such as the number of topics, connections, etc.
node required | string Example: emqx@127.0.0.1 Node name |
{- "channels.count": 0,
- "channels.max": 0,
- "connections.count": 0,
- "connections.max": 0,
- "delayed.count": 0,
- "delayed.max": 0,
- "live_connections.count": 0,
- "live_connections.max": 0,
- "cluster_sessions.count": 0,
- "cluster_sessions.max": 0,
- "retained.count": 0,
- "retained.max": 0,
- "sessions.count": 0,
- "sessions.max": 0,
- "suboptions.count": 0,
- "suboptions.max": 0,
- "subscribers.count": 0,
- "subscribers.max": 0,
- "subscriptions.count": 0,
- "subscriptions.max": 0,
- "subscriptions.shared.count": 0,
- "subscriptions.shared.max": 0,
- "topics.count": 0,
- "topics.max": 0
}
Get node run-time counter metrics. Such as received or sent bytes or messages, the number of succeeded or failed authentications or authorizations, etc.
node required | string Example: emqx@127.0.0.1 Node name |
{- "node": "string",
- "bytes.received": 0,
- "bytes.sent": 0,
- "packets.received": 0,
- "packets.sent": 0,
- "packets.connect.received": 0,
- "packets.connack.sent": 0,
- "packets.connack.error": 0,
- "packets.connack.auth_error": 0,
- "packets.publish.received": 0,
- "packets.publish.sent": 0,
- "packets.publish.inuse": 0,
- "packets.publish.error": 0,
- "packets.publish.auth_error": 0,
- "packets.publish.dropped": 0,
- "packets.puback.received": 0,
- "packets.puback.sent": 0,
- "packets.puback.inuse": 0,
- "packets.puback.missed": 0,
- "packets.pubrec.received": 0,
- "packets.pubrec.sent": 0,
- "packets.pubrec.inuse": 0,
- "packets.pubrec.missed": 0,
- "packets.pubrel.received": 0,
- "packets.pubrel.sent": 0,
- "packets.pubrel.missed": 0,
- "packets.pubcomp.received": 0,
- "packets.pubcomp.sent": 0,
- "packets.pubcomp.inuse": 0,
- "packets.pubcomp.missed": 0,
- "packets.subscribe.received": 0,
- "packets.subscribe.error": 0,
- "packets.subscribe.auth_error": 0,
- "packets.suback.sent": 0,
- "packets.unsubscribe.received": 0,
- "packets.unsubscribe.error": 0,
- "packets.unsuback.sent": 0,
- "packets.pingreq.received": 0,
- "packets.pingresp.sent": 0,
- "packets.disconnect.received": 0,
- "packets.disconnect.sent": 0,
- "packets.auth.received": 0,
- "packets.auth.sent": 0,
- "messages.received": 0,
- "messages.sent": 0,
- "messages.qos0.received": 0,
- "messages.qos0.sent": 0,
- "messages.qos1.received": 0,
- "messages.qos1.sent": 0,
- "messages.qos2.received": 0,
- "messages.qos2.sent": 0,
- "messages.publish": 0,
- "messages.dropped": 0,
- "messages.validation_failed": 0,
- "messages.validation_succeeded": 0,
- "messages.transformation_failed": 0,
- "messages.transformation_succeeded": 0,
- "messages.dropped.await_pubrel_timeout": 0,
- "messages.dropped.no_subscribers": 0,
- "messages.forward": 0,
- "messages.delayed": 0,
- "messages.delivered": 0,
- "messages.acked": 0,
- "messages.persisted": 0,
- "delivery.dropped": 0,
- "delivery.dropped.no_local": 0,
- "delivery.dropped.too_large": 0,
- "delivery.dropped.qos0_msg": 0,
- "delivery.dropped.queue_full": 0,
- "delivery.dropped.expired": 0,
- "client.connect": 0,
- "client.connack": 0,
- "client.connected": 0,
- "client.authenticate": 0,
- "client.auth.anonymous": 0,
- "client.authorize": 0,
- "client.subscribe": 0,
- "client.unsubscribe": 0,
- "client.disconnected": 0,
- "session.created": 0,
- "session.resumed": 0,
- "session.takenover": 0,
- "session.discarded": 0,
- "session.terminated": 0,
- "authorization.allow": 0,
- "authorization.deny": 0,
- "authorization.cache_hit": 0,
- "authorization.cache_miss": 0,
- "authentication.success": 0,
- "authentication.success.anonymous": 0,
- "authentication.failure": 0,
- "overload_protection.delay.ok": 0,
- "overload_protection.delay.timeout": 0,
- "overload_protection.hibernation": 0,
- "overload_protection.gc": 0,
- "overload_protection.new_conn": 0
}
Get node info
node required | string Example: emqx@127.0.0.1 Node name |
{- "node": "emqx@127.0.0.1",
- "connections": 0,
- "live_connections": 0,
- "cluster_sessions": 0,
- "load1": 2.66,
- "load5": 2.66,
- "load15": 2.66,
- "max_fds": 1024,
- "memory_total": "512.00M",
- "memory_used": "256.00M",
- "node_status": "running",
- "otp_release": "24.2/12.2",
- "process_available": 2097152,
- "process_used": 1024,
- "uptime": 5120000,
- "version": "5.0.0",
- "edition": "Opensource",
- "sys_path": "path/to/emqx",
- "log_path": "path/to/log | The log path is not yet set",
- "role": "core"
}
[- {
- "node": "emqx@127.0.0.1",
- "connections": 0,
- "live_connections": 0,
- "cluster_sessions": 0,
- "load1": 2.66,
- "load5": 2.66,
- "load15": 2.66,
- "max_fds": 1024,
- "memory_total": "512.00M",
- "memory_used": "256.00M",
- "node_status": "running",
- "otp_release": "24.2/12.2",
- "process_available": 2097152,
- "process_used": 1024,
- "uptime": 5120000,
- "version": "5.0.0",
- "edition": "Opensource",
- "sys_path": "path/to/emqx",
- "log_path": "path/to/log | The log path is not yet set",
- "role": "core"
}
]
Get the detail information of Exhook server
name required | string Example: default The Exhook server name |
{- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}, - "node_metrics": [
- {
- "node": "string",
- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}
}
], - "node_status": [
- {
- "node": "string",
- "status": "connected"
}
], - "hooks": [
- {
- "name": "string",
- "params": {
- "$name": "string"
}
}
], - "name": "default",
- "enable": true,
- "request_timeout": "12m",
- "failed_action": "deny",
- "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "keyfile": "string",
- "verify": "verify_peer",
- "reuse_sessions": true,
- "depth": 10,
- "password": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
], - "ciphers": [ ],
- "secure_renegotiate": true,
- "log_level": "emergency",
- "hibernate_after": "12m",
- "enable": false,
- "server_name_indication": "disable"
}, - "socket_options": {
- "keepalive": true,
- "nodelay": true,
- "recbuf": "64KB",
- "sndbuf": "16KB"
}, - "auto_reconnect": "60s",
- "pool_size": 8
}
Update the server
name required | string Example: default The Exhook server name |
name required | string Name of the exhook server |
enable | boolean Default: true Enable this Exhook server |
url required | string URL of the gRPC server |
request_timeout | string Default: "5s" The timeout of request gRPC server |
failed_action | string Default: "deny" Enum: "deny" "ignore" The value that is returned when the request to the gRPC server fails for any reason |
object (exhook.ssl_conf) | |
object (exhook.socket_options) | |
string or string Default: "60s" Whether to automatically reconnect (initialize) the gRPC server. | |
pool_size | integer >= 1 Default: 8 The process pool size for gRPC client |
{- "name": "default",
- "ssl": {
- "enable": false,
- "certfile": "/etc/emqx/certs/cert.pem",
- "keyfile": "/etc/emqx/certs/key.pem",
- "cacertfile": "/etc/emqx/certs/cacert.pem"
}, - "pool_size": 8,
- "enable": true,
- "request_timeout": "5s",
- "auto_reconnect": "60s",
- "failed_action": "deny"
}
{- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}, - "node_metrics": [
- {
- "node": "string",
- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}
}
], - "node_status": [
- {
- "node": "string",
- "status": "connected"
}
], - "hooks": [
- {
- "name": "string",
- "params": {
- "$name": "string"
}
}
], - "name": "default",
- "enable": true,
- "request_timeout": "12m",
- "failed_action": "deny",
- "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "keyfile": "string",
- "verify": "verify_peer",
- "reuse_sessions": true,
- "depth": 10,
- "password": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
], - "ciphers": [ ],
- "secure_renegotiate": true,
- "log_level": "emergency",
- "hibernate_after": "12m",
- "enable": false,
- "server_name_indication": "disable"
}, - "socket_options": {
- "keepalive": true,
- "nodelay": true,
- "recbuf": "64KB",
- "sndbuf": "16KB"
}, - "auto_reconnect": "60s",
- "pool_size": 8
}
Move the server.
NOTE: The position should be "front | rear | before:{name} | after:{name}
name required | string Example: default The Exhook server name |
position required | string The target position to be moved |
{- "position": "rear"
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
[- {
- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}, - "node_metrics": [
- {
- "node": "string",
- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}
}
], - "node_status": [
- {
- "node": "string",
- "status": "connected"
}
], - "hooks": [
- {
- "name": "string",
- "params": {
- "$name": "string"
}
}
], - "name": "default",
- "enable": true,
- "request_timeout": "12m",
- "failed_action": "deny",
- "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "keyfile": "string",
- "verify": "verify_peer",
- "reuse_sessions": true,
- "depth": 10,
- "password": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
], - "ciphers": [ ],
- "secure_renegotiate": true,
- "log_level": "emergency",
- "hibernate_after": "12m",
- "enable": false,
- "server_name_indication": "disable"
}, - "socket_options": {
- "keepalive": true,
- "nodelay": true,
- "recbuf": "64KB",
- "sndbuf": "16KB"
}, - "auto_reconnect": "60s",
- "pool_size": 8
}
]
Add a server
name required | string Name of the exhook server |
enable | boolean Default: true Enable this Exhook server |
url required | string URL of the gRPC server |
request_timeout | string Default: "5s" The timeout of request gRPC server |
failed_action | string Default: "deny" Enum: "deny" "ignore" The value that is returned when the request to the gRPC server fails for any reason |
object (exhook.ssl_conf) | |
object (exhook.socket_options) | |
string or string Default: "60s" Whether to automatically reconnect (initialize) the gRPC server. | |
pool_size | integer >= 1 Default: 8 The process pool size for gRPC client |
{- "name": "default",
- "ssl": {
- "enable": false,
- "certfile": "/etc/emqx/certs/cert.pem",
- "keyfile": "/etc/emqx/certs/key.pem",
- "cacertfile": "/etc/emqx/certs/cacert.pem"
}, - "pool_size": 8,
- "enable": true,
- "request_timeout": "5s",
- "auto_reconnect": "60s",
- "failed_action": "deny"
}
{- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}, - "node_metrics": [
- {
- "node": "string",
- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}
}
], - "node_status": [
- {
- "node": "string",
- "status": "connected"
}
], - "hooks": [
- {
- "name": "string",
- "params": {
- "$name": "string"
}
}
], - "name": "default",
- "enable": true,
- "request_timeout": "12m",
- "failed_action": "deny",
- "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "keyfile": "string",
- "verify": "verify_peer",
- "reuse_sessions": true,
- "depth": 10,
- "password": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
], - "ciphers": [ ],
- "secure_renegotiate": true,
- "log_level": "emergency",
- "hibernate_after": "12m",
- "enable": false,
- "server_name_indication": "disable"
}, - "socket_options": {
- "keepalive": true,
- "nodelay": true,
- "recbuf": "64KB",
- "sndbuf": "16KB"
}, - "auto_reconnect": "60s",
- "pool_size": 8
}
Get the hooks information of server
name required | string Example: default The Exhook server name |
[- {
- "name": "string",
- "params": {
- "$name": "string"
}, - "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}, - "node_metrics": [
- {
- "node": "string",
- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}
}
]
}
]
{- "collectors": {
- "mnesia": "disabled",
- "vm_msacc": "disabled",
- "vm_memory": "disabled",
- "vm_system_info": "disabled",
- "vm_statistics": "disabled",
- "vm_dist": "disabled"
}, - "enable_basic_auth": false,
- "push_gateway": {
- "interval": "15s",
- "headers": {
- "Authorization": "Basic YWRtaW46Y2JraG55eWd5QDE="
}, - "method": "put",
- "job_name": "${name}/instance/${name}~${host}"
}
}
Update Prometheus config
push_gateway_server required | string Default: "http://127.0.0.1:9091" Deprecated since 5.4.0, use |
interval required | string Default: "15s" Deprecated since 5.4.0, use |
headers | object Default: {} Deprecated since 5.4.0, use |
job_name required | string Default: "${name}/instance/${name}~${host}" Deprecated since 5.4.0, use |
enable required | boolean Default: false Deprecated since 5.4.0, use |
vm_dist_collector required | string Default: "disabled" Enum: "disabled" "enabled" Deprecated since 5.4.0, use |
mnesia_collector required | string Default: "disabled" Enum: "enabled" "disabled" Deprecated since 5.4.0, use |
vm_statistics_collector required | string Default: "disabled" Enum: "enabled" "disabled" Deprecated since 5.4.0, use |
vm_system_info_collector required | string Default: "disabled" Enum: "enabled" "disabled" Deprecated, use |
vm_memory_collector required | string Default: "disabled" Enum: "enabled" "disabled" Deprecated since 5.4.0, use |
vm_msacc_collector required | string Default: "disabled" Enum: "enabled" "disabled" Deprecated since 5.4.0, use |
{- "collectors": {
- "mnesia": "disabled",
- "vm_msacc": "disabled",
- "vm_memory": "disabled",
- "vm_system_info": "disabled",
- "vm_statistics": "disabled",
- "vm_dist": "disabled"
}, - "enable_basic_auth": false,
- "push_gateway": {
- "interval": "15s",
- "headers": {
- "Authorization": "Basic YWRtaW46Y2JraG55eWd5QDE="
}, - "method": "put",
- "job_name": "${name}/instance/${name}~${host}"
}
}
{- "collectors": {
- "mnesia": "disabled",
- "vm_msacc": "disabled",
- "vm_memory": "disabled",
- "vm_system_info": "disabled",
- "vm_statistics": "disabled",
- "vm_dist": "disabled"
}, - "enable_basic_auth": false,
- "push_gateway": {
- "interval": "15s",
- "headers": {
- "Authorization": "Basic YWRtaW46Y2JraG55eWd5QDE="
}, - "method": "put",
- "job_name": "${name}/instance/${name}~${host}"
}
}
Get Prometheus Metrics for Data Integration
mode | string Default: "node" Enum: "node" "all_nodes_aggregated" "all_nodes_unaggregated" Example: mode=node
|
Get Prometheus Metrics
mode | string Default: "node" Enum: "node" "all_nodes_aggregated" "all_nodes_unaggregated" Example: mode=node
|
Get Prometheus Metrics for AuthN, AuthZ and Banned
mode | string Default: "node" Enum: "node" "all_nodes_aggregated" "all_nodes_unaggregated" Example: mode=node
|
Update auto subscribe topic list
topic required | string Topic name, placeholders are supported. For example: client/${clientid}/username/${username}/host/${host}/port/${port} |
qos | integer [ 0 .. 2 ] Default: 0 Default value 0. Quality of service. |
rh | integer [ 0 .. 2 ] Default: 0 Default value 0. This option is used to specify whether the server forwards the retained message to the client when establishing a subscription. |
rap | integer [ 0 .. 1 ] Default: 0 Default value 0. This option is used to specify whether the server retains the RETAIN mark when forwarding messages to the client, and this option does not affect the RETAIN mark in the retained message. Therefore, when the option Retain As Publish is set to 0, the client will directly distinguish whether this is a normal forwarded message or a retained message according to the RETAIN mark in the message, instead of judging whether this message is the first received after subscribing(the forwarded message may be sent before the retained message, which depends on the specific implementation of different brokers). |
nl | integer [ 0 .. 1 ] Default: 0 Default value 0. |
[- {
- "topic": "/clientid/${clientid}/username/${username}/host/${host}/port/${port}",
- "qos": 0,
- "rh": 0,
- "rap": 0,
- "nl": 0
}
]
[- {
- "topic": "/clientid/${clientid}/username/${username}/host/${host}/port/${port}",
- "qos": 0,
- "rh": 0,
- "rap": 0,
- "nl": 0
}
]
Get the listener's authenticator configs.
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
{- "mechanism": "jwt",
- "secret": "mysecret",
- "algorithm": "hmac-based",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
Update authenticator configs for the listener, or disable/enable it.
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
mechanism required | string Value: "password_based" Authentication mechanism. |
backend required | string Value: "ldap" Backend type. |
query_timeout | string Default: "5s" Timeout for the LDAP query. |
enable | boolean Default: true Set to |
server required | string The IPv4 or IPv6 address or the hostname to connect to. |
pool_size | integer >= 1 Default: 8 Size of the connection pool towards the bridge target service. |
username required | string The username associated with the bridge in the external database used for authentication or identification purposes. |
password | string <password> The password associated with the bridge, used for authentication with the external database. |
base_dn required | string The name of the base object entry (or possibly the root) relative to |
filter | string Default: "(objectClass=mqttUser)" The filter that defines the conditions that must be fulfilled in order |
request_timeout | string Default: "10s" Sets the maximum time in milliseconds that is used for each individual request. |
object (ldap.ssl) | |
password_attribute | string Default: "userPassword" Indicates which attribute is used to represent the user's password. |
is_superuser_attribute | string Default: "isSuperuser" Indicates which attribute is used to represent whether the user is a superuser. |
{- "mechanism": "jwt",
- "secret": "mysecret",
- "algorithm": "hmac-based",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
{- "mechanism": "jwt",
- "secret": "mysecret",
- "algorithm": "hmac-based",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
Remove authenticator for the listener.
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Enable authenticator for specified listener for client authentication.
When authenticator is enabled for a listener, all clients connecting to that listener will use that authenticator for authentication.
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
mechanism required | string Value: "password_based" Authentication mechanism. |
backend required | string Value: "ldap" Backend type. |
query_timeout | string Default: "5s" Timeout for the LDAP query. |
enable | boolean Default: true Set to |
server required | string The IPv4 or IPv6 address or the hostname to connect to. |
pool_size | integer >= 1 Default: 8 Size of the connection pool towards the bridge target service. |
username required | string The username associated with the bridge in the external database used for authentication or identification purposes. |
password | string <password> The password associated with the bridge, used for authentication with the external database. |
base_dn required | string The name of the base object entry (or possibly the root) relative to |
filter | string Default: "(objectClass=mqttUser)" The filter that defines the conditions that must be fulfilled in order |
request_timeout | string Default: "10s" Sets the maximum time in milliseconds that is used for each individual request. |
object (ldap.ssl) | |
password_attribute | string Default: "userPassword" Indicates which attribute is used to represent the user's password. |
is_superuser_attribute | string Default: "isSuperuser" Indicates which attribute is used to represent whether the user is a superuser. |
{- "mechanism": "jwt",
- "secret": "mysecret",
- "algorithm": "hmac-based",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
{- "mechanism": "jwt",
- "secret": "mysecret",
- "algorithm": "hmac-based",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
Gets a list of gateway listeners. This interface returns all the configs of the listener (including the authenticator on that listener), as well as the status of that listener running in the cluster.
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
[- {
- "name": "udp-def",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 10
}, - "type": "udp",
- "bind": "22212",
- "udp_options": {
- "buffer": "10KB",
- "recbuf": "10KB",
- "reuseaddr": true,
- "sndbuf": "10KB",
- "active_n": 100
}, - "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 10
}
}
]
}, - {
- "name": "dtls-def",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 10
}, - "type": "dtls",
- "bind": "22213",
- "udp_options": {
- "backlog": 1024,
- "active_n": 100
}, - "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 10
}
}
], - "dtls_options": {
- "verify": "verify_none",
- "versions": [
- "dtlsv1.2",
- "dtlsv1"
], - "fail_if_no_peer_cert": false,
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem"
}, - "max_conn_rate": 1000,
- "access_rules": [
- "allow all"
], - "max_connections": 1024000,
- "acceptors": 16
}, - {
- "name": "ssl-def",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 10
}, - "type": "ssl",
- "bind": "22211",
- "tcp_options": {
- "backlog": 1024,
- "active_n": 100
}, - "ssl_options": {
- "verify": "verify_none",
- "versions": [
- "tlsv1.3",
- "tlsv1.2",
- "tlsv1.1",
- "tlsv1"
], - "fail_if_no_peer_cert": false,
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem"
}, - "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 10
}
}
], - "max_conn_rate": 1000,
- "access_rules": [
- "allow all"
], - "max_connections": 1024000,
- "acceptors": 16
}, - {
- "name": "tcp-def",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 10
}, - "type": "tcp",
- "bind": "22210",
- "tcp_options": {
- "buffer": "10KB",
- "high_watermark": "1MB",
- "keepalive": "none",
- "nodelay": false,
- "recbuf": "10KB",
- "reuseaddr": true,
- "send_timeout": "15s",
- "send_timeout_close": true,
- "sndbuf": "10KB",
- "backlog": 1024,
- "active_n": 100
}, - "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 10
}
}
], - "max_conn_rate": 1000,
- "max_connections": 1024000,
- "acceptors": 16
}, - {
- "name": "ws-def",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 10
}, - "type": "ws",
- "bind": "33043",
- "tcp_options": {
- "buffer": "10KB",
- "high_watermark": "1MB",
- "keepalive": "none",
- "nodelay": false,
- "recbuf": "10KB",
- "reuseaddr": true,
- "send_timeout": "15s",
- "send_timeout_close": true,
- "sndbuf": "10KB",
- "backlog": 1024,
- "active_n": 100
}, - "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 10
}
}
], - "websocket": {
- "path": "/ocpp",
- "compress": false,
- "fail_if_no_subprotocol": true,
- "supported_subprotocols": "ocpp1.6",
- "check_origins": "http://localhost:18083, http://127.0.0.1:18083",
- "check_origin_enable": false,
- "piggyback": "single"
}, - "max_conn_rate": 1000,
- "max_connections": 1024000,
- "acceptors": 16
}, - {
- "name": "ws-ssl-def",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 10
}, - "type": "wss",
- "bind": "33053",
- "tcp_options": {
- "buffer": "10KB",
- "high_watermark": "1MB",
- "keepalive": "none",
- "nodelay": false,
- "recbuf": "10KB",
- "reuseaddr": true,
- "send_timeout": "15s",
- "send_timeout_close": true,
- "sndbuf": "10KB",
- "backlog": 1024,
- "active_n": 100
}, - "ssl_options": {
- "verify": "verify_none",
- "versions": [
- "tlsv1.3",
- "tlsv1.2",
- "tlsv1.1",
- "tlsv1"
], - "fail_if_no_peer_cert": false,
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem"
}, - "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 10
}
}
], - "websocket": {
- "path": "/ocpp",
- "compress": false,
- "fail_if_no_subprotocol": true,
- "supported_subprotocols": "ocpp1.6",
- "check_origins": "http://localhost:18083, http://127.0.0.1:18083",
- "check_origin_enable": false,
- "piggyback": "single"
}, - "max_conn_rate": 1000,
- "max_connections": 1024000,
- "acceptors": 16
}, - {
- "name": "dtls-psk",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 10
}, - "type": "dtls",
- "bind": "22214",
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 10
}
}
], - "dtls_options": {
- "verify": "verify_none",
- "ciphers": "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384,RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256,RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA",
- "versions": [
- "dtlsv1.2",
- "dtlsv1"
], - "fail_if_no_peer_cert": false,
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "user_lookup_fun": "emqx_tls_psk:lookup"
}, - "max_conn_rate": 1000,
- "max_connections": 1024000,
- "acceptors": 16
}, - {
- "name": "tcp-with-authn",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 10
}, - "type": "tcp",
- "bind": "22215",
- "authentication": {
- "mechanism": "password_based",
- "backend": "built_in_database",
- "password_hash_algorithm": {
- "name": "sha256"
}, - "user_id_type": "username"
}, - "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 10
}
}
], - "max_conn_rate": 1000,
- "max_connections": 1024000,
- "acceptors": 16
}
]
Create the gateway listener.
Note: For listener types not supported by a gateway, this API returns 400: BAD_REQUEST
.
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
id | string Listener ID |
type | string Value: "wss" Listener Type |
name | string Listener Name |
running | boolean Listener Running status |
acceptors | integer Default: 16 Size of the acceptor pool. |
object (emqx.tcp_opts) | |
proxy_protocol | boolean Default: false If a reverse proxy is deployed for EMQX, and the PROXY protocol is enabled at the proxy to pass the client's real IP, |
proxy_protocol_timeout | string Default: "3s" Timeout for proxy protocol. |
enable | boolean Default: true Enable the listener. |
bind | string The IP address and port that the listener will bind. |
string or integer Default: 1024 The maximum number of concurrent connections allowed by the listener. | |
max_conn_rate | integer Default: 1000 Maximum connections per second. |
enable_authn | boolean Default: true Set |
mountpoint | string When publishing or subscribing, prefix all topics with a mountpoint string. |
access_rules | Array of strings Default: [] An access rule list consisting of string rules to restrict or allow access from some addresses. |
object (emqx.listener_wss_opts) | |
object (gateway.websocket) |
{- "name": "udp-def",
- "type": "udp",
- "bind": "22212",
- "udp_options": {
- "buffer": "10KB",
- "recbuf": "10KB",
- "reuseaddr": true,
- "sndbuf": "10KB",
- "active_n": 100
}
}
{- "name": "udp-def",
- "type": "udp",
- "bind": "22212",
- "udp_options": {
- "buffer": "10KB",
- "recbuf": "10KB",
- "reuseaddr": true,
- "sndbuf": "10KB",
- "active_n": 100
}
}
Get the gateway listener configs
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
{- "name": "udp-def",
- "type": "udp",
- "bind": "22212",
- "udp_options": {
- "buffer": "10KB",
- "recbuf": "10KB",
- "reuseaddr": true,
- "sndbuf": "10KB",
- "active_n": 100
}
}
Update the gateway listener. The listener being updated performs a restart and all clients connected to that listener will be disconnected.
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
id | string Listener ID |
type | string Value: "wss" Listener Type |
name | string Listener Name |
running | boolean Listener Running status |
acceptors | integer Default: 16 Size of the acceptor pool. |
object (emqx.tcp_opts) | |
proxy_protocol | boolean Default: false If a reverse proxy is deployed for EMQX, and the PROXY protocol is enabled at the proxy to pass the client's real IP, |
proxy_protocol_timeout | string Default: "3s" Timeout for proxy protocol. |
enable | boolean Default: true Enable the listener. |
bind | string The IP address and port that the listener will bind. |
string or integer Default: 1024 The maximum number of concurrent connections allowed by the listener. | |
max_conn_rate | integer Default: 1000 Maximum connections per second. |
enable_authn | boolean Default: true Set |
mountpoint | string When publishing or subscribing, prefix all topics with a mountpoint string. |
access_rules | Array of strings Default: [] An access rule list consisting of string rules to restrict or allow access from some addresses. |
object (emqx.listener_wss_opts) | |
object (gateway.websocket) |
{- "name": "udp-def",
- "type": "udp",
- "bind": "22212",
- "udp_options": {
- "buffer": "10KB",
- "recbuf": "10KB",
- "reuseaddr": true,
- "sndbuf": "10KB",
- "active_n": 100
}
}
{- "name": "udp-def",
- "type": "udp",
- "bind": "22212",
- "udp_options": {
- "buffer": "10KB",
- "recbuf": "10KB",
- "reuseaddr": true,
- "sndbuf": "10KB",
- "active_n": 100
}
}
Delete the gateway listener. All connected clients under the deleted listener will be disconnected.
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get user info from the gateway authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
uid required | string User ID |
{- "regular_user": {
- "value": {
- "user_id": "user1"
}, - "summary": "Regular user"
}, - "super_user": {
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}, - "summary": "Superuser"
}
}
Update the user info for the gateway authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
uid required | string User ID |
password required | string |
is_superuser | boolean Default: false |
{- "password": "******"
}
{- "regular_user": {
- "value": {
- "user_id": "user1"
}, - "summary": "Regular user"
}, - "super_user": {
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}, - "summary": "Superuser"
}
}
Delete the user for the gateway authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
uid required | string User ID |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get the users for the authenticator (only supported by built_in_database
)
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page(max 10000) |
{- "regular_user": {
- "value": {
- "user_id": "user1"
}, - "summary": "Regular user"
}, - "super_user": {
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}, - "summary": "Superuser"
}
}
Add user for the authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
user_id required | string |
password required | string |
is_superuser | boolean Default: false |
{- "password": "******",
- "user_id": "user1"
}
{- "regular_user": {
- "value": {
- "user_id": "user1"
}, - "summary": "Regular user"
}, - "super_user": {
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}, - "summary": "Superuser"
}
}
Get the sub-configurations under sys_topics
{- "sys_msg_interval": "1m",
- "sys_heartbeat_interval": "30s",
- "sys_event_messages": {
- "client_connected": true,
- "client_disconnected": true,
- "client_subscribed": false,
- "client_unsubscribed": false
}
}
Update the sub-configurations under sys_topics
string or string Default: "1m" Time interval for publishing following system messages: | |
string or string Default: "30s" Time interval for publishing following heartbeat messages: | |
object (emqx.event_names) |
{- "sys_msg_interval": "1m",
- "sys_heartbeat_interval": "30s",
- "sys_event_messages": {
- "client_connected": true,
- "client_disconnected": true,
- "client_subscribed": false,
- "client_unsubscribed": false
}
}
{- "sys_msg_interval": "1m",
- "sys_heartbeat_interval": "30s",
- "sys_event_messages": {
- "client_connected": true,
- "client_disconnected": true,
- "client_subscribed": false,
- "client_unsubscribed": false
}
}
Get the sub-configurations under sysmon
{- "vm": {
- "process_check_interval": "12m",
- "process_high_watermark": "12%",
- "process_low_watermark": "12%",
- "long_gc": "disabled",
- "long_schedule": "240ms",
- "large_heap": "32MB",
- "busy_dist_port": true,
- "busy_port": true
}, - "os": {
- "cpu_check_interval": "12m",
- "cpu_high_watermark": "12%",
- "cpu_low_watermark": "12%",
- "mem_check_interval": "60s",
- "sysmem_high_watermark": "12%",
- "procmem_high_watermark": "12%"
}, - "mnesia_tm_mailbox_size_alarm_threshold": 500,
- "broker_pool_mailbox_size_alarm_threshold": 500
}
Update the sub-configurations under sysmon
object (emqx.sysmon_vm) | |
object (emqx.sysmon_os) | |
mnesia_tm_mailbox_size_alarm_threshold | integer >= 1 Default: 500 The threshold above which an alarm is raised for the mailbox size of the mnesia transaction manager. This process handles all transactions in EMQX's internal database mnesia. |
broker_pool_mailbox_size_alarm_threshold | integer >= 1 Default: 500 The threshold above which an alarm is raised for the maximum mailbox size among the broker pool workers. Broker pool workers handle adding and removing subscriptions, and replication of routing information. |
{- "vm": {
- "process_check_interval": "12m",
- "process_high_watermark": "12%",
- "process_low_watermark": "12%",
- "long_gc": "disabled",
- "long_schedule": "240ms",
- "large_heap": "32MB",
- "busy_dist_port": true,
- "busy_port": true
}, - "os": {
- "cpu_check_interval": "12m",
- "cpu_high_watermark": "12%",
- "cpu_low_watermark": "12%",
- "mem_check_interval": "60s",
- "sysmem_high_watermark": "12%",
- "procmem_high_watermark": "12%"
}, - "mnesia_tm_mailbox_size_alarm_threshold": 500,
- "broker_pool_mailbox_size_alarm_threshold": 500
}
{- "vm": {
- "process_check_interval": "12m",
- "process_high_watermark": "12%",
- "process_low_watermark": "12%",
- "long_gc": "disabled",
- "long_schedule": "240ms",
- "large_heap": "32MB",
- "busy_dist_port": true,
- "busy_port": true
}, - "os": {
- "cpu_check_interval": "12m",
- "cpu_high_watermark": "12%",
- "cpu_low_watermark": "12%",
- "mem_check_interval": "60s",
- "sysmem_high_watermark": "12%",
- "procmem_high_watermark": "12%"
}, - "mnesia_tm_mailbox_size_alarm_threshold": 500,
- "broker_pool_mailbox_size_alarm_threshold": 500
}
Get the MQTT-related configuration
{- "mqtt": {
- "idle_timeout": "15s",
- "max_packet_size": "32MB",
- "max_clientid_len": 65535,
- "max_topic_levels": 128,
- "max_topic_alias": 65535,
- "retain_available": true,
- "wildcard_subscription": true,
- "shared_subscription": true,
- "shared_subscription_strategy": "random",
- "shared_subscription_initial_sticky_pick": "random",
- "exclusive_subscription": false,
- "ignore_loop_deliver": false,
- "strict_mode": false,
- "response_information": "",
- "server_keepalive": "disabled",
- "keepalive_multiplier": 1.5,
- "keepalive_check_interval": "12m",
- "retry_interval": "infinity",
- "use_username_as_clientid": false,
- "peer_cert_as_username": "disabled",
- "peer_cert_as_clientid": "disabled",
- "client_attrs_init": [ ],
- "clientid_override": "disabled",
- "session_expiry_interval": "12m",
- "message_expiry_interval": "infinity",
- "max_awaiting_rel": 100,
- "max_qos_allowed": 0,
- "mqueue_priorities": "disabled",
- "mqueue_default_priority": "highest",
- "mqueue_store_qos0": true,
- "max_mqueue_len": 1000,
- "max_inflight": 32,
- "max_subscriptions": "infinity",
- "upgrade_qos": false,
- "await_rel_timeout": "12m"
}, - "flapping_detect": {
- "enable": false,
- "window_time": "12m",
- "max_count": 15,
- "ban_time": "12m"
}, - "force_shutdown": {
- "enable": true,
- "max_mailbox_size": 1000,
- "max_heap_size": "1024KB"
}, - "force_gc": {
- "enable": true,
- "count": 16000,
- "bytes": "32MB"
}, - "durable_sessions": {
- "enable": false,
- "batch_size": 100,
- "idle_poll_interval": "12m",
- "heartbeat_interval": "12m",
- "session_gc_interval": "12m",
- "session_gc_batch_size": 100,
- "message_retention_period": "12m"
}
}
Update MQTT-related configuration
object (emqx.mqtt) | |
object (emqx.flapping_detect) | |
object (emqx.force_shutdown) | |
object (emqx.force_gc) | |
object (emqx.durable_sessions) |
{- "mqtt": {
- "idle_timeout": "15s",
- "max_packet_size": "32MB",
- "max_clientid_len": 65535,
- "max_topic_levels": 128,
- "max_topic_alias": 65535,
- "retain_available": true,
- "wildcard_subscription": true,
- "shared_subscription": true,
- "shared_subscription_strategy": "random",
- "shared_subscription_initial_sticky_pick": "random",
- "exclusive_subscription": false,
- "ignore_loop_deliver": false,
- "strict_mode": false,
- "response_information": "",
- "server_keepalive": "disabled",
- "keepalive_multiplier": 1.5,
- "keepalive_check_interval": "12m",
- "retry_interval": "infinity",
- "use_username_as_clientid": false,
- "peer_cert_as_username": "disabled",
- "peer_cert_as_clientid": "disabled",
- "client_attrs_init": [ ],
- "clientid_override": "disabled",
- "session_expiry_interval": "12m",
- "message_expiry_interval": "infinity",
- "max_awaiting_rel": 100,
- "max_qos_allowed": 0,
- "mqueue_priorities": "disabled",
- "mqueue_default_priority": "highest",
- "mqueue_store_qos0": true,
- "max_mqueue_len": 1000,
- "max_inflight": 32,
- "max_subscriptions": "infinity",
- "upgrade_qos": false,
- "await_rel_timeout": "12m"
}, - "flapping_detect": {
- "enable": false,
- "window_time": "12m",
- "max_count": 15,
- "ban_time": "12m"
}, - "force_shutdown": {
- "enable": true,
- "max_mailbox_size": 1000,
- "max_heap_size": "1024KB"
}, - "force_gc": {
- "enable": true,
- "count": 16000,
- "bytes": "32MB"
}, - "durable_sessions": {
- "enable": false,
- "batch_size": 100,
- "idle_poll_interval": "12m",
- "heartbeat_interval": "12m",
- "session_gc_interval": "12m",
- "session_gc_batch_size": 100,
- "message_retention_period": "12m"
}
}
{- "mqtt": {
- "idle_timeout": "15s",
- "max_packet_size": "32MB",
- "max_clientid_len": 65535,
- "max_topic_levels": 128,
- "max_topic_alias": 65535,
- "retain_available": true,
- "wildcard_subscription": true,
- "shared_subscription": true,
- "shared_subscription_strategy": "random",
- "shared_subscription_initial_sticky_pick": "random",
- "exclusive_subscription": false,
- "ignore_loop_deliver": false,
- "strict_mode": false,
- "response_information": "",
- "server_keepalive": "disabled",
- "keepalive_multiplier": 1.5,
- "keepalive_check_interval": "12m",
- "retry_interval": "infinity",
- "use_username_as_clientid": false,
- "peer_cert_as_username": "disabled",
- "peer_cert_as_clientid": "disabled",
- "client_attrs_init": [ ],
- "clientid_override": "disabled",
- "session_expiry_interval": "12m",
- "message_expiry_interval": "infinity",
- "max_awaiting_rel": 100,
- "max_qos_allowed": 0,
- "mqueue_priorities": "disabled",
- "mqueue_default_priority": "highest",
- "mqueue_store_qos0": true,
- "max_mqueue_len": 1000,
- "max_inflight": 32,
- "max_subscriptions": "infinity",
- "upgrade_qos": false,
- "await_rel_timeout": "12m"
}, - "flapping_detect": {
- "enable": false,
- "window_time": "12m",
- "max_count": 15,
- "ban_time": "12m"
}, - "force_shutdown": {
- "enable": true,
- "max_mailbox_size": 1000,
- "max_heap_size": "1024KB"
}, - "force_gc": {
- "enable": true,
- "count": 16000,
- "bytes": "32MB"
}, - "durable_sessions": {
- "enable": false,
- "batch_size": 100,
- "idle_poll_interval": "12m",
- "heartbeat_interval": "12m",
- "session_gc_interval": "12m",
- "session_gc_batch_size": 100,
- "message_retention_period": "12m"
}
}
Update the sub-configurations under alarm
actions | Array of strings Default: ["log","publish"] Items Enum: "log" "publish" The actions triggered when the alarm is activated. |
size_limit | integer [ 1 .. 3000 ] Default: 1000 The maximum number of historical alarms that can be stored. |
validity_period | string Default: "24h" The validity period of historical alarms. Calculated from the time of activation of the historical alarm instead of the time of cancelation. |
{- "actions": [
- "log",
- "publish"
], - "size_limit": 1000,
- "validity_period": "24h"
}
{- "actions": [
- "log",
- "publish"
], - "size_limit": 1000,
- "validity_period": "24h"
}
Get the sub-configurations under dashboard
{- "listeners": {
- "http": {
- "bind": "0.0.0.0:18083",
- "num_acceptors": 4,
- "max_connections": 512,
- "backlog": 1024,
- "send_timeout": "12m",
- "inet6": false,
- "ipv6_v6only": false,
- "proxy_header": false
}, - "https": {
- "bind": "0.0.0.0:18084",
- "ssl_options": {
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "cacerts": false,
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "verify": "verify_peer",
- "reuse_sessions": true,
- "depth": 10,
- "password": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
], - "ciphers": [ ],
- "secure_renegotiate": true,
- "log_level": "emergency",
- "hibernate_after": "12m",
- "dhfile": "string",
- "fail_if_no_peer_cert": false,
- "honor_cipher_order": true,
- "client_renegotiation": true,
- "handshake_timeout": "12m"
}, - "num_acceptors": 4,
- "max_connections": 512,
- "backlog": 1024,
- "send_timeout": "12m",
- "inet6": false,
- "ipv6_v6only": false,
- "proxy_header": false
}
}, - "default_password": "public",
- "token_expired_time": "12m",
- "cors": false,
- "swagger_support": true
}
Update the sub-configurations under dashboard
object (dashboard.listeners) | |
token_expired_time | string Default: "60m" JWT token expiration time. Default is 60 minutes |
cors | boolean Default: false Support Cross-Origin Resource Sharing (CORS). |
swagger_support | boolean Default: true Enable or disable support for swagger API documentation. |
{- "listeners": {
- "http": {
- "bind": "0.0.0.0:18083",
- "num_acceptors": 4,
- "max_connections": 512,
- "backlog": 1024,
- "send_timeout": "12m",
- "inet6": false,
- "ipv6_v6only": false,
- "proxy_header": false
}, - "https": {
- "bind": "0.0.0.0:18084",
- "ssl_options": {
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "cacerts": false,
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "verify": "verify_peer",
- "reuse_sessions": true,
- "depth": 10,
- "password": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
], - "ciphers": [ ],
- "secure_renegotiate": true,
- "log_level": "emergency",
- "hibernate_after": "12m",
- "dhfile": "string",
- "fail_if_no_peer_cert": false,
- "honor_cipher_order": true,
- "client_renegotiation": true,
- "handshake_timeout": "12m"
}, - "num_acceptors": 4,
- "max_connections": 512,
- "backlog": 1024,
- "send_timeout": "12m",
- "inet6": false,
- "ipv6_v6only": false,
- "proxy_header": false
}
}, - "token_expired_time": "12m",
- "cors": false,
- "swagger_support": true
}
{- "listeners": {
- "http": {
- "bind": "0.0.0.0:18083",
- "num_acceptors": 4,
- "max_connections": 512,
- "backlog": 1024,
- "send_timeout": "12m",
- "inet6": false,
- "ipv6_v6only": false,
- "proxy_header": false
}, - "https": {
- "bind": "0.0.0.0:18084",
- "ssl_options": {
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "cacerts": false,
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "verify": "verify_peer",
- "reuse_sessions": true,
- "depth": 10,
- "password": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
], - "ciphers": [ ],
- "secure_renegotiate": true,
- "log_level": "emergency",
- "hibernate_after": "12m",
- "dhfile": "string",
- "fail_if_no_peer_cert": false,
- "honor_cipher_order": true,
- "client_renegotiation": true,
- "handshake_timeout": "12m"
}, - "num_acceptors": 4,
- "max_connections": 512,
- "backlog": 1024,
- "send_timeout": "12m",
- "inet6": false,
- "ipv6_v6only": false,
- "proxy_header": false
}
}, - "default_password": "public",
- "token_expired_time": "12m",
- "cors": false,
- "swagger_support": true
}
Update the sub-configurations under broker
enable_session_registry | boolean Default: true The Global Session Registry is a cluster-wide mechanism designed to maintain the uniqueness of client IDs within the cluster. |
session_history_retain | string Default: "0s" The duration to retain the session registration history. Setting this to a value greater than |
{- "enable_session_registry": true,
- "session_history_retain": "1h"
}
{- "enable_session_registry": true,
- "session_history_retain": "1h"
}
Reset the config entry specified by the query string parameter conf_path
.
- For a config entry that has default value, this resets it to the default value;
- For a config entry that has no default value, an error 400 will be returned
rootname required | string Enum: "broker" "log" "sysmon" "sys_topics" "alarm" "dashboard" Example: sysmon |
conf_path | string Example: conf_path=os.sysmem_high_watermark The config path separated by '.' character |
{- "code": "NO_DEFAULT_VALUE",
- "message": "string"
}
Get all the configurations of the specified keys, including hot and non-hot updatable items.
key | string Enum: "actions" "alarm" "api_key" "authentication" "authorization" "auto_subscribe" "banned" "bridges" "cluster" "conn_congestion" "connectors" "crl_cache" "dashboard" "delayed" "durable_sessions" "durable_storage" "exhook" "flapping_detect" "force_gc" "force_shutdown" "gateway" "limiter" "listeners" "log" "mqtt" "node" "overload_protection" "prometheus" "psk_authentication" "retainer" "rewrite" "rpc" "rule_engine" "slow_subs" "sources" "sys_topics" "sysmon" "telemetry" "topic_metrics" Example: key=sysmon |
node | string Node's name. Will deprecated in 5.2.0. |
Update the configurations of the specified keys.
mode | string Default: "merge" Enum: "replace" "merge" |
ignore_readonly | boolean Default: false |
{- "code": "UPDATE_FAILED",
- "message": "string"
}
Get the sub-configurations under log
{- "console": {
- "level": "debug",
- "enable": true,
- "formatter": "text",
- "timestamp_format": "auto",
- "time_offset": "system",
- "payload_encode": "hex"
}, - "file": {
- "level": "warning"
}, - "throttling": {
- "time_window": "1h"
}
}
Update the sub-configurations under log
object (emqx.console_handler) | |
object or emqx.log_file_handler (object) Default: {"level":"warning"} File-based log handlers. | |
object (emqx.log_throttling) |
{- "console": {
- "level": "debug",
- "enable": true,
- "formatter": "text",
- "timestamp_format": "auto",
- "time_offset": "system",
- "payload_encode": "hex"
}, - "file": {
- "level": "warning"
}, - "throttling": {
- "time_window": "1h"
}
}
{- "console": {
- "level": "debug",
- "enable": true,
- "formatter": "text",
- "timestamp_format": "auto",
- "time_offset": "system",
- "payload_encode": "hex"
}, - "file": {
- "level": "warning"
}, - "throttling": {
- "time_window": "1h"
}
}
Get the total number of sessions in the cluster.
By default, it includes only those sessions that have not expired.
If the broker.session_history_retain
config is set to a duration greater than 0s,
this count will also include sessions that expired within the specified retain time.
By specifying the since
parameter, it can return the number of sessions that have expired within the specified time.
since | integer >= 0 Default: 0 Example: since=1705391625 Include sessions expired after this time (UNIX Epoch in seconds precision) |
"string"
Get clients info by client ID
clientid required | string |
{- "heap_size": 610,
- "send_msg.dropped.expired": 0,
- "send_oct": 31,
- "recv_msg.qos1": 0,
- "is_persistent": false,
- "send_pkt": 4,
- "clean_start": true,
- "inflight_cnt": 0,
- "node": "emqx@127.0.0.1",
- "send_msg.dropped.queue_full": 0,
- "awaiting_rel_cnt": 0,
- "inflight_max": 32,
- "created_at": "2024-01-01T12:34:56.789+08:00",
- "subscriptions_cnt": 1,
- "mailbox_len": 0,
- "send_cnt": 4,
- "connected": true,
- "ip_address": "127.0.0.1",
- "awaiting_rel_max": 100,
- "recv_msg.qos2": 0,
- "proto_ver": 5,
- "mountpoint": "null",
- "proto_name": "MQTT",
- "durable": false,
- "port": 52571,
- "connected_at": "2024-01-01T12:34:56.789+08:00",
- "enable_authn": true,
- "expiry_interval": 0,
- "username": null,
- "recv_msg": 0,
- "recv_oct": 49,
- "send_msg.dropped.too_large": 0,
- "keepalive": 60,
- "send_msg.qos1": 0,
- "send_msg.qos2": 0,
- "recv_msg.qos0": 0,
- "send_msg.qos0": 0,
- "subscriptions_max": "infinity",
- "mqueue_max": 1000,
- "mqueue_dropped": 0,
- "clientid": "01",
- "is_bridge": false,
- "peerport": 52571,
- "send_msg": 0,
- "listener": "tcp:default",
- "recv_cnt": 4,
- "recv_pkt": 4,
- "recv_msg.dropped": 0,
- "send_msg.dropped": 0,
- "recv_msg.dropped.await_pubrel_timeout": 0,
- "reductions": 6836,
- "mqueue_len": 0
}
Unsubscribe bulk
clientid required | string |
topic | string Topic |
[- {
- "topic": "testtopic/#"
}
]
{- "code": "CLIENTID_NOT_FOUND",
- "message": "string"
}
Subscribe bulk
clientid required | string |
topic required | string Topic |
qos | integer [ 0 .. 2 ] Default: 0 QoS |
nl | integer Default: 0 No Local |
rap | integer Default: 0 Retain as Published |
rh | integer Default: 0 Retain Handling |
[- {
- "topic": "testtopic/#",
- "qos": 0,
- "nl": 0,
- "rap": 0,
- "rh": 0
}
]
[- {
- "node": "emqx@127.0.0.1",
- "topic": "testtopic/1",
- "clientid": "emqx_clientid_xx128cdhfc",
- "qos": 0,
- "nl": 0,
- "rap": 0,
- "rh": 0,
- "durable": false
}
]
Subscribe
clientid required | string |
topic required | string Topic |
qos | integer [ 0 .. 2 ] Default: 0 QoS |
nl | integer Default: 0 No Local |
rap | integer Default: 0 Retain as Published |
rh | integer Default: 0 Retain Handling |
{- "topic": "testtopic/#",
- "qos": 0,
- "nl": 0,
- "rap": 0,
- "rh": 0
}
{- "node": "emqx@127.0.0.1",
- "topic": "testtopic/1",
- "clientid": "emqx_clientid_xx128cdhfc",
- "qos": 0,
- "nl": 0,
- "rap": 0,
- "rh": 0,
- "durable": false
}
Get client mqueue messages
clientid required | string |
payload | string Default: "base64" Enum: "none" "base64" "plain" Client's inflight/mqueue messages payload encoding. If set to |
max_payload_bytes | string Default: "1MB" Example: max_payload_bytes=32MB Client's inflight/mqueue messages payload limit. The total payload size of all messages in the response will not exceed this value. Messages beyond the limit will be silently omitted in the response. The only exception to this rule is when the first message payload is already larger than the limit. In this case, the first message will be returned in the response. |
string or string or string Example: position=none An opaque token that can then be in subsequent requests to get the next chunk of results: "?position={prev_response.meta.position}" | |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page(max 10000) |
{- "data": [
- {
- "from_clientid": "mqttx_59ac0a87",
- "from_username": "test-user",
- "mqueue_priority": 0,
- "msgid": "000611F460D57FA9F44500000D360002",
- "payload": "eyJmb28iOiAiYmFyIn0=",
- "publish_at": 1709055346487,
- "qos": 0,
- "topic": "t/test"
}
], - "meta": {
- "count": 100,
- "last": "1710785444656449826_10"
}
}
Get client in-flight messages
clientid required | string |
payload | string Default: "base64" Enum: "none" "base64" "plain" Client's inflight/mqueue messages payload encoding. If set to |
max_payload_bytes | string Default: "1MB" Example: max_payload_bytes=32MB Client's inflight/mqueue messages payload limit. The total payload size of all messages in the response will not exceed this value. Messages beyond the limit will be silently omitted in the response. The only exception to this rule is when the first message payload is already larger than the limit. In this case, the first message will be returned in the response. |
string or string or string Example: position=none An opaque token that can then be in subsequent requests to get the next chunk of results: "?position={prev_response.meta.position}" | |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page(max 10000) |
{- "data": [
- {
- "from_clientid": "mqttx_59ac0a87",
- "from_username": "test-user",
- "msgid": "000611F460D57FA9F44500000D360002",
- "payload": "eyJmb28iOiAiYmFyIn0=",
- "publish_at": 1709055346487,
- "qos": 0,
- "topic": "t/test"
}
], - "meta": {
- "count": 100,
- "last": "1710785444656449826"
}
}
Unsubscribe
clientid required | string |
topic | string Topic |
{- "topic": "testtopic/#"
}
{- "code": "CLIENTID_NOT_FOUND",
- "message": "string"
}
Get client subscriptions
clientid required | string |
[- {
- "node": "emqx@127.0.0.1",
- "topic": "testtopic/1",
- "clientid": "emqx_clientid_xx128cdhfc",
- "qos": 0,
- "nl": 0,
- "rap": 0,
- "rh": 0,
- "durable": false
}
]
List clients
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
node | string Example: node=emqx@127.0.0.1 Node name |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page(max 10000) |
username | Array of strings User name, multiple values can be specified by repeating the parameter: username=u1&username=u2 |
ip_address | string Example: ip_address=127.0.0.1 Client's IP address |
conn_state | string Enum: "connected" "idle" "disconnected" The current connection status of the client, the possible values are connected,idle,disconnected |
clean_start | boolean Whether the client uses a new session |
proto_ver | string Client protocol version |
like_clientid | string Fuzzy search |
like_username | string Fuzzy search |
integer or string Search client session creation time by greater than or equal method, rfc3339 or timestamp(millisecond) | |
integer or string Search client session creation time by less than or equal method, rfc3339 or timestamp(millisecond) | |
integer or string Search client connection creation time by greater than or equal method, rfc3339 or timestamp(epoch millisecond) | |
integer or string Search client connection creation time by less than or equal method, rfc3339 or timestamp(millisecond) | |
clientid | Array of strings Client ID, multiple values can be specified by repeating the parameter: clientid=c1&clientid=c2 |
Array of strings or string Default: "all" Comma separated list of client fields to return in the response |
{- "data": [
- {
- "heap_size": 610,
- "send_msg.dropped.expired": 0,
- "send_oct": 31,
- "recv_msg.qos1": 0,
- "is_persistent": false,
- "send_pkt": 4,
- "clean_start": true,
- "inflight_cnt": 0,
- "node": "emqx@127.0.0.1",
- "send_msg.dropped.queue_full": 0,
- "awaiting_rel_cnt": 0,
- "inflight_max": 32,
- "created_at": "2024-01-01T12:34:56.789+08:00",
- "subscriptions_cnt": 1,
- "mailbox_len": 0,
- "send_cnt": 4,
- "connected": true,
- "ip_address": "127.0.0.1",
- "awaiting_rel_max": 100,
- "recv_msg.qos2": 0,
- "proto_ver": 5,
- "mountpoint": "null",
- "proto_name": "MQTT",
- "durable": false,
- "port": 52571,
- "connected_at": "2024-01-01T12:34:56.789+08:00",
- "enable_authn": true,
- "expiry_interval": 0,
- "username": null,
- "recv_msg": 0,
- "recv_oct": 49,
- "send_msg.dropped.too_large": 0,
- "keepalive": 60,
- "send_msg.qos1": 0,
- "send_msg.qos2": 0,
- "recv_msg.qos0": 0,
- "send_msg.qos0": 0,
- "subscriptions_max": "infinity",
- "mqueue_max": 1000,
- "mqueue_dropped": 0,
- "clientid": "01",
- "is_bridge": false,
- "peerport": 52571,
- "send_msg": 0,
- "listener": "tcp:default",
- "recv_cnt": 4,
- "recv_pkt": 4,
- "recv_msg.dropped": 0,
- "send_msg.dropped": 0,
- "recv_msg.dropped.await_pubrel_timeout": 0,
- "reductions": 6836,
- "mqueue_len": 0
}
], - "meta": {
- "count": 1,
- "hasnext": false,
- "limit": 50,
- "page": 1
}
}
Test creating a new connector.
type required | string Value: "mqtt" The type of the connector. |
name required | string The name of the connector. |
enable | boolean Default: true Enable (true) or disable (false) this connector. |
tags | Array of strings Tags to annotate this config entry. |
description | string Default: "" Descriptive text. |
pool_size | integer >= 1 Default: 8 Size of the pool of MQTT clients that will publish messages to the remote broker. |
object (connector_mqtt.resource_opts) | |
mode | string Deprecated Default: "cluster_shareload" Value: "cluster_shareload" The mode of the MQTT Bridge. |
server required | string The host and port of the remote MQTT broker |
clientid_prefix | string Optional prefix to prepend to the clientid used by egress bridges. |
Array of objects (connector_mqtt.static_clientid_entry) Default: [] Entries mapping EMQX node names to static client IDs. | |
reconnect_interval | string Deprecated |
proto_ver | string Default: "v4" Enum: "v3" "v4" "v5" The MQTT protocol version |
bridge_mode | boolean Default: false If enable bridge mode. |
username | string The username of the MQTT protocol |
password | string <password> The password of the MQTT protocol |
clean_start | boolean Default: true Whether to start a clean session when reconnecting a remote broker for ingress bridge |
keepalive | string Default: "160s" MQTT Keepalive. Time interval is a string that contains a number followed by time unit: |
connect_timeout | string Default: "10s" Timeout for connecting to the remote broker. The connection worker process is blocked up to this amount of time when attempting the initial connection. |
retry_interval | string Default: "15s" Message retry interval. Delay for the MQTT bridge to retry sending the QoS1/QoS2 messages in case of ACK not received. Time interval is a string that contains a number followed by time unit: |
max_inflight | integer >= 0 Default: 32 Max inflight (sent, but un-acked) messages of the MQTT protocol |
object (emqx.ssl_client_opts) |
{- "name": "my_http_connector",
- "type": "http",
- "connect_timeout": "15s",
- "pool_size": 1,
- "enable": true,
- "headers": {
- "content-type": "application/json"
}, - "pool_type": "hash",
- "enable_pipelining": 100
}
{- "code": "TEST_FAILED",
- "message": "string"
}
Get a connector by id.
id required | string Example: http:my_http_connector The connector id. Must be of format {type}:{name}. |
{- "name": "my_http_connector",
- "status": "connected",
- "type": "http",
- "connect_timeout": "15s",
- "pool_size": 1,
- "enable": true,
- "headers": {
- "content-type": "application/json"
}, - "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pool_type": "hash",
- "enable_pipelining": 100
}
Update a connector by id.
id required | string Example: http:my_http_connector The connector id. Must be of format {type}:{name}. |
enable | boolean Default: true Enable (true) or disable (false) this connector. |
tags | Array of strings Tags to annotate this config entry. |
description | string Default: "" Descriptive text. |
pool_size | integer >= 1 Default: 8 Size of the pool of MQTT clients that will publish messages to the remote broker. |
object (connector_mqtt.resource_opts) | |
mode | string Deprecated Default: "cluster_shareload" Value: "cluster_shareload" The mode of the MQTT Bridge. |
server required | string The host and port of the remote MQTT broker |
clientid_prefix | string Optional prefix to prepend to the clientid used by egress bridges. |
Array of objects (connector_mqtt.static_clientid_entry) Default: [] Entries mapping EMQX node names to static client IDs. | |
reconnect_interval | string Deprecated |
proto_ver | string Default: "v4" Enum: "v3" "v4" "v5" The MQTT protocol version |
bridge_mode | boolean Default: false If enable bridge mode. |
username | string The username of the MQTT protocol |
password | string <password> The password of the MQTT protocol |
clean_start | boolean Default: true Whether to start a clean session when reconnecting a remote broker for ingress bridge |
keepalive | string Default: "160s" MQTT Keepalive. Time interval is a string that contains a number followed by time unit: |
connect_timeout | string Default: "10s" Timeout for connecting to the remote broker. The connection worker process is blocked up to this amount of time when attempting the initial connection. |
retry_interval | string Default: "15s" Message retry interval. Delay for the MQTT bridge to retry sending the QoS1/QoS2 messages in case of ACK not received. Time interval is a string that contains a number followed by time unit: |
max_inflight | integer >= 0 Default: 32 Max inflight (sent, but un-acked) messages of the MQTT protocol |
object (emqx.ssl_client_opts) |
{- "connect_timeout": "15s",
- "pool_size": 1,
- "enable": true,
- "headers": {
- "content-type": "application/json"
}, - "pool_type": "hash",
- "enable_pipelining": 100
}
{- "name": "my_http_connector",
- "status": "connected",
- "type": "http",
- "connect_timeout": "15s",
- "pool_size": 1,
- "enable": true,
- "headers": {
- "content-type": "application/json"
}, - "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pool_type": "hash",
- "enable_pipelining": 100
}
Start connector on all nodes in the cluster.
id required | string Example: http:my_http_connector The connector id. Must be of format {type}:{name}. |
operation required | string Value: "start" Example: start Operation can be one of: 'start'. |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Start connector on a specific node.
node required | |
id required | string Example: http:my_http_connector The connector id. Must be of format {type}:{name}. |
operation required | string Value: "start" Example: start Operation can be one of: 'start'. |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Enable or Disable connector on all nodes in the cluster.
id required | string Example: http:my_http_connector The connector id. Must be of format {type}:{name}. |
enable required | boolean Example: true Whether to enable this connector. |
{- "code": "NOT_FOUND",
- "message": "string"
}
[- {
- "name": "my_http_connector",
- "status": "connected",
- "type": "http",
- "connect_timeout": "15s",
- "pool_size": 1,
- "enable": true,
- "headers": {
- "content-type": "application/json"
}, - "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pool_type": "hash",
- "enable_pipelining": 100
}, - {
- "status": "connected",
- "description": "My connector",
- "pool_size": 3,
- "server": "127.0.0.1:1883",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "proto_ver": "v5",
- "resource_opts": {
- "start_after_created": true,
- "start_timeout": "5s",
- "health_check_interval": "45s"
}
}
]
Create a new connector by type and name.
type required | string Value: "mqtt" The type of the connector. |
name required | string The name of the connector. |
enable | boolean Default: true Enable (true) or disable (false) this connector. |
tags | Array of strings Tags to annotate this config entry. |
description | string Default: "" Descriptive text. |
pool_size | integer >= 1 Default: 8 Size of the pool of MQTT clients that will publish messages to the remote broker. |
object (connector_mqtt.resource_opts) | |
mode | string Deprecated Default: "cluster_shareload" Value: "cluster_shareload" The mode of the MQTT Bridge. |
server required | string The host and port of the remote MQTT broker |
clientid_prefix | string Optional prefix to prepend to the clientid used by egress bridges. |
Array of objects (connector_mqtt.static_clientid_entry) Default: [] Entries mapping EMQX node names to static client IDs. | |
reconnect_interval | string Deprecated |
proto_ver | string Default: "v4" Enum: "v3" "v4" "v5" The MQTT protocol version |
bridge_mode | boolean Default: false If enable bridge mode. |
username | string The username of the MQTT protocol |
password | string <password> The password of the MQTT protocol |
clean_start | boolean Default: true Whether to start a clean session when reconnecting a remote broker for ingress bridge |
keepalive | string Default: "160s" MQTT Keepalive. Time interval is a string that contains a number followed by time unit: |
connect_timeout | string Default: "10s" Timeout for connecting to the remote broker. The connection worker process is blocked up to this amount of time when attempting the initial connection. |
retry_interval | string Default: "15s" Message retry interval. Delay for the MQTT bridge to retry sending the QoS1/QoS2 messages in case of ACK not received. Time interval is a string that contains a number followed by time unit: |
max_inflight | integer >= 0 Default: 32 Max inflight (sent, but un-acked) messages of the MQTT protocol |
object (emqx.ssl_client_opts) |
{- "name": "my_http_connector",
- "type": "http",
- "connect_timeout": "15s",
- "pool_size": 1,
- "enable": true,
- "headers": {
- "content-type": "application/json"
}, - "pool_type": "hash",
- "enable_pipelining": 100
}
{- "name": "my_http_connector",
- "status": "connected",
- "type": "http",
- "connect_timeout": "15s",
- "pool_size": 1,
- "enable": true,
- "headers": {
- "content-type": "application/json"
}, - "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pool_type": "hash",
- "enable_pipelining": 100
}
Start bridge on a specific node.
node required | |
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
operation required | string Value: "start" Example: start Operation can be one of: 'start'. |
{- "code": "BAD_REQUEST",
- "message": "string"
}
[- {
- "name": "mqtt_source",
- "status": "connected",
- "type": "mqtt",
- "description": "My example mqtt source",
- "enable": true,
- "parameters": {
- "topic": "remote/topic",
- "qos": 1
}, - "connector": "mqtt_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "resource_opts": {
- "health_check_interval": "30s"
}
}
]
Create a new bridge by type and name.
type required | string Value: "mqtt" |
name required | string |
required | object (bridge_mqtt_publisher.ingress_parameters) |
enable | boolean Default: true Enable (true) or disable (false) this action. |
connector required | string Name of the connector specified by the action, used for external resource selection. |
tags | Array of strings Tags to annotate this config entry. |
description | string Default: "" Descriptive text. |
object (bridge_mqtt_publisher.source_resource_opts) |
{- "name": "mqtt_source",
- "type": "mqtt",
- "description": "My example mqtt source",
- "enable": true,
- "parameters": {
- "topic": "remote/topic",
- "qos": 1
}, - "connector": "mqtt_connector",
- "resource_opts": {
- "health_check_interval": "30s"
}
}
{- "name": "mqtt_source",
- "status": "connected",
- "type": "mqtt",
- "description": "My example mqtt source",
- "enable": true,
- "parameters": {
- "topic": "remote/topic",
- "qos": 1
}, - "connector": "mqtt_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "resource_opts": {
- "health_check_interval": "30s"
}
}
Get a bridge by id.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
{- "name": "mqtt_source",
- "status": "connected",
- "type": "mqtt",
- "description": "My example mqtt source",
- "enable": true,
- "parameters": {
- "topic": "remote/topic",
- "qos": 1
}, - "connector": "mqtt_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "resource_opts": {
- "health_check_interval": "30s"
}
}
Update a bridge by id.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
required | object (bridge_mqtt_publisher.ingress_parameters) |
enable | boolean Default: true Enable (true) or disable (false) this action. |
connector required | string Name of the connector specified by the action, used for external resource selection. |
tags | Array of strings Tags to annotate this config entry. |
description | string Default: "" Descriptive text. |
object (bridge_mqtt_publisher.source_resource_opts) |
{- "description": "My example mqtt source",
- "enable": true,
- "parameters": {
- "topic": "remote/topic",
- "qos": 1
}, - "connector": "mqtt_connector",
- "resource_opts": {
- "health_check_interval": "30s"
}
}
{- "name": "mqtt_source",
- "status": "connected",
- "type": "mqtt",
- "description": "My example mqtt source",
- "enable": true,
- "parameters": {
- "topic": "remote/topic",
- "qos": 1
}, - "connector": "mqtt_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "resource_opts": {
- "health_check_interval": "30s"
}
}
Delete a bridge by id.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
also_delete_dep_actions | boolean Default: false Whether to cascade delete dependent actions. |
{- "rules": [
- "string"
], - "code": "BAD_REQUEST",
- "message": "string"
}
Enable or Disable bridge on all nodes in the cluster.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
enable required | boolean Example: true Whether to enable this bridge. |
{- "code": "NOT_FOUND",
- "message": "string"
}
Test creating a new bridge.
type required | string Value: "mqtt" |
name required | string |
required | object (bridge_mqtt_publisher.ingress_parameters) |
enable | boolean Default: true Enable (true) or disable (false) this action. |
connector required | string Name of the connector specified by the action, used for external resource selection. |
tags | Array of strings Tags to annotate this config entry. |
description | string Default: "" Descriptive text. |
object (bridge_mqtt_publisher.source_resource_opts) |
{- "name": "mqtt_source",
- "type": "mqtt",
- "description": "My example mqtt source",
- "enable": true,
- "parameters": {
- "topic": "remote/topic",
- "qos": 1
}, - "connector": "mqtt_connector",
- "resource_opts": {
- "health_check_interval": "30s"
}
}
{- "code": "TEST_FAILED",
- "message": "string"
}
Get bridge metrics by id.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
{- "metrics": {
- "dropped": 0,
- "dropped.other": 0,
- "dropped.queue_full": 0,
- "dropped.resource_not_found": 0,
- "dropped.resource_stopped": 0,
- "matched": 0,
- "queuing": 0,
- "retried": 0,
- "failed": 0,
- "inflight": 0,
- "success": 0,
- "rate": 0,
- "rate_max": 0,
- "rate_last5m": 0,
- "received": 0
}, - "node_metrics": [
- {
- "node": "emqx@127.0.0.1",
- "metrics": {
- "dropped": 0,
- "dropped.other": 0,
- "dropped.queue_full": 0,
- "dropped.resource_not_found": 0,
- "dropped.resource_stopped": 0,
- "matched": 0,
- "queuing": 0,
- "retried": 0,
- "failed": 0,
- "inflight": 0,
- "success": 0,
- "rate": 0,
- "rate_max": 0,
- "rate_last5m": 0,
- "received": 0
}
}
]
}
Start bridge on all nodes in the cluster.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
operation required | string Value: "start" Example: start Operation can be one of: 'start'. |
{- "code": "BAD_REQUEST",
- "message": "string"
}
[- {
- "name": "mySource",
- "status": "connected",
- "type": "source_type",
- "enable": true,
- "rules": [
- "rule1",
- "rule2"
], - "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": "connected",
- "status_reason": ""
}
], - "created_at": 1736512728666,
- "status_reason": "",
- "last_modified_at": 1736512728666
}
]
Enable or disable telemetry
enable | boolean Default: true Enable telemetry |
{- "enable": false
}
{- "enable": false
}
{- "emqx_version": "5.0.0-beta.3-32d1547c",
- "license": {
- "edition": "opensource"
}, - "os_name": "Linux",
- "os_version": "20.04",
- "otp_version": "24",
- "up_time": 20220113,
- "uuid": "AAAAAAAA-BBBB-CCCC-2022-DDDDEEEEFFF",
- "nodes_uuid": [
- "AAAAAAAA-BBBB-CCCC-2022-DDDDEEEEFFF",
- "ZZZZZZZZ-CCCC-BBBB-2022-DDDDEEEEFFF"
], - "active_plugins": [
- "Plugin A",
- "Plugin B"
], - "active_modules": [
- "Module A",
- "Module B"
], - "num_clients": 20220113,
- "messages_received": 2022,
- "messages_sent": 2022
}
Export a data backup file
table_sets | Array of strings Sets of tables to export. Exports all if omitted. Valid values: |
root_keys | Array of strings Sets of root configuration keys to export. Exports all if omitted. |
{- "root_keys": [
- "connectors",
- "actions",
- "sources",
- "rule_engine",
- "schema_registry"
], - "table_sets": [
- "banned",
- "builtin_authn",
- "builtin_authz"
]
}
{- "node": "emqx@127.0.0.1",
- "size": 22740,
- "filename": "emqx-export-2023-11-23-19-13-19.043.tar.gz",
- "created_at": "2023-11-23T19:13:19+02:00",
- "created_at_sec": 1700759599
}
Import a data backup file
node | string Node name |
filename required | string Data backup file name |
{- "node": "emqx@127.0.0.1",
- "filename": "emqx-export-2023-11-23-19-13-19.043.tar.gz"
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
List backup files
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page(max 10000) |
{- "data": [
- {
- "node": "emqx@127.0.0.1",
- "size": 22740,
- "filename": "emqx-export-2023-09-02-11-11-33.012.tar.gz",
- "created_at": "2023-09-02T11:11:33+02:00",
- "created_at_sec": 1693645893
}, - {
- "node": "emqx@127.0.0.1",
- "size": 22740,
- "filename": "emqx-export-2023-11-23-19-13-19.043.tar.gz",
- "created_at": "2023-11-23T19:13:19+02:00",
- "created_at_sec": 1700759599
}
], - "meta": {
- "count": 300,
- "limit": 20,
- "page": 0
}
}
Send a join invitation to a node to join the cluster but do not wait for the join result. Join status can be retrieved with GET api/<version>/invitation
node required | string Example: emqx2@127.0.0.1 node name |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Invite node to cluster
node required | string Example: emqx2@127.0.0.1 node name |
timeout | integer >= 0 Timeout in milliseconds |
{- "timeout": "15000"
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get RLOG cluster topology: connections between core and replicant nodes.
[- {
- "core_node": "emqx-core@127.0.0.1",
- "replicant_nodes": [
- {
- "node": "emqx-replicant@127.0.0.2",
- "streams": "10"
}
]
}
]
Get the execution status of all asynchronous invite status per node
{- "succeed": [
- {
- "node": "emqx2@127.0.0.1",
- "started_at": "2024-01-30T15:24:39.355+08:00",
- "finished_at": "2024-01-30T15:24:39.355+08:00"
}
], - "in_progress": [
- {
- "node": "emqx2@127.0.0.1",
- "started_at": "2024-01-30T15:24:39.355+08:00"
}
], - "failed": [
- {
- "node": "emqx2@127.0.0.1",
- "started_at": "2024-01-30T15:24:39.355+08:00",
- "finished_at": "2024-01-30T15:24:39.355+08:00",
- "reason": "Bad RPC to target node"
}
]
}
Get the gateway client information
clientid required | string Client ID |
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Gateway Name |
{- "clientid": "MzAyMzEzNTUwNzk1NDA1MzYyMzIwNzUxNjQwMTY1NzQ0NjE",
- "mailbox_len": 0,
- "endpoint_name": "urn:imei:154928475237123",
- "send_msg": 0,
- "recv_msg": 0,
- "recv_pkt": 1,
- "inflight_cnt": 0,
- "username": "guest",
- "subscriptions_cnt": 0,
- "disconnected_at": null,
- "created_at": "2021-12-07T10:44:02.721+08:00",
- "proto_name": "LwM2M",
- "is_bridge": false,
- "mqueue_dropped": 0,
- "expiry_interval": 0,
- "lifetime": 86400,
- "recv_cnt": 1,
- "send_oct": 61,
- "heap_size": 4185,
- "inflight_max": "infinity",
- "clean_start": true,
- "reductions": 72022,
- "mqueue_len": 0,
- "ip_address": "127.0.0.1",
- "proto_ver": "1.0",
- "node": "emqx@127.0.0.1",
- "awaiting_rel_cnt": 0,
- "connected_at": "2021-12-07T10:44:02.721+08:00",
- "send_cnt": 1,
- "send_pkt": 1,
- "port": 50675,
- "mqueue_max": "infinity",
- "recv_oct": 56,
- "connected": true,
- "awaiting_rel_max": "infinity",
- "subscriptions_max": "infinity",
- "keepalive": 0
}
Kick out the gateway client
clientid required | string Client ID |
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Gateway Name |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get the gateway client subscriptions
clientid required | string Client ID |
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Gateway Name |
[- {
- "nl": 0,
- "topic": "test/topic",
- "qos": 1,
- "rap": 0,
- "rh": 0
}
]
Create a subscription membership
clientid required | string Client ID |
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Gateway Name |
topic | string Topic Filter/Name |
qos | integer QoS level, enum: 0, 1, 2 |
nl | integer No Local option, enum: 0, 1 |
rap | integer Retain as Published option, enum: 0, 1 |
rh | integer Retain Handling option, enum: 0, 1, 2 |
object (emqx_gateway_api_clients.extra_sub_props) |
{- "nl": 0,
- "topic": "test/topic",
- "qos": 1,
- "rap": 0,
- "rh": 0
}
{- "nl": 0,
- "topic": "test/topic",
- "qos": 1,
- "rap": 0,
- "rh": 0
}
Delete a subscriptions membership
topic required | string Topic Filter/Name |
clientid required | string Client ID |
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Gateway Name |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get the gateway client list
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Gateway Name |
node | string Match the client's node name |
clientid | string Match the client's ID |
username | string Match the client's Username |
ip_address | string Match the client's ip address |
conn_state | string Match the client's connection state |
proto_ver | string Match the client's protocol version |
clean_start | boolean Match the client's clean start flag |
like_clientid | string Use sub-string to match client's ID |
like_username | string Use sub-string to match client's username |
integer or string Match the session created datetime greater than a certain value | |
integer or string Match the session created datetime less than a certain value | |
integer or string Match the client socket connected datetime greater than a certain value | |
integer or string Match the client socket connected datatime less than a certain value | |
endpoint_name | string Match the lwm2m client's endpoint name |
like_endpoint_name | string Use sub-string to match lwm2m client's endpoint name |
gte_lifetime | string Match the lwm2m client registered lifetime greater than a certain value |
lte_lifetime | string Match the lwm2m client registered lifetime less than a certain value |
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page(max 10000) |
{- "data": [
- {
- "node": "string",
- "clientid": "string",
- "username": "string",
- "mountpoint": "string",
- "proto_name": "string",
- "proto_ver": "string",
- "ip_address": "string",
- "port": 0,
- "is_bridge": true,
- "connected_at": 1640995200000,
- "disconnected_at": 1640995200000,
- "connected": true,
- "keepalive": 0,
- "clean_start": true,
- "expiry_interval": 0,
- "created_at": 1640995200000,
- "subscriptions_cnt": 0,
- "subscriptions_max": 0,
- "inflight_cnt": 0,
- "inflight_max": 0,
- "mqueue_len": 0,
- "mqueue_max": 0,
- "mqueue_dropped": 0,
- "awaiting_rel_cnt": 0,
- "awaiting_rel_max": 0,
- "recv_oct": 0,
- "recv_cnt": 0,
- "recv_pkt": 0,
- "recv_msg": 0,
- "send_oct": 0,
- "send_cnt": 0,
- "send_pkt": 0,
- "send_msg": 0,
- "mailbox_len": 0,
- "heap_size": 0,
- "reductions": 0
}
], - "meta": {
- "page": 1,
- "limit": 50,
- "count": 0,
- "hasnext": true
}
}
Possible HTTP response status code are:
200: All messages are delivered to at least one subscriber;
202: At least one message was not delivered to any subscriber;
400: At least one message is invalid. For example bad topic name, or QoS is out of range;
503: Failed to deliver at least one of the messages;
In case there is at lest one invalid message in the batch, the HTTP response body
is the same as for /publish
API.
Otherwise the HTTP response body is an array of JSON objects indicating the publish
result of each individual message in the batch.
payload_encoding | string Default: "plain" Enum: "plain" "base64" MQTT Payload Encoding, |
topic required | string Topic Name |
qos | integer [ 0 .. 2 ] Default: 0 MQTT message QoS |
clientid | string Deprecated |
payload required | string The MQTT message payload. |
object (emqx_mgmt_api_publish.message_properties) | |
retain | boolean Default: false A boolean field to indicate if this message should be retained. |
[- {
- "payload_encoding": "plain",
- "topic": "api/example/topic",
- "qos": 0,
- "clientid": "string",
- "payload": "hello emqx api",
- "properties": {
- "payload_format_indicator": 0,
- "message_expiry_interval": 0,
- "response_topic": "some_other_topic",
- "correlation_data": "string",
- "user_properties": {
- "foo": "bar"
}, - "content_type": "text/plain"
}, - "retain": false
}
]
[- {
- "id": "string"
}
]
Possible HTTP status response codes are:200
: The message is delivered to at least one subscriber;202
: No matched subscribers;400
: Message is invalid. for example bad topic name, or QoS is out of range;503
: Failed to deliver the message to subscriber(s)
payload_encoding | string Default: "plain" Enum: "plain" "base64" MQTT Payload Encoding, |
topic required | string Topic Name |
qos | integer [ 0 .. 2 ] Default: 0 MQTT message QoS |
clientid | string Deprecated |
payload required | string The MQTT message payload. |
object (emqx_mgmt_api_publish.message_properties) | |
retain | boolean Default: false A boolean field to indicate if this message should be retained. |
{- "payload_encoding": "plain",
- "topic": "api/example/topic",
- "qos": 0,
- "clientid": "string",
- "payload": "hello emqx api",
- "properties": {
- "payload_format_indicator": 0,
- "message_expiry_interval": 0,
- "response_topic": "some_other_topic",
- "correlation_data": "string",
- "user_properties": {
- "foo": "bar"
}, - "content_type": "text/plain"
}, - "retain": false
}
{- "id": "string"
}
Test a rule
rule_engine.ctx_unsub (object) or rule_engine.ctx_sub (object) or rule_engine.ctx_schema_validation_failed (object) or rule_engine.ctx_message_transformation_failed (object) or rule_engine.ctx_pub (object) or rule_engine.ctx_dropped (object) or rule_engine.ctx_delivered (object) or rule_engine.ctx_acked (object) or rule_engine.ctx_delivery_dropped (object) or rule_engine.ctx_disconnected (object) or rule_engine.ctx_connected (object) or rule_engine.ctx_connack (object) or rule_engine.ctx_check_authz_complete (object) or rule_engine.ctx_check_authn_complete (object) or rule_engine.ctx_alarm_deactivated (object) or rule_engine.ctx_alarm_activated (object) or rule_engine.ctx_bridge_mqtt (object) Default: {} The context of the event for testing | |
sql required | string The SQL of the rule for testing |
{- "context": { },
- "sql": "string"
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
Apply a rule with the given message and environment
id required | string Example: my_rule_id |
rule_engine.ctx_unsub (object) or rule_engine.ctx_sub (object) or rule_engine.ctx_schema_validation_failed (object) or rule_engine.ctx_message_transformation_failed (object) or rule_engine.ctx_pub (object) or rule_engine.ctx_dropped (object) or rule_engine.ctx_delivered (object) or rule_engine.ctx_acked (object) or rule_engine.ctx_delivery_dropped (object) or rule_engine.ctx_disconnected (object) or rule_engine.ctx_connected (object) or rule_engine.ctx_connack (object) or rule_engine.ctx_check_authz_complete (object) or rule_engine.ctx_check_authn_complete (object) or rule_engine.ctx_alarm_deactivated (object) or rule_engine.ctx_alarm_activated (object) or rule_engine.ctx_bridge_mqtt (object) Default: {} The context of the event for testing | |
stop_action_after_template_rendering | boolean Default: true Set this to true if the action should be stopped after its template has been rendered (default is true). |
{- "context": { },
- "stop_action_after_template_rendering": true
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
List all rules
enable | boolean Filter enable/disable rules |
from | string Filter rules by from(topic), exact match |
like_id | string Filter rules by id, Substring matching |
like_from | string Filter rules by from(topic), Substring matching |
like_description | string Filter rules by description, Substring matching |
match_from | string Filter rules by from(topic), Mqtt topic matching |
action | Array of strings Filters rules that contain any of the given action id(s). When used in conjunction with source id filtering, the rules must contain sources and actions that match some of the criteria. |
source | Array of strings Filters rules that contain any of the given source id(s). When used in conjunction with action id filtering, the rules must contain sources and actions that match some of the criteria. |
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page(max 10000) |
{- "data": [
- {
- "id": "293fb66f",
- "from": "t/#",
- "created_at": "2021-12-01T15:00:43.153+08:00",
- "last_modified_at": "2021-12-24T15:00:44.153+08:00",
- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1",
- "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "enable": true,
- "description": "Some description",
- "metadata": { }
}
], - "meta": {
- "page": 1,
- "limit": 50,
- "count": 0,
- "hasnext": true
}
}
Create a new rule using given Id
name | string Default: "" The name of the rule |
sql required | string SQL query to transform the messages. |
Array of rule_engine.user_provided_function (object) or rule_engine.builtin_action_console (object) or rule_engine.builtin_action_republish (object) or strings Default: [] A list of actions of the rule. | |
enable | boolean Default: true Enable or disable the rule |
description | string Default: "" The description of the rule |
metadata | object Rule metadata, do not change manually |
{- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1",
- "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "enable": true,
- "description": "Some description",
- "metadata": { }
}
{- "id": "293fb66f",
- "from": "t/#",
- "created_at": "2021-12-01T15:00:43.153+08:00",
- "last_modified_at": "2021-12-24T15:00:44.153+08:00",
- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1",
- "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "enable": true,
- "description": "Some description",
- "metadata": { }
}
Get a rule's metrics by given Id
id required | string Example: my_rule_id |
{- "id": "293fb66f",
- "metrics": {
- "matched": 0,
- "matched.rate": 0,
- "matched.rate.max": 0,
- "matched.rate.last5m": 0,
- "passed": 0,
- "failed": 0,
- "failed.exception": 0,
- "failed.unknown": 0,
- "actions.total": 0,
- "actions.success": 0,
- "actions.failed": 0,
- "actions.failed.out_of_service": 0,
- "actions.failed.unknown": 0,
- "actions.discarded": 0
}, - "node_metrics": [
- {
- "node": "emqx@127.0.0.1",
- "matched": 0,
- "matched.rate": 0,
- "matched.rate.max": 0,
- "matched.rate.last5m": 0,
- "passed": 0,
- "failed": 0,
- "failed.exception": 0,
- "failed.unknown": 0,
- "actions.total": 0,
- "actions.success": 0,
- "actions.failed": 0,
- "actions.failed.out_of_service": 0,
- "actions.failed.unknown": 0,
- "actions.discarded": 0
}
]
}
Get a rule by given Id
id required | string Example: my_rule_id |
{- "id": "293fb66f",
- "from": "t/#",
- "created_at": "2021-12-01T15:00:43.153+08:00",
- "last_modified_at": "2021-12-24T15:00:44.153+08:00",
- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1",
- "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "enable": true,
- "description": "Some description",
- "metadata": { }
}
Update a rule by given Id to all nodes in the cluster
id required | string Example: my_rule_id |
name | string Default: "" The name of the rule |
sql required | string SQL query to transform the messages. |
Array of rule_engine.user_provided_function (object) or rule_engine.builtin_action_console (object) or rule_engine.builtin_action_republish (object) or strings Default: [] A list of actions of the rule. | |
enable | boolean Default: true Enable or disable the rule |
description | string Default: "" The description of the rule |
metadata | object Rule metadata, do not change manually |
{- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1",
- "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "enable": true,
- "description": "Some description",
- "metadata": { }
}
{- "id": "293fb66f",
- "from": "t/#",
- "created_at": "2021-12-01T15:00:43.153+08:00",
- "last_modified_at": "2021-12-24T15:00:44.153+08:00",
- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1",
- "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "enable": true,
- "description": "Some description",
- "metadata": { }
}
Update rule engine configuration.
ignore_sys_message | boolean Default: true When set to 'true' (default), rule-engine will ignore messages published to $SYS topics. |
jq_function_default_timeout | string Default: "10s" Default timeout for the |
{- "ignore_sys_message": true,
- "jq_function_default_timeout": "32s"
}
{- "ignore_sys_message": true,
- "jq_function_default_timeout": "32s"
}
Upgrade a specified node to the target version with the installed package.
node required | string Default: "all" Example: emqx@127.0.0.1 The node to be upgraded |
{- "code": "UNEXPECTED_ERROR",
- "message": "string"
}
Upload a hot upgrade package (emqx_relup-vsn.tar.gz).
Note that only one package is alllowed to be installed at a time.
plugin | string <binary> |
{- "code": "UNEXPECTED_ERROR",
- "message": "string"
}
Get the hot upgrade status of all nodes
[- {
- "node": "emqx@127.0.0.1",
- "status": "in-progress",
- "role": "core",
- "live_connections": 100,
- "current_vsn": "5.8.0",
- "upgrade_history": [
- {
- "status": "finished",
- "started_at": "2024-07-15T13:48:02.648559+08:00",
- "result": "success",
- "upgrade_opts": {
- "deploy_inplace": false
}, - "target_vsn": "5.8.1",
- "from_vsn": "5.8.0",
- "finished_at": "2024-07-16T11:00:01.875627+08:00"
}
]
}
]
Get information of the installed hot upgrade package.
{- "name": "emqx_relup-5.8.2.tar.gz",
- "target_vsn": "5.8.2",
- "built_on_otp_release": "24",
- "applicable_vsns": [
- "5.8.0",
- "5.8.1"
], - "build_date": "2021-12-25",
- "change_logs": [
- "1. Fix a bug foo in the plugin.2. Add a new bar feature."
], - "md5_sum": "d41d8cd98f00b204e9800998ecf8427e"
}
Get the hot upgrade status of a specified node
node required | string Default: "all" Example: emqx@127.0.0.1 The node to be upgraded |
{- "node": "emqx@127.0.0.1",
- "status": "in-progress",
- "role": "core",
- "live_connections": 100,
- "current_vsn": "5.8.0",
- "upgrade_history": [
- {
- "status": "finished",
- "started_at": "2024-07-15T13:48:02.648559+08:00",
- "result": "success",
- "upgrade_opts": {
- "deploy_inplace": false
}, - "target_vsn": "5.8.1",
- "from_vsn": "5.8.0",
- "finished_at": "2024-07-16T11:00:01.875627+08:00"
}
]
}
Update the gateway basic configurations and running status.
Note: The Authentication and Listener configurations should be updated by other special APIs.
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
enable required | boolean Example: true Whether to enable this gateway |
{- "code": "NOT_FOUND",
- "message": "string"
}
This API returns an overview info for the specified or all gateways.
including current running status, number of connections, listener status, etc.
status | string Enum: "running" "stopped" "unloaded" Example: status=running Filter gateways by status. |
[- {
- "name": "coap",
- "status": "unloaded"
}, - {
- "name": "exproto",
- "status": "unloaded"
}, - {
- "name": "lwm2m",
- "status": "running",
- "started_at": "2021-12-08T14:41:26.202+08:00",
- "node_status": [
- {
- "node": "node@127.0.0.1",
- "status": "running",
- "max_connections": 1024000,
- "current_connections": 0
}
], - "listeners": [
- {
- "id": "lwm2m:udp:default",
- "name": "default",
- "running": true,
- "type": "udp"
}
], - "max_connections": 1024000,
- "created_at": "2021-12-08T14:41:26.171+08:00",
- "current_connections": 0
}, - {
- "name": "mqttsn",
- "status": "stopped",
- "node_status": [
- {
- "node": "node@127.0.0.1",
- "status": "running",
- "max_connections": 1024000,
- "current_connections": 0
}
], - "listeners": [
- {
- "id": "mqttsn:udp:default",
- "name": "default",
- "running": false,
- "type": "udp"
}
], - "max_connections": 1024000,
- "created_at": "2021-12-08T14:41:45.071+08:00",
- "stopped_at": "2021-12-08T14:56:35.576+08:00",
- "current_connections": 0
}, - {
- "name": "stomp",
- "status": "running",
- "started_at": "2021-12-08T14:42:15.274+08:00",
- "node_status": [
- {
- "node": "node@127.0.0.1",
- "status": "running",
- "max_connections": 1024000,
- "current_connections": 0
}
], - "listeners": [
- {
- "id": "stomp:tcp:default",
- "name": "default",
- "running": true,
- "type": "tcp"
}
], - "max_connections": 1024000,
- "created_at": "2021-12-08T14:42:15.272+08:00",
- "current_connections": 0
}
]
Get the gateway configurations
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
{- "name": "coap",
- "enable": true,
- "heartbeat": "30s",
- "listeners": [
- {
- "name": "default",
- "type": "udp",
- "bind": "5683",
- "max_conn_rate": 1000,
- "max_connections": 1024000
}
], - "idle_timeout": "30s",
- "mountpoint": "coap/",
- "enable_stats": true,
- "connection_required": false,
- "notify_type": "qos",
- "publish_qos": "coap",
- "subscribe_qos": "coap"
}
Update the gateway basic configurations and running status.
Note: The Authentication and Listener configurations should be updated by other special APIs.
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
object (gateway.stomp_frame) | |
mountpoint | string Default: "" When publishing or subscribing, prefix all topics with a mountpoint string. |
enable | boolean Default: true Whether to enable this gateway |
enable_stats | boolean Default: true Whether to enable client process statistic |
idle_timeout | string Default: "30s" The idle time of the client connection process. It has two purposes: |
object (gateway.clientinfo_override) |
{- "enable": true,
- "heartbeat": "30s",
- "idle_timeout": "30s",
- "mountpoint": "coap2/",
- "enable_stats": true,
- "connection_required": false,
- "notify_type": "qos",
- "publish_qos": "coap",
- "subscribe_qos": "coap"
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
get trace log file's metadata, such as size, last update time
name required | string Example: EMQX-TRACE-1 [a-zA-Z0-9-_] |
[- {
- "node": "emqx@127.0.0.1",
- "size": 0,
- "mtime": 0
}
]
Download trace log by name
name required | string Example: EMQX-TRACE-1 [a-zA-Z0-9-_] |
node | string Example: node=emqx@127.0.0.1 Node name |
{- "code": "NOT_FOUND",
- "message": "string"
}
[- {
- "name": "EMQX-TRACE-1",
- "type": "clientid",
- "topic": "/dev/#",
- "clientid": "dev-001",
- "ip_address": "127.0.0.1",
- "ruleid": "my_rule",
- "status": "running",
- "payload_encode": "hex",
- "start_at": "2021-11-04T18:17:38+08:00",
- "end_at": "2021-11-05T18:17:38+08:00",
- "log_size": [
- {
- "node": "emqx@127.0.0.1",
- "size": 1024
}
], - "formatter": "text"
}
]
Create new trace
name required | string Unique name of the trace. Only ASCII letters in a-z, A-Z, 0-9 and underscore '_' are allowed. |
type required | string Enum: "clientid" "topic" "ip_address" "ruleid" Filter type |
topic | string Specify the topic or topic filter if the trace 'type' is 'topic'. |
clientid | string Specify the MQTT clientid if the trace 'type' is 'clientid'. |
ip_address | string Specify the client's IP address if the trace type is 'ip_address'. |
ruleid | string |
payload_encode | string Default: "text" Enum: "hex" "text" "hidden" Determine the format of the payload format in the trace file. |
integer or string rfc3339 timestamp or epoch second | |
integer or string rfc3339 timestamp or epoch second | |
string or string The formatter that will be used to format the trace log entries. Set this to text to format the log entries as plain text (default). Set it to json to format each log entry as a JSON object. |
{- "name": "EMQX-TRACE-1",
- "type": "clientid",
- "topic": "/dev/#",
- "clientid": "dev-001",
- "ip_address": "127.0.0.1",
- "ruleid": "my_rule",
- "payload_encode": "hex",
- "start_at": "2021-11-04T18:17:38+08:00",
- "end_at": "2021-11-05T18:17:38+08:00",
- "formatter": "text"
}
{- "name": "EMQX-TRACE-1",
- "type": "clientid",
- "topic": "/dev/#",
- "clientid": "dev-001",
- "ip_address": "127.0.0.1",
- "ruleid": "my_rule",
- "status": "running",
- "payload_encode": "hex",
- "start_at": "2021-11-04T18:17:38+08:00",
- "end_at": "2021-11-05T18:17:38+08:00",
- "log_size": [
- {
- "node": "emqx@127.0.0.1",
- "size": 1024
}
], - "formatter": "text"
}
view trace log
name required | string Example: EMQX-TRACE-1 [a-zA-Z0-9-_] |
bytes | integer [ 0 .. 2147483647 ] Default: 1000 Maximum number of bytes to send in response |
position | integer Default: 0 Offset from the current trace position. |
node | string Example: node=emqx@127.0.0.1 Node name |
{- "items": "TEXT-LOG-ITEMS",
- "meta": {
- "bytes": 1000,
- "position": 0
}
}
Stop trace by name
name required | string Example: EMQX-TRACE-1 [a-zA-Z0-9-_] |
{- "name": "EMQX-TRACE-1",
- "type": "clientid",
- "topic": "/dev/#",
- "clientid": "dev-001",
- "ip_address": "127.0.0.1",
- "ruleid": "my_rule",
- "status": "running",
- "payload_encode": "hex",
- "start_at": "2021-11-04T18:17:38+08:00",
- "end_at": "2021-11-05T18:17:38+08:00",
- "log_size": [
- {
- "node": "emqx@127.0.0.1",
- "size": 1024
}
], - "formatter": "text"
}
Create dashboard user
username | string <= 100 characters Dashboard Username |
password | string <= 100 characters Dashboard Password |
description | string Dashboard User Description |
{- "username": "admin",
- "password": "public",
- "description": "administrator"
}
{- "username": "admin",
- "description": "administrator",
- "backend": "local"
}
Get Dashboard Auth Token.
username | string <= 100 characters Dashboard Username |
password | string <= 100 characters Dashboard Password |
{- "username": "admin",
- "password": "public"
}
{- "token": "string",
- "version": "5.0.0",
- "license": {
- "edition": "opensource"
}
}
Update dashboard user description
username required | string Example: admin Dashboard Username |
description | string Dashboard User Description |
{- "description": "administrator"
}
{- "username": "admin",
- "description": "administrator",
- "backend": "local"
}
Change dashboard user password
username required | string Example: admin Dashboard Username |
old_pwd | string Old password |
new_pwd | string New password |
{- "old_pwd": "string",
- "new_pwd": "string"
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
Dashboard user logout.
This endpoint is only for the Dashboard, not the API Key
.
The token from the /login
endpoint must be a bearer authorization in the headers.
username | string <= 100 characters Dashboard Username |
{- "username": "admin"
}
{- "code": "BAD_USERNAME_OR_PWD",
- "message": "string"
}
List all running node's listeners for the specified type.
type | string Enum: "tcp" "ssl" "ws" "wss" "quic" Example: type=tcp Listener type |
[- {
- "id": "tcp:demo",
- "name": "demo",
- "status": {
- "running": true,
- "max_connections": 2048000,
- "current_connections": 201
}, - "type": "tcp",
- "bind": "0.0.0.0:1884",
- "number": 2,
- "enable": true,
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 100
}
}, - {
- "node": "emqx@127.0.0.1",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 101
}
}
], - "acceptors": 16
}, - {
- "id": "tcp:default",
- "name": "default",
- "status": {
- "running": true,
- "max_connections": "infinity",
- "current_connections": 501
}, - "type": "tcp",
- "bind": "0.0.0.0:1883",
- "number": 2,
- "enable": true,
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "running": true,
- "max_connections": "infinity",
- "current_connections": 200
}
}, - {
- "node": "emqx@127.0.0.1",
- "status": {
- "running": true,
- "max_connections": "infinity",
- "current_connections": 301
}
}
], - "acceptors": 32
}
]
Create the specified listener on all nodes.
type required | string Value: "quic" Listener type |
running | boolean Listener status |
name required | string Listener name |
current_connections | integer >= 0 Current connections |
ciphers | Array of strings Default: ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256","TLS_CHACHA20_POLY1305_SHA256"] This config holds TLS cipher suite names separated by comma, |
object (emqx.listener_quic_ssl_opts) | |
enable | boolean Default: true Enable listener. |
bind required | string Default: 14567 IP address and port for the listening socket. |
acceptors | integer >= 1 Default: 16 The size of the listener's receiving pool. |
integer or string Default: "infinity" The maximum number of concurrent connections allowed by the listener. | |
mountpoint | string Default: ""
|
zone | string Default: "default" The configuration zone to which the listener belongs. |
enable_authn | string Default: true Enum: true false "quick_deny_anonymous" Set |
max_conn_rate | string Default: "infinity" Used to limit the rate at which the current listener accepts connections. |
messages_rate | string Used to limit the number of messages a single client can send to EMQX per second. |
bytes_rate | string Used to limit the number of bytes a single client can send to EMQX per second. |
{- "name": "demo",
- "running": true,
- "type": "tcp",
- "bind": "0.0.0.0:1884",
- "tcp_options": {
- "buffer": "4KB",
- "high_watermark": "1MB",
- "nodelay": false,
- "reuseaddr": true,
- "send_timeout": "15s",
- "send_timeout_close": true,
- "backlog": 1024,
- "active_n": 100
}, - "access_rules": [
- "allow all"
], - "max_connections": 204800,
- "proxy_protocol_timeout": "3s",
- "acceptors": 16,
- "proxy_protocol": false,
- "zone": "default",
- "mountpoint": "/",
- "current_connections": 10240
}
{- "id": "tcp:demo",
- "running": true,
- "type": "tcp",
- "bind": "0.0.0.0:1884",
- "tcp_options": {
- "buffer": "4KB",
- "high_watermark": "1MB",
- "nodelay": false,
- "reuseaddr": true,
- "send_timeout": "15s",
- "send_timeout_close": true,
- "backlog": 1024,
- "active_n": 100
}, - "access_rules": [
- "allow all"
], - "max_connections": 204800,
- "proxy_protocol_timeout": "3s",
- "acceptors": 16,
- "proxy_protocol": false,
- "zone": "default",
- "mountpoint": "/",
- "current_connections": 10240
}
List all running node's listeners for the specified id.
id required | string Example: tcp:demo Listener id |
{- "id": "tcp:demo",
- "running": true,
- "type": "tcp",
- "bind": "0.0.0.0:1884",
- "tcp_options": {
- "buffer": "4KB",
- "high_watermark": "1MB",
- "nodelay": false,
- "reuseaddr": true,
- "send_timeout": "15s",
- "send_timeout_close": true,
- "backlog": 1024,
- "active_n": 100
}, - "access_rules": [
- "allow all"
], - "max_connections": 204800,
- "proxy_protocol_timeout": "3s",
- "acceptors": 16,
- "proxy_protocol": false,
- "zone": "default",
- "mountpoint": "/",
- "current_connections": 10240
}
Update the specified listener on all nodes.
id required | string Example: tcp:demo Listener id |
type required | string Value: "wss" Listener type |
running | boolean Listener status |
id required | string Listener id |
current_connections | integer >= 0 Current connections |
bind | string Default: 8084 IP address and port for the listening socket. |
enable | boolean Default: true Enable listener. |
acceptors | integer >= 1 Default: 16 The size of the listener's receiving pool. |
integer or string Default: "infinity" The maximum number of concurrent connections allowed by the listener. | |
mountpoint | string Default: ""
|
zone | string Default: "default" The configuration zone to which the listener belongs. |
enable_authn | string Default: true Enum: true false "quick_deny_anonymous" Set |
max_conn_rate | string Default: "infinity" Used to limit the rate at which the current listener accepts connections. |
messages_rate | string Used to limit the number of messages a single client can send to EMQX per second. |
bytes_rate | string Used to limit the number of bytes a single client can send to EMQX per second. |
access_rules | Array of strings Default: ["allow all"] An access rule list consisting of string rules to restrict or allow access from some addresses. The rules that appear earlier in the list are matched first. |
proxy_protocol | boolean Default: false Enable the Proxy Protocol V1/2 if the EMQX cluster is deployed behind HAProxy or Nginx. |
proxy_protocol_timeout | string Default: "3s" If a reverse proxy is deployed for EMQX, and the PROXY protocol is enabled at the proxy to pass the client's real IP, this option needs to be turned on so that EMQX can extract the client's real IP from the PROXY protocol header. |
object (emqx.tcp_opts) | |
object (emqx.listener_wss_opts) | |
object (emqx.ws_opts) |
{- "id": "tcp:demo",
- "running": true,
- "type": "tcp",
- "bind": "0.0.0.0:1884",
- "tcp_options": {
- "buffer": "4KB",
- "high_watermark": "1MB",
- "nodelay": false,
- "reuseaddr": true,
- "send_timeout": "15s",
- "send_timeout_close": true,
- "backlog": 1024,
- "active_n": 100
}, - "access_rules": [
- "allow all"
], - "max_connections": 204800,
- "proxy_protocol_timeout": "3s",
- "acceptors": 16,
- "proxy_protocol": false,
- "zone": "default",
- "mountpoint": "/",
- "current_connections": 10240
}
{- "id": "tcp:demo",
- "running": true,
- "type": "tcp",
- "bind": "0.0.0.0:1884",
- "tcp_options": {
- "buffer": "4KB",
- "high_watermark": "1MB",
- "nodelay": false,
- "reuseaddr": true,
- "send_timeout": "15s",
- "send_timeout_close": true,
- "backlog": 1024,
- "active_n": 100
}, - "access_rules": [
- "allow all"
], - "max_connections": 204800,
- "proxy_protocol_timeout": "3s",
- "acceptors": 16,
- "proxy_protocol": false,
- "zone": "default",
- "mountpoint": "/",
- "current_connections": 10240
}
List all running node's listeners live status. group by listener type
[- {
- "status": {
- "running": true,
- "max_connections": 2048000,
- "current_connections": 21
}, - "type": "tcp",
- "enable": false,
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 11
}
}, - {
- "node": "emqx@127.0.0.1",
- "status": {
- "running": true,
- "max_connections": 1024000,
- "current_connections": 10
}
}
], - "ids": [
- "tcp:demo"
]
}, - {
- "status": {
- "running": true,
- "max_connections": "infinity",
- "current_connections": 71
}, - "type": "ssl",
- "enable": false,
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "running": true,
- "max_connections": "infinity",
- "current_connections": 31
}
}, - {
- "node": "emqx@127.0.0.1",
- "status": {
- "running": true,
- "max_connections": "infinity",
- "current_connections": 40
}
}
], - "ids": [
- "ssl:default"
]
}
]
Gets the configuration of the specified gateway authenticator.
Returns 404 when gateway or authentication is not enabled.
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
{- "mechanism": "jwt",
- "secret": "mysecret",
- "algorithm": "hmac-based",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
Update the configuration of the specified gateway authenticator, or disable the authenticator.
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
mechanism required | string Value: "password_based" Authentication mechanism. |
backend required | string Value: "ldap" Backend type. |
query_timeout | string Default: "5s" Timeout for the LDAP query. |
enable | boolean Default: true Set to |
server required | string The IPv4 or IPv6 address or the hostname to connect to. |
pool_size | integer >= 1 Default: 8 Size of the connection pool towards the bridge target service. |
username required | string The username associated with the bridge in the external database used for authentication or identification purposes. |
password | string <password> The password associated with the bridge, used for authentication with the external database. |
base_dn required | string The name of the base object entry (or possibly the root) relative to |
filter | string Default: "(objectClass=mqttUser)" The filter that defines the conditions that must be fulfilled in order |
request_timeout | string Default: "10s" Sets the maximum time in milliseconds that is used for each individual request. |
object (ldap.ssl) | |
password_attribute | string Default: "userPassword" Indicates which attribute is used to represent the user's password. |
is_superuser_attribute | string Default: "isSuperuser" Indicates which attribute is used to represent whether the user is a superuser. |
{- "mechanism": "jwt",
- "secret": "mysecret",
- "algorithm": "hmac-based",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
{- "mechanism": "jwt",
- "secret": "mysecret",
- "algorithm": "hmac-based",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
Delete the authenticator of the specified gateway.
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Enables the authenticator for client authentication for the specified gateway.
When the authenticator is not configured or turned off, all client connections are assumed to be allowed.
Note: Only one authenticator is allowed to be enabled at a time in the gateway, rather than allowing multiple authenticators to be configured to form an authentication chain as in MQTT.
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
mechanism required | string Value: "password_based" Authentication mechanism. |
backend required | string Value: "ldap" Backend type. |
query_timeout | string Default: "5s" Timeout for the LDAP query. |
enable | boolean Default: true Set to |
server required | string The IPv4 or IPv6 address or the hostname to connect to. |
pool_size | integer >= 1 Default: 8 Size of the connection pool towards the bridge target service. |
username required | string The username associated with the bridge in the external database used for authentication or identification purposes. |
password | string <password> The password associated with the bridge, used for authentication with the external database. |
base_dn required | string The name of the base object entry (or possibly the root) relative to |
filter | string Default: "(objectClass=mqttUser)" The filter that defines the conditions that must be fulfilled in order |
request_timeout | string Default: "10s" Sets the maximum time in milliseconds that is used for each individual request. |
object (ldap.ssl) | |
password_attribute | string Default: "userPassword" Indicates which attribute is used to represent the user's password. |
is_superuser_attribute | string Default: "isSuperuser" Indicates which attribute is used to represent whether the user is a superuser. |
{- "mechanism": "jwt",
- "secret": "mysecret",
- "algorithm": "hmac-based",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
{- "mechanism": "jwt",
- "secret": "mysecret",
- "algorithm": "hmac-based",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
Import users into the gateway authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
filename | string <binary> |
{- "total": 0,
- "success": 0,
- "override": 0,
- "skipped": 0,
- "failed": 0
}
Get the users for the authenticator (only supported by built_in_database
).
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page(max 10000) |
like_user_id | string Example: like_user_id=test_ Fuzzy search using user ID (username or clientid), only supports search by substring. |
is_superuser | boolean Is superuser |
{- "data": [
- {
- "user_id": "user1"
}, - {
- "is_superuser": true,
- "user_id": "user2"
}
], - "meta": {
- "count": 300,
- "limit": 20,
- "page": 0
}
}
Add user for the authenticator (only supports built_in_database).
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
user_id required | string |
password required | string |
is_superuser | boolean Default: false |
{- "password": "******",
- "user_id": "user1"
}
{- "regular_user": {
- "value": {
- "user_id": "user1"
}, - "summary": "Regular user"
}, - "super_user": {
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}, - "summary": "Superuser"
}
}
Get user info from the gateway authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
uid required | string Example: test_username User ID |
{- "regular_user": {
- "value": {
- "user_id": "user1"
}, - "summary": "Regular user"
}, - "super_user": {
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}, - "summary": "Superuser"
}
}
Update the user info for the gateway authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
uid required | string Example: test_username User ID |
password required | string |
is_superuser | boolean Default: false |
{- "password": "******"
}
{- "regular_user": {
- "value": {
- "user_id": "user1"
}, - "summary": "Regular user"
}, - "super_user": {
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}, - "summary": "Superuser"
}
}
Delete the user for the gateway authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
uid required | string Example: test_username User ID |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Import users into the gateway authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "lwm2m" "mqttsn" "stomp" Example: stomp Gateway Name |
id required | string Example: stomp:tcp:def Listener ID |
filename | string <binary> |
{- "total": 0,
- "success": 0,
- "override": 0,
- "skipped": 0,
- "failed": 0
}
Send a CoAP request message to the client
clientid required | string |
token | string Message token, can be empty |
method | string Enum: "get" "put" "post" "delete" Request method type |
timeout | string Timespan for response |
content_type | string Enum: "text/plain" "application/json" "application/octet-stream" Payload type |
payload | string The content of the payload |
{- "token": "string",
- "method": "get",
- "timeout": "32s",
- "content_type": "text/plain",
- "payload": "string"
}
{- "id": 0,
- "token": "string",
- "method": "string",
- "payload": "string"
}
List retained messages.
topic | string Topic filter, supports wildcards, omit this to match all messages. |
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page(max 10000) |
{- "data": [
- {
- "msgid": "string",
- "topic": "string",
- "qos": 0,
- "publish_at": "string",
- "from_clientid": "string",
- "from_username": "string"
}
], - "meta": {
- "page": 1,
- "limit": 50,
- "count": 0,
- "hasnext": true
}
}
Lookup a message by a topic without wildcards.
topic required | string Topic. |
{- "payload": "string",
- "msgid": "string",
- "topic": "string",
- "qos": 0,
- "publish_at": "string",
- "from_clientid": "string",
- "from_username": "string"
}
{- "enable": true,
- "msg_expiry_interval": "32s",
- "msg_expiry_interval_override": "disabled",
- "allow_never_expire": true,
- "msg_clear_interval": "32s",
- "max_payload_size": "32MB",
- "stop_publish_clear_msg": false,
- "delivery_rate": "1000/s",
- "max_publish_rate": "1000/s",
- "backend": {
- "type": "built_in_database",
- "storage_type": "ram",
- "max_retained_messages": 0,
- "index_specs": [
- [
- 2,
- 4
], - [
- 1,
- 3
]
], - "enable": true
}
}
Update retainer config.
enable | boolean Default: true Enable retainer feature |
msg_expiry_interval | string Default: "0s" Expired retained messages will not be delivered again, and a setting of 0 means that retained messages will never expire. |
string or string Default: "disabled" If set, this value will take precedence over any | |
allow_never_expire | boolean Default: true If true, retained messages set to never expire (i.e., whose |
msg_clear_interval | string Default: "0s" The time interval for checking and clearing expired retained messages. This can prevent expired retained messages from being stored for a long time. |
max_payload_size | string Default: "1MB" The maximum size of retained messages allowed to be stored. EMQX will refuse to store retained messages larger than this size and output an Error log with the keyword 'retain_failed_for_payload_size_exceeded_limit'. |
stop_publish_clear_msg | boolean Default: false When the retained flag of the |
delivery_rate | string Default: "1000/s" The maximum rate of delivering retained messages |
max_publish_rate | string Default: "1000/s" The maximum rate of publishing retained messages. Messages that are published over the limit are delivered but not stored as retained. |
object (retainer.mnesia_config) |
{- "enable": true,
- "msg_expiry_interval": "32s",
- "msg_expiry_interval_override": "disabled",
- "allow_never_expire": true,
- "msg_clear_interval": "32s",
- "max_payload_size": "32MB",
- "stop_publish_clear_msg": false,
- "delivery_rate": "1000/s",
- "max_publish_rate": "1000/s",
- "backend": {
- "type": "built_in_database",
- "storage_type": "ram",
- "max_retained_messages": 0,
- "index_specs": [
- [
- 2,
- 4
], - [
- 1,
- 3
]
], - "enable": true
}
}
{- "enable": true,
- "msg_expiry_interval": "32s",
- "msg_expiry_interval_override": "disabled",
- "allow_never_expire": true,
- "msg_clear_interval": "32s",
- "max_payload_size": "32MB",
- "stop_publish_clear_msg": false,
- "delivery_rate": "1000/s",
- "max_publish_rate": "1000/s",
- "backend": {
- "type": "built_in_database",
- "storage_type": "ram",
- "max_retained_messages": 0,
- "index_specs": [
- [
- 2,
- 4
], - [
- 1,
- 3
]
], - "enable": true
}
}
List currently activated alarms or historical alarms, determined by query parameters.
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page(max 10000) |
activated | boolean It is used to specify the alarm type of the query. |
{- "data": [
- {
- "node": "emqx@127.0.0.1",
- "name": "high_system_memory_usage",
- "message": "System memory usage is higher than 70%",
- "details": {
- "high_watermark": 70
}, - "duration": 297056,
- "activate_at": "2021-10-25T11:52:52.548+08:00",
- "deactivate_at": "2021-10-31T10:52:52.548+08:00"
}
], - "meta": {
- "page": 1,
- "limit": 50,
- "count": 0,
- "hasnext": true
}
}
List subscriptions
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page(max 10000) |
node | string Example: node=emqx@127.0.0.1 Node name |
clientid | string Client ID |
qos | integer [ 0 .. 2 ] Example: qos=0 QoS |
topic | string Topic, url encoding |
match_topic | string Match topic string, url encoding |
share_group | string Shared subscription group name |
durable | boolean Filter subscriptions by durability |
[- {
- "node": "emqx@127.0.0.1",
- "topic": "testtopic/1",
- "clientid": "emqx_clientid_xx128cdhfc",
- "qos": 0,
- "nl": 0,
- "rap": 0,
- "rh": 0,
- "durable": false
}
]
API Error Codes
code required | string Enum: "BAD_USERNAME_OR_PWD" "BAD_API_KEY_OR_SECRET" "BAD_REQUEST" "NOT_MATCH" "ALREADY_EXISTS" "BAD_CONFIG_SCHEMA" "BAD_LISTENER_ID" "BAD_NODE_NAME" "BAD_RPC" "BAD_TOPIC" "EXCEED_LIMIT" "INVALID_PARAMETER" "CONFLICT" "NO_DEFAULT_VALUE" "DEPENDENCY_EXISTS" "MESSAGE_ID_SCHEMA_ERROR" "INVALID_ID" "MESSAGE_ID_NOT_FOUND" "NOT_FOUND" "CLIENTID_NOT_FOUND" "CLIENT_NOT_FOUND" "RESOURCE_NOT_FOUND" "TOPIC_NOT_FOUND" "USER_NOT_FOUND" "INTERNAL_ERROR" "SERVICE_UNAVAILABLE" "SOURCE_ERROR" "UPDATE_FAILED" "REST_FAILED" "CLIENT_NOT_RESPONSE" "UNSUPPORTED_MEDIA_TYPE" Example: BAD_USERNAME_OR_PWD API Error Codes |
{- "code": "string",
- "description": "string"
}
Update slow subs settings
enable | boolean Default: false Enable Slow Subscriptions |
threshold | string Default: "500ms" The Client ID and topic of the consumer whose message latency is greater than this threshold will be recorded in the slow subscription list. |
expire_interval | string Default: "300s" The expiration time of the slow subscription record, if the record is not updated within the expiration time, then the record will be deleted. |
top_k_num | integer >= 1 Default: 10 The maximum number of slow-subscription records, up to a maximum of 1000. |
stats_type | string Default: "whole" Enum: "whole" "internal" "response" Message latency calculation method: |
{- "enable": false,
- "threshold": "32s",
- "expire_interval": "32s",
- "top_k_num": 10,
- "stats_type": "whole"
}
{- "enable": false,
- "threshold": "32s",
- "expire_interval": "32s",
- "top_k_num": 10,
- "stats_type": "whole"
}
View slow topics statistics record data
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page(max 10000) |
{- "data": [
- {
- "clientid": "string",
- "node": "string",
- "topic": "string",
- "timespan": 0,
- "last_update_time": 0
}
]
}
Return api_key list. This API can only be requested using a bearer token.
{- "name": "EMQX-API-KEY-1",
- "api_key": "a4697a5c75a769f6",
- "expired_at": "2021-12-05T02:01:34.186Z",
- "created_at": "2021-12-01T00:00:00.000Z",
- "desc": "Note",
- "enable": true,
- "expired": true
}
Create new api_key. This API can only be requested using a bearer token.
name | string Unique and format by [a-zA-Z0-9-_] |
(integer or string) or string Default: "infinity" No longer valid datetime | |
desc | string |
enable | boolean Enable/Disable |
expired | boolean Expired |
{- "name": "EMQX-API-KEY-1",
- "expired_at": "2021-12-05T02:01:34.186Z",
- "desc": "Note",
- "enable": true,
- "expired": true
}
{- "name": "EMQX-API-KEY-1",
- "api_key": "a4697a5c75a769f6",
- "api_secret": "MzAyMjk3ODMwMDk0NjIzOTUxNjcwNzQ0NzQ3MTE2NDYyMDI",
- "expired_at": "2021-12-05T02:01:34.186Z",
- "created_at": "2021-12-01T00:00:00.000Z",
- "desc": "Note",
- "enable": true,
- "expired": true
}
Return the specific api_key. This API can only be requested using a bearer token.
name required | string Example: EMQX-API-KEY-1 ^[A-Za-z]+[A-Za-z0-9-_]*$ |
{- "name": "EMQX-API-KEY-1",
- "api_key": "a4697a5c75a769f6",
- "expired_at": "2021-12-05T02:01:34.186Z",
- "created_at": "2021-12-01T00:00:00.000Z",
- "desc": "Note",
- "enable": true,
- "expired": true
}
Update the specific api_key. This API can only be requested using a bearer token.
name required | string Example: EMQX-API-KEY-1 ^[A-Za-z]+[A-Za-z0-9-_]*$ |
(integer or string) or string Default: "infinity" No longer valid datetime | |
desc | string |
enable | boolean Enable/Disable |
expired | boolean Expired |
{- "expired_at": "2021-12-05T02:01:34.186Z",
- "desc": "Note",
- "enable": true,
- "expired": true
}
{- "name": "EMQX-API-KEY-1",
- "api_key": "a4697a5c75a769f6",
- "expired_at": "2021-12-05T02:01:34.186Z",
- "created_at": "2021-12-01T00:00:00.000Z",
- "desc": "Note",
- "enable": true,
- "expired": true
}
Delete the specific api_key. This API can only be requested using a bearer token.
name required | string Example: EMQX-API-KEY-1 ^[A-Za-z]+[A-Za-z0-9-_]*$ |
{- "code": "NOT_FOUND",
- "message": "string"
}
List all currently banned client IDs, usernames and IP addresses.
Filters are supported. Since filters are mutually exclusive, only one filter is allowed in a query.
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page(max 10000) |
clientid | string Query the banning rules with an exact client ID. |
username | string Query the banning rules with an exact username. |
peerhost | string Example: peerhost=127.0.0.1 Query the banning rules with an exact IP address. |
like_clientid | string Fuzzy query banning rules with a regular expression for client ID. |
like_username | string Fuzzy query banning rules with a regular expression for username. |
like_peerhost | string Example: like_peerhost=127.0.0.1 Fuzzy query banning rules with a regular expression for IP address. |
like_peerhost_net | string Example: like_peerhost_net=192.1.0.0/16 Fuzzy query banning rules with a regular expression for CIDR. |
{- "data": [
- {
- "as": "username",
- "who": "Banned name",
- "by": "mgmt_api",
- "reason": "Too many requests",
- "at": "2021-10-25T21:48:47+08:00",
- "until": "2021-10-25T21:53:47+08:00"
}
], - "meta": {
- "page": 1,
- "limit": 50,
- "count": 0,
- "hasnext": true
}
}
Add a client ID, username or IP address to the blacklist.
as required | string Enum: "clientid" "username" "peerhost" "clientid_re" "username_re" "peerhost_net" Ban method, which can be exact client ID, client ID regular expression, exact username, username regular expression, |
who required | string Ban object, specific client ID, username or IP address. |
by | string Initiator of the ban. |
reason | string Ban reason, record the reason why the current object was banned. |
integer or string The start time of the ban, the format is rfc3339, the default is the time when the operation was initiated. | |
(integer or string) or string Default: "infinity" The end time of the ban, the format is rfc3339, the default is the time when the operation was initiated + 1 year. |
{- "as": "username",
- "who": "Banned name",
- "by": "mgmt_api",
- "reason": "Too many requests",
- "at": "2021-10-25T21:48:47+08:00",
- "until": "2021-10-25T21:53:47+08:00"
}
{- "data": [
- {
- "as": "username",
- "who": "Banned name",
- "by": "mgmt_api",
- "reason": "Too many requests",
- "at": "2021-10-25T21:48:47+08:00",
- "until": "2021-10-25T21:53:47+08:00"
}
]
}
Remove a client ID, username or IP address from the blacklist.
as required | string Enum: "clientid" "username" "peerhost" "clientid_re" "username_re" "peerhost_net" Example: username Ban method, which can be exact client ID, client ID regular expression, exact username, username regular expression, |
who required | string Example: Badass Ban object, specific client ID, username or IP address. |
{- "code": "NOT_FOUND",
- "message": "string"
}