The following example shows how to create a new dashboard with initial widgets:
mutation CreateDashboard($dashboard: DashboardInput!, $widgets: [DashboardWidgetInput!]!) { createDashboard(dashboard: $dashboard, widgets: $widgets) { id name description widgets { id title layout { top left width height } } accessLevel }}
curl -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer <jwt_token>" \ -d '{ "query": "mutation CreateDashboard($dashboard: DashboardInput!, $widgets: [DashboardWidgetInput!]!) { createDashboard(dashboard: $dashboard, widgets: $widgets) { id name widgets { id title layout { top left width height } } } }", "variables": { "dashboard": { "name": "Sales Performance Dashboard", "description": "Monthly sales metrics and KPIs", "domainId": "domain_987654321" }, "widgets": [ { "title": "Total Sales", "nlQuery": "What are the total sales?", "layout": { "top": 0, "left": 0, "width": 6, "height": 4 } } ] } }' \ https://{ACCOUNT}.askwisdom.ai/graphql