Create a widget
create_widgetAdd a chart, table or KPI to a view. Call list_widget_types for the visualizationConfig each type needs, and run_query_preview first to confirm the query returns the columns you are about to reference. On a multi-customer dashboard the query must filter on :customer_id. Subject to your plan's widget limit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | SQL, or an A1 range for Google Sheets. On a customer dashboard include :customer_id, for example "WHERE customer_id = :customer_id". | |
| title | Yes | Widget title. | |
| layout | No | Position and size on the 12-column grid. Omit on create and a free slot is chosen for you. | |
| viewId | Yes | View id the widget belongs to. | |
| dataSourceId | Yes | Data source the query runs against. | |
| visualizationType | Yes | ||
| visualizationConfig | No | Field mappings and display options for this visualization type. Call list_widget_types for the keys each type expects. | |
| allowSharedAcrossAllCustomers | No | Only for customer dashboards. Set true, after the user explicitly confirms, to allow a query with no per-customer filter so every customer sees identical rows. |