> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tarvah.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Create your first dashboard via the SDK in under 5 minutes

## Prerequisites

* A Tarvah instance with the SDK routes enabled
* An API key ([create one here](/api-reference/create-api-key))
* A data source (database connection ID or VDM ID)

## Step 1: Get your chart types

First, check available chart types and aggregations:

```bash theme={null}
curl https://<your-instance>/v1/sdk/chart-types
```

This returns the full mapping of friendly names (like `column`, `pie`, `line`) to internal chart codes.

## Step 2: Create a simple dashboard

<CodeGroup>
  ```python Python theme={null}
  import requests

  API_KEY = "trvh_sdk_your_key_here"
  BASE_URL = "https://<your-instance>/v1/sdk"

  payload = {
      "name": "Revenue Dashboard",
      "description": "Quarterly revenue breakdown",
      "dataSource": {
          "dbId": "D2026A00002",
          "vdmId": "VDM2026A00001",
          "connType": "VDM"
      },
      "charts": [
          {
              "title": "Revenue by Region",
              "type": "column",
              "measures": [
                  {"field": "revenue", "aggregation": "sum"}
              ],
              "dimensions": ["region"]
          },
          {
              "title": "Revenue Distribution",
              "type": "pie",
              "measures": [
                  {"field": "revenue", "aggregation": "sum"}
              ],
              "dimensions": ["category"]
          }
      ],
      "category": ["Sales"],
      "tags": ["quarterly"]
  }

  response = requests.post(
      f"{BASE_URL}/import",
      json=payload,
      headers={"Authorization": f"Bearer {API_KEY}"}
  )

  result = response.json()
  print(f"Dashboard created! Facade ID: {result['facadeId']}")
  ```

  ```javascript Node.js theme={null}
  const payload = {
    name: "Revenue Dashboard",
    description: "Quarterly revenue breakdown",
    dataSource: {
      dbId: "D2026A00002",
      vdmId: "VDM2026A00001",
      connType: "VDM",
    },
    charts: [
      {
        title: "Revenue by Region",
        type: "column",
        measures: [{ field: "revenue", aggregation: "sum" }],
        dimensions: ["region"],
      },
      {
        title: "Revenue Distribution",
        type: "pie",
        measures: [{ field: "revenue", aggregation: "sum" }],
        dimensions: ["category"],
      },
    ],
    category: ["Sales"],
    tags: ["quarterly"],
  };

  const response = await fetch("https://<your-instance>/v1/sdk/import", {
    method: "POST",
    headers: {
      Authorization: "Bearer trvh_sdk_your_key_here",
      "Content-Type": "application/json",
    },
    body: JSON.stringify(payload),
  });

  const result = await response.json();
  console.log(`Dashboard created! Facade ID: ${result.facadeId}`);
  ```
</CodeGroup>

## Step 3: Create a multi-section dashboard

Use the `sections` array for dashboards with KPI cards and category tabs:

```json theme={null}
{
  "name": "Executive Dashboard",
  "dataSource": { "dbId": "D2026A00002", "vdmId": "VDM2026A00001", "connType": "VDM" },
  "templateType": "realEstate",
  "sections": [
    {
      "name": "KPI Overview",
      "topSection": true,
      "charts": [
        { "title": "Total Revenue", "type": "kpi", "measures": [{"field": "revenue", "aggregation": "sum"}], "dimensions": ["period"] },
        { "title": "Total Orders",  "type": "kpi", "measures": [{"field": "order_count", "aggregation": "count"}], "dimensions": ["period"] }
      ]
    },
    {
      "name": "Sales",
      "category": true,
      "charts": [
        { "title": "Sales by Region", "type": "column", "measures": [{"field": "revenue", "aggregation": "sum"}], "dimensions": ["region"] }
      ]
    },
    {
      "name": "Operations",
      "category": true,
      "charts": [
        { "title": "Delivery Times", "type": "line", "measures": [{"field": "delivery_days", "aggregation": "avg"}], "dimensions": ["month"] }
      ]
    }
  ]
}
```

This creates:

* A **top section** with KPI cards (always visible)
* **Category tabs** for "Sales" and "Operations" with their respective charts

## Response format

```json theme={null}
{
  "success": true,
  "facadeId": "F2026A00018",
  "experiments": [
    {
      "experimentId": "E2026A00042",
      "section": "KPI Overview",
      "charts": [
        { "chartId": "chart_1", "chartType": "CH00055", "chartTitle": "Total Revenue" },
        { "chartId": "chart_2", "chartType": "CH00055", "chartTitle": "Total Orders" }
      ]
    },
    {
      "experimentId": "E2026A00043",
      "section": "Sales",
      "charts": [
        { "chartId": "chart_1", "chartType": "CH00003", "chartTitle": "Sales by Region" }
      ]
    }
  ]
}
```
