Add Widget to Dashboard
Create a new widget, append it to the dashboard, and compute its result in one call.
The widget is persisted as its own entity, its ID is appended to the dashboard’s
widget_order, and — unless it is a markdown or heading widget — its result is
computed synchronously against the dashboard’s evaluation (or evaluation-group) data
before the response returns. Validation is type-specific: markdown requires
config.content, bar/histogram/donut/scatter require exactly one of
config.x_column or config.x_column_group, table configs with conditional
formatting are schema-validated, and all other chart types require a query. The
dashboard must exist and not be archived. A computation failure does not fail the
request: the widget is still created and returned with a result whose
computation_status is failed and an error_message set, while markdown and
heading widgets return a null result.
Authorizations
Headers
Path Parameters
Body
Widget title
1 - 256Widget type
bar, histogram, donut, scatter, metric, table, markdown, heading, timeseries Query that returns a series of records (used for table/bar/histogram/donut/scatter widgets).
Used for widget types: table, bar, histogram, donut, scatter. Returns: {"type": "series", "data": [...]}
Example SQL equivalent: SELECT category, AVG(score) as avg_score, COUNT(*) as count FROM evaluation_items WHERE score > 0.5 AND category = 'test' GROUP BY category ORDER BY avg_score DESC LIMIT 100
- SeriesQuery
- MetricQuery
Chart-specific display configuration
Response
Successful Response
Response model for widget creation - includes widget and computed result
Unique identifier of the widget
Widget title
Widget type
bar, histogram, donut, scatter, metric, table, markdown, heading, timeseries Account that owns this widget
When the widget was created
"evaluation_widget"Query that returns a series of records (used for table/bar/histogram/donut/scatter widgets).
Used for widget types: table, bar, histogram, donut, scatter. Returns: {"type": "series", "data": [...]}
Example SQL equivalent: SELECT category, AVG(score) as avg_score, COUNT(*) as count FROM evaluation_items WHERE score > 0.5 AND category = 'test' GROUP BY category ORDER BY avg_score DESC LIMIT 100
- SeriesQuery
- MetricQuery
Display configuration
Computed result for this widget

