Create a dashboard widget
Create a new dashboard widget. A widget is a chart component bound to a report query; the widget_type selects the chart rendering and configuration provides per-chart options (legend, palette, metric field, type-specific keys). The widget becomes visible to users only once it has been placed on a dashboard via the dashboard’s widget placement endpoint.
Request Structure
Key Fields
| Field | Required | Description |
|---|---|---|
code | Yes | Unique widget code (max 30 chars) |
name | Yes | Display name (max 50 chars) |
description | No | Optional description (max 255 chars) |
widget_type | Yes | Chart rendering type. One of: area, bar, funnel, gauge, graph, grid, heatmap, line, pictorial_bar, pie, radar, sankey, scatter, single, sunburst, tree, treemap |
report_query_id | No | Linked report query that supplies the data |
configuration | No | Chart options — see per-widget-type reference below |
dashboard_filters | No | Default filter values applied to the report query when the widget renders, e.g. { "warehouse_id": 1 } |
configuration reference
The configuration JSON object’s keys vary by widget_type. All keys are snake_case.
Common keys
| Key | Type | Notes |
|---|---|---|
metric | string | Field from the report query result to chart (e.g. quantity, count, total_records) |
color_palette | string | One of default, vivid, pastel, cool, warm, mono |
show_legend | boolean | Toggle legend visibility (chart types that support a legend) |
legend_position | string | One of top, bottom, left, right |
limit | integer | 5, 10, or 20 — max data points (chart types where limiting applies) |
Per-type keys
widget_type | Type-specific keys | Example configuration |
|---|---|---|
bar | horizontal (bool), log_scale (bool) | { "metric": "quantity", "color_palette": "default", "show_legend": true, "legend_position": "bottom", "horizontal": false, "log_scale": false, "limit": 10 } |
line | smooth (bool), log_scale (bool) | { "metric": "quantity", "color_palette": "cool", "show_legend": true, "legend_position": "bottom", "smooth": true, "log_scale": false, "limit": 10 } |
area | smooth (bool), log_scale (bool) | { "metric": "total_records", "color_palette": "pastel", "show_legend": true, "legend_position": "bottom", "smooth": true, "log_scale": false, "limit": 10 } |
scatter | log_scale (bool) | { "metric": "quantity", "color_palette": "vivid", "show_legend": true, "legend_position": "bottom", "log_scale": false, "limit": 10 } |
pictorial_bar | horizontal (bool) | { "metric": "total_records", "color_palette": "vivid", "show_legend": true, "legend_position": "bottom", "horizontal": false, "limit": 10 } |
heatmap | — (common keys only, no legend) | { "metric": "quantity", "color_palette": "mono", "limit": 10 } |
pie | donut_hole (integer, 0–80), pie_label_content (name | value | percent | name_percent | name_value); no limit | { "metric": "count", "color_palette": "default", "show_legend": true, "legend_position": "bottom", "donut_hole": 36, "pie_label_content": "name_percent" } |
funnel | funnel_ascending (bool), funnel_min_size (integer, 0–50) | { "metric": "total_records", "color_palette": "warm", "show_legend": true, "legend_position": "bottom", "funnel_ascending": false, "funnel_min_size": 20, "limit": 10 } |
gauge | gauge_min (integer), gauge_max (integer), gauge_thresholds (none | traffic_light | reverse_traffic_light), gauge_format (number | percentage); no legend/limit | { "metric": "count", "color_palette": "default", "gauge_min": 0, "gauge_max": 100, "gauge_thresholds": "traffic_light", "gauge_format": "percentage" } |
graph | graph_layout (force | circular) | { "metric": "quantity", "color_palette": "cool", "show_legend": true, "legend_position": "bottom", "graph_layout": "force", "limit": 10 } |
radar | radar_max (integer; 0 = inferred from data) | { "metric": "quantity", "color_palette": "cool", "show_legend": true, "legend_position": "bottom", "radar_max": 100 } |
sankey | — (color + metric only) | { "metric": "quantity", "color_palette": "default" } |
sunburst | — (legend + color, no limit) | { "metric": "total_records", "color_palette": "pastel", "show_legend": true, "legend_position": "bottom" } |
tree | — (color + metric only, no legend/limit) | { "metric": "quantity", "color_palette": "default" } |
treemap | — (color + metric only, no legend/limit) | { "metric": "quantity", "color_palette": "cool" } |
single | single_color (green | blue | orange | purple | red | teal | pink | yellow); no legend/limit | { "metric": "count", "single_color": "green" } |
grid | Tabular data view. No configuration keys are currently consumed by the renderer; supply an empty object | {} |
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Body
Response
Dashboard widget created successfully. Response contains the new widget's id.
Identifier of the created widget

