Skip to main content
Version: V3.2

MQTT

Capture exposes a real-time MQTT broker. Depending on your account type you can use it to receive live data, push data in, or send commands to sources.

Connecting

Contact the Capture team to obtain the hostname for your environment.

ProtocolPortNotes
MQTTS (TLS)8883Recommended for most clients
WSS (Secure WebSocket)443Base path: /mqtt
WSS (Secure WebSocket)8084Base path: /mqtt

Authentication

Use your Capture credentials to authenticate. Two methods are supported:

Username & Password

Use any active Capture user account username and password. If you are authenticating as a source/device, use the credentials found in the auth config, which can be downloaded from the source details page in the Capture portal.

Username & JWT Token

Use your Capture username as the username field and a JWT token obtained from the Capture Auth API as the password field.

API Token

Use the API token's ID (GUID) as the username field and the API token value as the password field. The GUID is visible in the token details page in the Capture portal under Identity → API Tokens. An API token authenticates as a user account — see the User accounts section for what it can access.


User accounts

Regular Capture user accounts can subscribe to live data and send commands to sources.

Subscribing to live data (raw)

The raw tree exposes every data point collected by Capture, broken down to individual field-level topics. Each message contains a single field value.

Topic format

v1/raw/[Company Name]/[Source ID]/[Connection Tag]/[Measurement]/[Key]

Example

v1/raw/AcmeCorp/fe453df1-b4a0-492d-a12c-505988eea849/System_Monitoring_Requester/Monitoring/CPU_Temp

Payload

{
"Value": 55,
"Tags": {
"Connection_Tag": "System_Monitoring_Requester",
"MachineName": "MyMachine",
"SerialNumber": "77777"
},
"UtcTimestamp": "2024-11-08T10:22:06.26Z"
}

You can use MQTT wildcards from the Source ID level and below. The company name segment must always be an exact match — wildcarding it will be rejected by the broker.

Receive all data under your company:

v1/raw/AcmeCorp/#

Receive all fields for a specific measurement across all sources:

v1/raw/AcmeCorp/+/+/Monitoring/#

Sending commands to a source

User accounts can publish commands to any source that belongs to their company.

Topic format

v1/sources/[Source ID]/cmd/writedata

Payload

{
"Topic": "{connection}/{measurement}/{variable}",
"Mapping": "{mapping}",
"Data": "{value}"
}

Source/device accounts

Sources registered in Capture have their own dedicated credentials. A source account can only publish and subscribe within its own v1/sources/[Source ID]/... subtree — it cannot access other sources or the raw tree.

Pushing data into Capture

Sources publish data to the data/read subtopic. Two payload formats are accepted.

Field level — one field per message

Topic:

v1/sources/[Source ID]/data/read/[Connection Tag]/[Measurement]/[Key]

Payload:

{
"Value": 55,
"Tags": {
"MachineName": "MyMachine"
},
"UtcTimestamp": "2024-11-08T10:22:06.26Z"
}

Measurement level — multiple fields in one message

Topic:

v1/sources/[Source ID]/data/read/[Connection Tag]/[Measurement]

Payload:

{
"Fields": {
"CPU_Temp": 55,
"CPU_Load": 23.4
},
"Tags": {
"MachineName": "MyMachine"
},
"UtcTimestamp": "2024-11-08T10:22:06.26Z"
}

Timestamp formats

The UtcTimestamp field accepts:

  • ISO 8601 string: "2024-11-08T10:22:06.26Z"
  • Unix epoch in milliseconds: 1731060126260
  • Omitted — Capture will use the time the message is received

tip

If you get disconnected immediately after connecting, it is most likely an authorization issue. Check that the topic you are subscribing or publishing to falls within the allowed scope for your account type.