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
{
  "data": {
    "createDashboard": {
      "id": "dashboard_123456789",
      "name": "Sales Performance Dashboard",
      "widgets": [
        {
          "id": "widget_987654321",
          "title": "Total Sales",
          "layout": {
            "top": 0,
            "left": 0,
            "width": 6,
            "height": 4
          }
        }
      ]
    }
  }
}
The createDashboard mutation creates a new dashboard with the specified configuration and initial widgets.

Signature

createDashboard(dashboard: DashboardInput!, widgets: [DashboardWidgetInput!]!): Dashboard!

Arguments

dashboard
DashboardInput!
required
Input object containing the dashboard configuration. See DashboardInput.
widgets
[DashboardWidgetInput!]!
required
Array of widget configurations to include in the new dashboard. See DashboardWidgetInput.

Response

Returns the newly created Dashboard object with all properties populated. See Dashboard for the schema.

Usage Example

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
{
  "data": {
    "createDashboard": {
      "id": "dashboard_123456789",
      "name": "Sales Performance Dashboard",
      "widgets": [
        {
          "id": "widget_987654321",
          "title": "Total Sales",
          "layout": {
            "top": 0,
            "left": 0,
            "width": 6,
            "height": 4
          }
        }
      ]
    }
  }
}