API v1.x

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

Connecting to Kuzzle #

A connection to Kuzzle can be made using different protocols. Currently Kuzzle natively supports HTTP, WebSocket and, but other protocols can be added by implementing the Protocol interface.


By default, Kuzzle can be reached via HTTP on port 7512. Thus, assuming the Kuzzle server is running locally, it can be reached at http://localhost:7512/.

The default response for the root endpoint is the ServerInfo, which gives detailed information about the available HTTP API routes.

Example #

Copied to clipboard!
curl "http://localhost:7512/"

WebSocket #

By default, Kuzzle has websockets enabled, accepting requests via the http server on port 7512.

Example #

Copied to clipboard!
  var socket = new WebSocket('ws://localhost:7512');
</script> #

To ensure compatibility with older web browsers, our official Kuzzle docker images embed the socketio protocol, accepting socket requests via the http server on port 7512.

Example #

Copied to clipboard!
<script src=""></script>
  var socket = io('http://localhost:7512');

MQTT protocols #

Kuzzle provides a plugin that supports the MQTT protocol. Using the plugin you can perform two-way communication between your application and Kuzzle.

Example #

Copied to clipboard!
# shell 1
node_modules/.bin/mqtt subscribe -v -h rabbit -t Kuzzle

# shell 2
node_modules/.bin/mqtt publish -h rabbit -t Kuzzle -m '{
  "controller": "document",
  "action": "createOrReplace",
  "body": {
    "firstName": "John",
    "lastName": "Doe"

# shell 1 (prettified)
Kuzzle {
  "error": null,
  "result": {
    "_id": "AVF8NG3k5ZVpUuiPrN1K",
    "_index": "index",
    "_source": {"firstName":"John", "lastName":"Doe"},
    "_type": "collection",
    "_version": 1,
    "action": "createOrReplace",
    "collection": "collection",
    "controller": "document",
    "created": true,
    "volatile": {},
  "status": 200

By default, the MQTT plugin protocol listens on port 1883.

The examples given in this documentation use the CLI client from the mqtt node.js library that is shipped in the Kuzzle Docker image.
To test them out yourself you will need to enter into the container shell once your docker compose stack is up and running:
docker exec -ti kuzzle_kuzzle_1 bash