# Subscribe to a TilliT Topic

## Overview

When TilliT sends an MQTT message, it is sent on a specific topic only available to you in a **hierarchical** structure. Depending on how specific you want to be, you can adjust the subscriptions you make to get **exactly** the data you want.

## Subscribe to TilliT MQTT

The easiest way to receive data from TilliT MQTT Endpoint is to subscribe to all topics. This is done with the wildcard character `#`.

```
subscribe('/tenant/#')

This will receive:
 - /tenant/test
 - /tenant/another/test/
 - /tenant/another/another/test/
 - etc.
It will not receive:
 - /another
 - /another/topic
 - /tenant
```

### TilliT message topic structure

Every message that TilliT sends will have a topic structure of:

```
tenant/siteName/assetName/endpoint
 - tenant: the name of your tenant
 - siteName: the name of the site the event occured on
 - assetName: the name of the asset the event occured on
 - endpoint: the topic configured by the channel endpoint field (see Seperating Different Client Subscriptions)
```

If you want to subscribe to anything in a level, then you can use the character `+` like so:

```
/tenant/+/assetName/endpoint - receive updates on an asset across any site
/tenant/siteName/+/endpoint - receive updates on a site across any asset
/tenant/+/+/endpoint - receive updates on any site and any asset for an ednpoint
```

## Separating different client subscriptions

A Channel configured in TilliT has an optional endpoint field. By including an **identifier** here, we can easily subscribe to a specific TilliT Channel and seperate our subscriptions.

<figure><img src="https://2508759266-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh0XWAsvhQAYlvQe4wbHt%2Fuploads%2FK3lVvTyj6JG8Get2tdmz%2Fimage.png?alt=media&#x26;token=abf55b63-befa-43e2-8835-2eaff0207d36" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.tillit.cloud/api/mqtt-api/subscribe-to-a-tillit-topic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
