Skip to content

Deployment Management API ​

This page describes how to use the API to retrieve a deployment list, query deployment status, start and stop deployments, and create new deployments.

List Deployments ​

URI ​

GET /deployments

TIP

This method can only be requested 60 times within 60 minutes.

Request Message ​

None

Response Messages ​

  • 200:
NameTypeDescription
connectionsNumberThe number of connections for the deployment.
tpsNumberThe number of transactions per second (TPS) for the deployment.
createAtStringThe creation time of the deployment.
deploymentIDStringThe unique deployment ID.
deploymentNameStringThe name of the deployment.
deploymentTypeStringThe type of deployment: "serverless" for Serverless editions, "dedicated" for Dedicated editions and "dedicatedFlex" for Dedicated Flex editions
platformStringThe cloud service provider for the deployment.
projectNameStringThe name of the project associated with the deployment.
regionStringThe region where the deployment is located.
statusStringThe current status of the deployment: "running", "starting", or "stopped".
versionStringThe version of the deployment.
  • 401: API Key authentication failed.
  • 403: API Key lacks permission to access the requested resource.
  • 429: Request limit exceeded.

Request Example ​

bash
curl -u key:secret -X GET {api}/deployments

Response Example ​

json
[
    {
        "connections": 1000,
        "tps": 1000,
        "createAt": "2024-11-21 02:51",
        "deploymentID": "mdfba81f",
        "deploymentName": "deployment-mdfba81f",
        "deploymentType": "serverless",
        "platform": "AWS",
        "projectName": "default",
        "region": "N. Virginia (us-east-1)",
        "status": "stopped",
        "version": "v5"
    },
    {
        "connections": 1000,
        "tps": 1000,
        "createAt": "2025-04-17 08:36",
        "deploymentID": "b1f77113",
        "deploymentName": "deployment-b1f77113",
        "deploymentType": "dedicatedFlex",
        "platform": "AWS",
        "projectName": "test",
        "region": "N. Virginia (us-east-1)",
        "status": "running",
        "version": "v5"
    }
]

View Status of a Specific Deployment ​

URI ​

GET /deployments/{deployment_id}

TIP

This method can only be requested 60 times within 60 minutes. {deployment_id} refers to the deployment ID, not the deployment name.

Request Message ​

None

Response Messages ​

  • 200:
NameTypeDescription
connectionsNumberThe number of connections for the deployment.
tpsNumberhe number of transactions per second (TPS) for the deployment.
createAtStringThe creation time of the deployment.
deploymentIDStringThe unique deployment ID.
deploymentNameStringThe name of the deployment.
deploymentTypeStringThe type of deployment, "dedicated" for dedicated versions and "dedicatedFlex" for dedicated flex versions
platformStringThe cloud service provider for the deployment.
regionStringThe region where the deployment is located.
statusStringThe current status of the deployment: "running", "starting", or "stopped".

401: API Key authentication failed.

403: API Key lacks permission to access the requested resource.

404: Deployment not found.

429: Request limit exceeded.

Request Example ​

bash
curl -u key:secret -X GET {api}/deployments/w41b11c0

Response Example ​

json
{
    "connections": 1000,
    "tps": 1000,
    "createAt": "2024-07-22 05:32",
    "deploymentID": "w41b11c0",
    "deploymentName": "deployment-w41b11c0",
    "deploymentType": "dedicated",
    "platform": "AWS",
    "region": "N. Virginia (us-east-1)",
    "status": "running"
}

Stop Deployment ​

URI ​

POST /deployments/{deployment_id}/stop

TIP

This method can only be requested 5 times within 60 minutes. {deployment_id} refers to the deployment ID, not the deployment name. This action is only available for dedicated deployments.

Request Message ​

None

Response Messages ​

  • 201:
NameTypeDescription
deploymentIDStringThe unique deployment ID.
deploymentNameStringThe name of the deployment.
operationStringThe type of operation: "stopping" indicates a stop operation.
  • 401: API Key authentication failed.
  • 403: API Key lacks permission to access the requested resource.
  • 404: Deployment not found.
  • 422: Invalid request parameters.
  • 429: Request limit exceeded.

Request Example ​

bash
curl -u key:secret -X POST {api}/deployments/w41b11c0/stop

Response Example ​

json
{
    "deploymentID": "w41b11c0",
    "deploymentName": "deployment-w41b11c0",
    "operation": "stopping"
}

