Render Endpoint

Draw a query as a finished visualization — the same chart, table or highlight cards the app shows — and get it back as a self-contained HTML page, as text for a terminal, or as data. Every answer carries a link that opens the visualization in Explore, so whoever reads it can keep working on it.

It is made for AI assistants and scripts that should show a result: there is no need to turn CSV into a chart yourself.

Method: POST Path: /data/{model}/render Content-Type: application/json Query parameters:

Parameter Value
format html — a self-contained HTML page; text — a chart or table drawn with characters, for a terminal; json (default) — the visualization as data
width text only: characters per line, 40 to 240 (default 100)
height text only: lines of the chart, 8 to 60 (default 20)
color text only. Left out, the chart is drawn in the app's colours for a terminal (256-colour, the same as true or 256); truecolor uses the exact colours, for a terminal with 24-bit colour; none gives plain text, for example when a program reads the result or an AI assistant shows it inside a formatted reply. Axes, labels and table borders are grey. Any other value is refused (400). With or without colour, every series of a chart is drawn in its own pattern (█ ▓ ▒ ░)

Call it on your workspace address (https://{workspace}.{region}.engeene.com) — the workspace address draws the chart.

The request

The body is the query you would send for the same numbers, plus how to draw it.

{
  "metrics": [{"property": "bookings.total", "aggregation": "Sum"}],
  "timeSegments": [{"property": "bookings.bookedAt", "grouping": "MONTH"}],
  "filters": [{"type": "Attribute In", "property": "bookings.channel", "values": "Web,App"}],
  "visualization": "auto"
}
Field Meaning
metrics, segmentBy, timeSegments, orderBy + segmentLimit + includeOther As in the query endpoint. orderBy here ranks by a measure and needs segmentLimit
properties, sortBy, limit For a row listing ("visualization": "list"), as in the list endpoint
filters Filters written with the values themselves, as on a dashboard: Attribute In / Attribute Not In with values (comma-separated), Measure In Range with values written min,max in the measure's own units. They are carried into the Explore link
conditions Optional query conditions exactly as the query endpoint takes them. They are applied, but cannot be carried into the Explore link — prefer filters
dataset Optional. Lets you name a property without its dataset (total instead of bookings.total)
title Optional. Without one the title names the measures and dimensions
timezone Time zone of time groupings and relative filters (default UTC)
visualization How to draw it — a word, or a complete definition (below)

Choosing the visualization with one word

visualization What is drawn
auto (default) Chosen from the shape of the query — see the next table
chart The automatic chart; a query too wide for a readable chart is drawn as a table
table, highlight, list That visualization
Bar, Line, Area A bar, line or area chart; with two dimensions the second stacks
Pie, Scatter, Radar, Treemap, Funnel, Waterfall, Bullet That chart type
BoxPlot A box plot; one measure becomes its minimum, lower quartile, median, upper quartile and maximum, one box per value of the dimension
Heatmap A heatmap; the second dimension runs across
GeoArea, GeoPoints A map coloured, or pinned, by the first dimension

The automatic choice depends only on the query, so the same query always draws the same thing:

The query has auto draws
Measures and no dimension Highlight cards, one per measure
properties and no measure A row list
One time grouping A line chart over time
One time grouping and one attribute, one measure A bar chart over time, stacked by the attribute
One attribute A bar chart, one bar per measure
Two attributes, one measure A bar chart stacked by the second attribute
Anything wider A table

Giving a complete definition

visualization may instead be a whole visualization definition, written as a dashboard stores it (see Dashboards Endpoint): type, chartType, chartConfig, measures with their style, segments, filters, topNConfig. Anything you leave out takes the default the app gives it — for example, without chartConfig.legend the legend is placed automatically. A definition that names a key wins over the query field of the same meaning.

{
  "visualization": {
    "type": "Chart", "chartType": "Pie", "title": "Bookings by channel",
    "metrics": [{"property": "bookings.total", "aggregation": "Sum"}],
    "segments": ["bookings.channel"],
    "chartConfig": {"legend": "Bottom"}
  }
}

The answer

  • format=html — one HTML document with nothing to load: the title, the chart drawn exactly as the app and the delivered reports draw it, the data beneath it and an Open in Explore link. Charts the reports do not draw (Funnel, Waterfall, Box Plot, Treemap, Bullet) are shown as a simple bar picture and their data.
  • format=text — the chart drawn with characters (lines, bars, stacked or side by side, points, heatmaps), or a table with box-drawn borders, then a line Open in Explore: <link>. Show it in a monospace font.
  • format=json — the visualization as data:
Field Meaning
title The title
shape chart, table, highlight or list
visualization The complete definition that was drawn — reuse it to draw the same thing again, or put it on a dashboard
chart The chart's categories, series and formats, or null
table columns (label, kind) and rows of formatted values; truncatedAt is non-zero when only the first rows are shown
html The visualization as a static HTML fragment
exploreUrl The link that opens it in Explore
conditionsOmittedFromExploreUrl true when conditions could not be carried into the link

A visualization that cannot be drawn answers 422 with the reason (an unknown property, an aggregation the property does not take); data you may not see answers 403.

From an AI assistant

The MCP server offers this endpoint as two tools, render_html and render_text, which take the same input as the query tool plus visualization.

Rendering a whole dashboard

POST /dashboards/{id}/render draws a saved dashboard the same way: every visualization in its own place — the dashboard's rows and columns, titles and section headings — without menus, controls or the filter bar, and a link that opens the dashboard. {id} is the dashboard id (see Dashboards Endpoint); format, width, height and color work as above, width and height sizing each chart of a text drawing.

{
  "filters": [{"type": "Attribute In", "property": "bookings.channel", "values": ["Web", "App"]}],
  "timezone": "Europe/Prague"
}
Field Meaning
filters Optional, at most 100. Filters added to the dashboard's own, written as on a dashboard (above). A filter on a property the dashboard already filters replaces that one
timezone Time zone of time groupings and relative filters (default UTC)

The dashboard is drawn as it looks to whoever calls: their access and restrictions apply, and a dashboard they may not open answers 404, exactly as one that does not exist. With format=json the answer lists the layout and each visualization's data (title, chart, table, html, and error when one could not be drawn).

From an AI assistant the same is two tools, render_dashboard_html and render_dashboard_text, which take the dashboard id or the dashboard's address, filters and timezone. From your own page, use the TypeScript client.

← List EndpointAttributes Endpoint →