HTTP Interface

The HTTP interface implements an HTTP API to publish and retrieve messages.


For Cloud instances the interface is only available over the secure HTTP port 443 (HTTPS) to ensure all data is transmitted using an encrypted channel.

With Desktop the interface is only available over the insecure HTTP port 1884 due to the lack of a certificate. Another port is selected if the port is already in use by another application.


In the following examples you need to replace ENDPOINT with the URI that points to your Cloud instance or Desktop app.

For Cloud instances the endpoint URI is constructed as follows:

  • https is used as the scheme.
  • INSTANCE_NAME is the name of your instance.
  • TOKEN_SECRET is the tokens secret as configured in the settings panel.
  • INSTANCE_DOMAIN is the full domain to your instance.

With Desktop the endpoint URI is constructed as follows:

  • http is used as the scheme.
  • IP_OR_DOMAIN is the IP address or domain of the machine running Desktop.

API Prefix

The API is available under the prefix broker/ that must be prepended to all requests paths.

Retrieve Message

The GET method is used to retrieve the latest published message:

curl 'ENDPOINT/broker/foo/bar'

Wildcards can also be used to retrieve messages:

curl 'ENDPOINT/broker/foo/+'

The retained query parameter may be set to get the latest retained message published matching the topic filter:

curl 'ENDPOINT/broker/foo/+?retained=true'

Publish Message

The POST method is used to publish a message:

curl -X POST 'ENDPOINT/broker/foo/bar' -d 'Hello World!'

The retained query parameter may be set to publish a retained message:

curl -X POST 'ENDPOINT/broker/foo/bar?retained=true' -d 'Hello World!'

The qos query parameter may be used to set a specific quality of service level:

curl -X POST 'ENDPOINT/broker/foo/bar?qos=2' -d 'Hello World!'

Protocol Notes

  • The basic authentication fields username and password are used to transmit the instance name and token secret.
  • As most browsers and HTTP tools interpret the wildcard # as fragments, the @ can be used instead.
  • The wildcard * is automatically replaced with +.

Enforced Limits

  • The topic length is limited to 128 characters.
  • The topic format is limited to letters, numbers and the following special characters: .,:;-_$/+#.
  • The payload size of a POST request is limited to 64 KB.

Message Ordering

Messages published by an HTTP client are guaranteed to be delivered in the order as they are published if the client waits for the OK response before publishing another message.

Client Libraries

Any available HTTP library can be used with the HTTP interface.