|
| 1 | +openapi: 3.0.1 |
| 2 | +info: |
| 3 | + contact: |
| 4 | + url: https://www.hivemq.com |
| 5 | + description: > |
| 6 | + # Introduction |
| 7 | +
|
| 8 | + The HiveMQ Data Hub provides mechanisms to define how MQTT data and MQTT client behavior are handled in the HiveMQ broker. |
| 9 | + |
| 10 | + - Data Validation in the HiveMQ Data Hub allows you to implement declarative policies that check whether your data sources are sending data in the data format you expect. |
| 11 | + |
| 12 | + - Behavior Validation gives you the ability to model the behavior of your MQTT clients throughout the entire lifecycle of the client. |
| 13 | +
|
| 14 | + ## Errors |
| 15 | +
|
| 16 | + Conventional HTTP response codes are used to indicate the success or failure |
| 17 | + of an API request. Codes in the 2xx range generally indicate success. Codes |
| 18 | + in the 4xx range indicate an error that failed given the information |
| 19 | + provided (e.g., a required parameter was omitted). Codes in the 5xx range |
| 20 | + indicate an error on the server side. |
| 21 | +
|
| 22 | +
|
| 23 | + For all errors a JSON response with additional details is returned in the |
| 24 | + format [Problem JSON](https://tools.ietf.org/html/rfc7807). |
| 25 | +
|
| 26 | + ## OpenAPI |
| 27 | +
|
| 28 | + HiveMQ's REST API provides an OpenAPI 3.0 schema definition that can |
| 29 | + imported into popular API tooling (e.g. Postman) or can be used to generate |
| 30 | + client-code for multiple programming languages. |
| 31 | + title: HiveMQ Data Hub REST API |
| 32 | + version: 2025.10-SNAPSHOT |
| 33 | + x-logo: |
| 34 | + url: https://www.hivemq.com/img/svg/hivemq-bee.svg |
| 35 | +tags: |
| 36 | + - description: >- |
| 37 | + This resource bundles endpoints for the available Finite State Machines |
| 38 | + (FSMs) for Behavior Policies for the HiveMQ Data Hub. Currently this is |
| 39 | + limited to getting the available FSMs. |
| 40 | + name: Data Hub - FSM |
| 41 | + - description: >- |
| 42 | + This resource bundles endpoints for the available Functions for the HiveMQ |
| 43 | + Data Hub. Currently this is limited to getting the available Functions. |
| 44 | + name: Data Hub - Functions |
| 45 | + - description: >- |
| 46 | + Policies describe how you want the HiveMQ broker to validate the behavior |
| 47 | + of MQTT clients. |
| 48 | +
|
| 49 | + Each policy has four sections: |
| 50 | +
|
| 51 | +
|
| 52 | + - Matching: Specifies which clients the policy engine validates. |
| 53 | +
|
| 54 | + - Deserialization: Specifies deserializers for different message payloads. |
| 55 | +
|
| 56 | + - Behavior: Specifies the behavior that is considered valid for matched |
| 57 | + clients. |
| 58 | +
|
| 59 | + - onTransitions: Specifies custom actions that are executed when a client |
| 60 | + transitions to a different state within the specified behavior model that |
| 61 | + is valid for that client. |
| 62 | +
|
| 63 | + These endpoints can be used to create, update, delete, and list behavior |
| 64 | + policies. |
| 65 | +
|
| 66 | +
|
| 67 | + For more information on all capabilities the HiveMQ Data Hub offers, see |
| 68 | + the [HiveMQ |
| 69 | + documentation](https://docs.hivemq.com/hivemq/latest/data-hub/index.html). |
| 70 | + name: Data Hub - Behavior Policies |
| 71 | + - description: >- |
| 72 | + Data Policies describe how you want the HiveMQ broker to apply schemas to |
| 73 | + incoming MQTT message payload data and act on the validation results. |
| 74 | +
|
| 75 | + Each policy has four sections: |
| 76 | +
|
| 77 | +
|
| 78 | + - Matching: Specifies which packets the policy engine validates. |
| 79 | +
|
| 80 | + - Validation: Specifies how the packets are validated. For example, based |
| 81 | + on a JSON Schema. |
| 82 | +
|
| 83 | + - OnSuccess: Defines which actions are executed when the outcome of a |
| 84 | + validation is successful. |
| 85 | +
|
| 86 | + - OnFailure: Defines which actions are executed when the validation fails. |
| 87 | +
|
| 88 | +
|
| 89 | + These endpoints can be used to create, update, delete, and list data |
| 90 | + policies. |
| 91 | +
|
| 92 | +
|
| 93 | + For more information on all capabilities the HiveMQ Data Hub offers, see |
| 94 | + the [HiveMQ |
| 95 | + documentation](https://docs.hivemq.com/hivemq/latest/data-hub/index.html). |
| 96 | + name: Data Hub - Data Policies |
| 97 | + - description: >- |
| 98 | + A schema defines the expected structure and format of incoming MQTT |
| 99 | + message payload data. |
| 100 | +
|
| 101 | +
|
| 102 | + This endpoint can be used to create, get, and delete schemas. |
| 103 | +
|
| 104 | +
|
| 105 | + Schemas can be enforced with the use of a policy. |
| 106 | +
|
| 107 | +
|
| 108 | + Currently, the following schema definitions are supported: |
| 109 | +
|
| 110 | +
|
| 111 | + - [JSON Schema](https://json-schema.org/) |
| 112 | +
|
| 113 | + - [Protocol Buffers (Protobuf)](https://protobuf.dev/) |
| 114 | +
|
| 115 | +
|
| 116 | + For more information on how to define and use a schema in HiveMQ, see |
| 117 | + [Schemas](https://docs.hivemq.com/hivemq/latest/data-hub/schemas.html). |
| 118 | + name: Data Hub - Schemas |
| 119 | + - description: >- |
| 120 | + A script represents custom logic that can be executed in response to MQTT |
| 121 | + messages. |
| 122 | +
|
| 123 | +
|
| 124 | + This endpoint can be used to create, get, and delete scripts. |
| 125 | +
|
| 126 | +
|
| 127 | + For more information on how to define and use a script in HiveMQ, see |
| 128 | + [Scripts](https://docs.hivemq.com/hivemq/latest/data-hub/scripts.html). |
| 129 | + name: Data Hub - Scripts |
| 130 | + - description: >+ |
| 131 | + These endpoints can be used to retrieve states of clients for the Data |
| 132 | + Hub. |
| 133 | +
|
| 134 | + name: Data Hub - State |
| 135 | +paths: |
| 136 | + /api/v1/data-hub/behavior-validation/policies: |
| 137 | + $ref: paths/api_v1_data-hub_behavior-validation_policies.yaml |
| 138 | + /api/v1/data-hub/behavior-validation/policies/{policyId}: |
| 139 | + $ref: paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml |
| 140 | + /api/v1/data-hub/behavior-validation/states/{clientId}: |
| 141 | + $ref: paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml |
| 142 | + /api/v1/data-hub/data-validation/policies: |
| 143 | + $ref: paths/api_v1_data-hub_data-validation_policies.yaml |
| 144 | + /api/v1/data-hub/data-validation/policies/{policyId}: |
| 145 | + $ref: paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml |
| 146 | + /api/v1/data-hub/fsm: |
| 147 | + $ref: paths/api_v1_data-hub_fsm.yaml |
| 148 | + /api/v1/data-hub/functions: |
| 149 | + $ref: paths/api_v1_data-hub_functions.yaml |
| 150 | + /api/v1/data-hub/function-specs: |
| 151 | + $ref: paths/api_v1_data-hub_function-specs.yaml |
| 152 | + /api/v1/data-hub/schemas: |
| 153 | + $ref: paths/api_v1_data-hub_schemas.yaml |
| 154 | + /api/v1/data-hub/schemas/{schemaId}: |
| 155 | + $ref: paths/api_v1_data-hub_schemas_{schemaId}.yaml |
| 156 | + /api/v1/data-hub/scripts: |
| 157 | + $ref: paths/api_v1_data-hub_scripts.yaml |
| 158 | + /api/v1/data-hub/scripts/{scriptId}: |
| 159 | + $ref: paths/api_v1_data-hub_scripts_{scriptId}.yaml |
0 commit comments