Start Deployment ​

URI ​

POST /deployments/{deployment_id}/start

TIP

This method can only be requested 5 times within 60 minutes. {deployment_id} refers to the deployment ID, not the deployment name. This action is only available for dedicated deployments.

Request Message ​

None

Response Messages ​

  • 201:
NameTypeDescription
deploymentIDStringThe unique deployment ID.
deploymentNameStringThe name of the deployment.
operationStringThe type of operation: "starting" indicates a start operation.
  • 401: API Key authentication failed.
  • 403: API Key lacks permission to access the requested resource.
  • 404: Deployment not found.
  • 422: Invalid request parameters.
  • 429: Request limit exceeded.

Request Example ​

bash
curl -u key:secret -X POST {api}/deployments/w41b11c0/start

Response Example ​

json
{
    "deploymentID": "w41b11c0",
    "deploymentName": "deployment-w41b11c0",
    "operation": "starting"
}

Create Deployment ​

URI ​

POST /deployments

TIP

This method can only be requested once within 60 minutes. The deployment will be created in the default project and billed on an hourly basis. Currently, EMQX v5 and v6 deployments are supported.

Request Message ​

NameTypeRequiredDescription
platformStringYesThe cloud platform where the deployment is hosted.
regionStringYesThe region where the deployment will be created.
connectionsNumberYesThe number of connections for the deployment. Serverless deployments support 1,000 connections, while dedicated deployments support between 1,000 and 10,000 connections.
tpsNumberYesThe number of transactions per second (TPS) for the deployment.
deploymentTypeStringYesThe deployment plan. Must be either "serverless" or "dedicatedFlex".
deploymentNameStringNoThe name of the deployment. If omitted, the system generates a default name.
deploymentVersionStringYesThe deployment version. Supported values are "v5" and "v6".
projectIDStringYesThe project ID. Can be obtained via the project list.
freeTrialBooleanYesWhether the deployment is a free trial. Must be set to false.

For supported cloud providers and regions by plan, see Cloud Providers and Regions.

Different deployment editions support different connection numbers and TPS specifications.

Response Messages ​

  • 201:
NameTypeDescription
createAtStringThe creation time of the deployment.
deploymentIDStringThe unique deployment ID.
deploymentNameStringThe name of the deployment.
deploymentTypeStringThe type of deployment (either "dedicatedFlex" or "serverless").
platformStringThe cloud platform identifier.
portsObjectPort configurations for different protocols (MQTT, WebSocket, etc.).
projectIDStringThe ID of the project to which this deployment belongs.
regionStringThe cloud region identifier.
regionLabelStringThe human-readable name of the region.
specObjectDeployment specifications, including connections, version, etc.
statusStringThe current status of the deployment (running, stopped, pending).
subscriptionBooleanWhether this deployment is subscription-based.
userIDStringThe ID of the user who owns this deployment.
  • 400: Bad Request
  • 401: API Key authentication failed.
  • 403: API Key lacks permission to access the requested resource.
  • 422: Invalid request parameters.

Request Example ​

bash
curl -u key:secret -X POST {api}/deployments \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "aws",
    "region": "us-east-1",
    "connections": 1000,
    "tps": 1000,
    "deploymentType": "dedicatedFlex",
    "deploymentVersion": "v5",
    "projectID": "00000001",
    "freeTrial": false
  }'

Response Example ​

json
{
    "createAt": "2025-04-17 15:30",
    "deploymentID": "i9d0961f",
    "deploymentName": "deployment-i9d0961f",
    "deploymentType": "dedicatedFlex",
    "platform": "aws",
    "ports": {
        "1883": {
            "status": "running",
            "protocol": "mqtt"
        },
        "8083": {
            "status": "running",
            "protocol": "ws"
        },
        "8084": {
            "status": "running",
            "protocol": "wss"
        },
        "8883": {
            "status": "running",
            "protocol": "mqtts"
        }
    },
    "projectID": "00000001",
    "region": "us-east-1",
    "regionLabel": "N. Virginia (us-east-1)",
    "spec": {
        "connections": 1000,
        "deploymentVersion": "v5",
        "freeTraffic": 100,
        "node": 2,
        "protection": false,
        "tps": 1000,
        "version": 5.2
    },
    "status": "pending",
    "subscription": false,
    "tls": null,
    "userID": "00000001"
}