Overview
A client-mode connector for the Apache Superset REST API. Use it to put BI results on MQTT and plant events into Superset: run a chart query or a SQL Lab statement and publish the rows to a display, upload a CSV rollup (shift totals, OEE per line) into a database, register and refresh datasets, warm the chart cache when new data lands, and mark downtime, changeover or alarm windows as annotations on time-series charts. It also reads alerts and reports with their run logs and issues guest tokens for dashboards embedded on an HMI or kiosk. The connectorApacheSupersetRestApi in ApacheSupersetRestApi.lot has 38 events (26 GET, 9 POST, 3 PUT). 9 are writes: DatasetCreate, DatasetRefresh, DatasetWarmUpCache, DatabaseCsvUpload, SqlLabExecute, AnnotationLayerCreate, AnnotationCreate, AnnotationUpdate, GuestTokenCreate. There are no DELETE events.
Set BASE_ADDRESS to your Superset web root with no trailing slash, for example https://superset.example.com (use http:// and USE_SSL "false" for a plain-HTTP install on a LAN). Every endpoint already starts with /api/v1, except /health. Topics use analytics/apache-superset/<object>/<verb>; replies land on <topic>/response.
See the base guide: REST API Connectors.
Auth: publish
{"body":{"username":"...","password":"...","provider":"db","refresh":true}} to analytics/apache-superset/auth/login (provider is ldap for LDAP users). The reply carries a JWT access_token, which expires after 15 minutes by default, and a refresh_token when refresh is true. Every event except HealthGet and SecurityLogin sends Authorization: Bearer <access_token>. To renew, publish {"access_token":"<refresh_token>"} to analytics/apache-superset/auth/refresh, or log in again. Use a dedicated Superset user with only the roles the broker needs. Keep SUPERSET_USER and SUPERSET_PASSWORD in broker secrets, read them with GET SECRET, never retain topics that carry a password or token, and restrict analytics/apache-superset/auth/# and analytics/apache-superset/embedded/# with ACLs. Deployments that only allow OAuth or SAML sign-in need a database or LDAP service user for the API.Events
Payload fields:
access_token; ids dashboard_id (id or slug), chart_id, dataset_id, database_id, report_id, layer_id, annotation_id; query (URL query string without ?, or ""; list endpoints take Rison in q, for example q=(page_size:20)); body (JSON); multipart (whole multipart/form-data body for DatabaseCsvUpload).
Basic Syntax
Examples
Keep a token for the other actions
Mark a downtime window on charts
Create a layer once withAnnotationLayerCreate, then add an annotation when a stop starts and close it with AnnotationUpdate when the line runs again. Times are local timestamps without a zone, for example 2026-10-05T08:00:00.
analytics/apache-superset/annotations/create/response carries the annotation id. Publish {"access_token":"...","layer_id":"3","annotation_id":"<id>","body":{"end_dttm":"2026-10-05T08:12:00"}} to analytics/apache-superset/annotations/update to close the window.
Publish chart rows to a display
ChartDataQuery runs a query context against a dataset and returns the rows in result[0].data:
{"access_token":"...","chart_id":"12","query":"format=json&type=full"} to analytics/apache-superset/charts/data_get. The chart needs a saved query context (charts saved from the Explore view in recent versions have one).
Upload a CSV rollup
DatabaseCsvUpload sends multipart unchanged with Content-Type: multipart/form-data; boundary=CorefluxSupersetBoundary. Use CRLF line endings. The database needs Allow file uploads to database and the schema must be allowed for uploads. Superset 6.x registers the new table as a dataset itself.
SQL Lab
SqlLabExecute runs SQL synchronously with "runAsync":false and returns the rows in data. Keep Allow DML off on the connection so the connector can only read: a mutating statement then fails with This database does not allow for DDL/DML. SqlLabResultsGet only applies to async queries with a results backend.
Not packaged
- DELETE operations, on purpose.
- Alert and report create and update: those views share one wrapped handler with report deletes and plugin forms, so they cannot be CSRF-exempted on their own. Create alerts in the Superset UI; the connector reads them with
ReportsList,ReportGetandReportLogsList. - Import and export ZIPs, screenshots and thumbnails, security, role and user administration, row-level security, themes, tags, explore form data and permalinks.
Testing status
Live HTTP smoke against a throwaway Apache Superset 6.1.0 (officialapache/superset Docker image, SQLite metadata and data, ALERT_REPORTS and EMBEDDED_SUPERSET on, the WTF_CSRF_EXEMPT_LIST above): static 312/312, spec 121/121, live 62/62, controls 36/36. Every event ran with valid credentials: CSV upload into a new table with a non-ASCII value, chart data and SQL Lab rows matching the upload, a refused DML statement, dataset refresh and cache warm-up, annotation create and update, dashboard by slug, alert read-back and a guest token for an embedded dashboard. Every authenticated event answered 401 or 422 with an invalid token, and a wrong password answered 401. Superset rate-limits by client: 50 requests per second overall and 5 login attempts per second by default (429 beyond that).
