curl -X POST https://<your-instance>/v1/sdk/import \
-H "Authorization: Bearer trvh_sdk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Revenue Dashboard",
"dataSource": {
"dbId": "D2026A00002",
"vdmId": "VDM2026A00001",
"connType": "VDM"
},
"charts": [
{
"title": "Revenue by Region",
"type": "column",
"measures": [{"field": "revenue", "aggregation": "sum"}],
"dimensions": ["region"]
}
],
"category": ["Sales"],
"tags": ["quarterly"]
}'
curl -X POST https://<your-instance>/v1/sdk/import \
-H "Authorization: Bearer trvh_sdk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Executive Dashboard",
"dataSource": {"dbId": "D2026A00002", "vdmId": "VDM2026A00001", "connType": "VDM"},
"templateType": "realEstate",
"sections": [
{
"name": "KPIs",
"topSection": true,
"charts": [
{
"title": "Total Revenue",
"type": "kpi",
"measures": [{"field": "revenue", "aggregation": "sum"}],
"dimensions": ["period"],
"grid": {"width": 3, "height": 6, "x": 0, "y": 0},
"card": {
"icon": "BsCurrencyDollar",
"color": "#237e11",
"trend": {"field": "revenue", "dateField": "order_date", "interval": "Month", "format": "percentage"}
}
}
]
},
{
"name": "Sales",
"category": true,
"charts": [
{
"title": "Revenue by Region",
"type": "donut",
"measures": [{"field": "revenue", "aggregation": "sum"}],
"dimensions": ["region"],
"grid": {"width": 4, "height": 13, "x": 0, "y": 0},
"display": {"showValues": true, "showLegend": true}
},
{
"title": "Revenue by Product",
"type": "column",
"measures": [{"field": "revenue", "aggregation": "sum"}],
"dimensions": ["product"],
"drillDown": "Revenue by Region",
"grid": {"width": 8, "height": 13, "x": 4, "y": 0},
"sort": [{"field": "revenue", "direction": "desc"}]
}
]
}
]
}'
{
"success": true,
"facadeId": "F2026A00018",
"experiments": [
{
"experimentId": "E2026A00042",
"section": "Revenue Dashboard",
"charts": [
{
"chartId": "chart_1",
"chartType": "CH00003",
"chartTitle": "Revenue by Region"
}
]
}
]
}
{
"success": false,
"error": "Request body must include a non-empty 'charts' array or 'sections' array with charts"
}
{
"error": "API key required"
}
SDK API
Import Dashboard
Create a complete dashboard with charts in a single API call (API key auth)
POST
/
v1
/
sdk
/
import
curl -X POST https://<your-instance>/v1/sdk/import \
-H "Authorization: Bearer trvh_sdk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Revenue Dashboard",
"dataSource": {
"dbId": "D2026A00002",
"vdmId": "VDM2026A00001",
"connType": "VDM"
},
"charts": [
{
"title": "Revenue by Region",
"type": "column",
"measures": [{"field": "revenue", "aggregation": "sum"}],
"dimensions": ["region"]
}
],
"category": ["Sales"],
"tags": ["quarterly"]
}'
curl -X POST https://<your-instance>/v1/sdk/import \
-H "Authorization: Bearer trvh_sdk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Executive Dashboard",
"dataSource": {"dbId": "D2026A00002", "vdmId": "VDM2026A00001", "connType": "VDM"},
"templateType": "realEstate",
"sections": [
{
"name": "KPIs",
"topSection": true,
"charts": [
{
"title": "Total Revenue",
"type": "kpi",
"measures": [{"field": "revenue", "aggregation": "sum"}],
"dimensions": ["period"],
"grid": {"width": 3, "height": 6, "x": 0, "y": 0},
"card": {
"icon": "BsCurrencyDollar",
"color": "#237e11",
"trend": {"field": "revenue", "dateField": "order_date", "interval": "Month", "format": "percentage"}
}
}
]
},
{
"name": "Sales",
"category": true,
"charts": [
{
"title": "Revenue by Region",
"type": "donut",
"measures": [{"field": "revenue", "aggregation": "sum"}],
"dimensions": ["region"],
"grid": {"width": 4, "height": 13, "x": 0, "y": 0},
"display": {"showValues": true, "showLegend": true}
},
{
"title": "Revenue by Product",
"type": "column",
"measures": [{"field": "revenue", "aggregation": "sum"}],
"dimensions": ["product"],
"drillDown": "Revenue by Region",
"grid": {"width": 8, "height": 13, "x": 4, "y": 0},
"sort": [{"field": "revenue", "direction": "desc"}]
}
]
}
]
}'
{
"success": true,
"facadeId": "F2026A00018",
"experiments": [
{
"experimentId": "E2026A00042",
"section": "Revenue Dashboard",
"charts": [
{
"chartId": "chart_1",
"chartType": "CH00003",
"chartTitle": "Revenue by Region"
}
]
}
]
}
{
"success": false,
"error": "Request body must include a non-empty 'charts' array or 'sections' array with charts"
}
{
"error": "API key required"
}
Single-shot dashboard creation. Accepts a declarative payload describing charts, data source, and layout — returns experiment and facade IDs.
This endpoint uses API key authentication. Pass your key via
Authorization: Bearer trvh_sdk_... or x-api-key header.Request Body
string
required
Dashboard name displayed in the UI.
string
Optional description for the dashboard.
object
required
The data source to query against.
array
Array of chart definitions. Use this for simple mode (single section).
Show chart object
Show chart object
string
Display title of the chart.
string
required
Chart type — friendly name (e.g.,
column, pie, line, kpi) or CH code (e.g., CH00003). See Get Chart Types for all options.array
required
Array of measure definitions.
Shorthand: pass a string instead of an object to use the default aggregation (e.g.,
Show measure object
Show measure object
"revenue" is equivalent to {"field": "revenue", "aggregation": "sum"}).Using calculations: To reference a pre-computed calculation (percentage of total, weighted average, etc.) from the VDM, use "aggregation": "as-is" with the calculation’s label as the field. See Calculations for details.array
required
array
Array of filter conditions applied to this chart.
number
Max number of rows to return. Defaults to
100 if not using filter.array
Sort configuration. Each item:
{ "field": "columnName", "direction": "asc" | "desc" }.object
Chart position and size within the experiment grid. If omitted, auto-generated (KPIs:
width: 3 side-by-side, others: width: 12 stacked vertically).object
Chart visual settings. If omitted, sensible defaults are applied.
Show display properties
Show display properties
boolean
default:true
Show data values on the chart.
boolean
default:true
Show chart legend.
boolean
default:false
Show hover tooltips.
boolean
default:false
Include null values.
boolean
default:false
Enable chart zoom.
boolean
default:false
Show forecast line.
boolean
default:false
Show horizontal scrollbar.
boolean
default:false
Show vertical scrollbar.
string
Title of another chart in the same section to use as a drill-down source. Clicking the source chart filters this chart. Resolved to internal chart IDs during import.
object
KPI metric card styling. Only applicable for
kpi / kpi-card chart types.Show card properties
Show card properties
string
Icon component name (e.g.,
"BsCurrencyDollar", "ImCart").string
Primary icon/value color (hex, e.g.,
"#237e11").string
Trend-up color (hex, e.g.,
"#41d723").object
Trend sparkline configuration for the KPI card.
Show trend properties
Show trend properties
string
required
Measure field to trend (e.g.,
"Market Value").string
required
Date dimension for the trend x-axis (e.g.,
"Position Date").string
default:"Month"
Trend grouping interval:
"Day", "Week", "Month", "Quarter", "Year".string
default:"percentage"
Trend display format:
"percentage" (delta %), "absolute" (delta value), or "value".object
Bubble chart configuration. Only applicable for
bubble chart type.Show bubble properties
Show bubble properties
string
Field that controls bubble size.
string | object
X-axis field. Pass a string for the field name, or an object
{"field": "...", "type": "dimension" | "measure"}.string | object
Y-axis field. Same format as
xAxis.string
Field that controls bubble color intensity.
array
Two-element array of hex colors for the min/max color gradient (e.g.,
["#98c1e7", "#1169bb"]).array
Array of section definitions. Use this for multi-section mode (multiple experiments, category tabs).
Show section object
Show section object
string
Section name — appears as the category tab label.
array
required
Same chart array format as the top-level
charts field.boolean
default:false
If
true, this section’s charts render in the always-visible top section (ideal for KPI cards).boolean
default:false
If
true, this section appears as a navigable category tab.object
string
Layout template type (e.g.,
"realEstate"). Used to resolve a layout template from the database.string
Exact name of a layout template. Takes priority over
templateType.array
Dashboard categories (e.g.,
["BI", "Sales"]).array
Tags for the dashboard.
"sdk-import" is always added automatically.boolean
default:true
Whether the dashboard is publicly visible.
Response
boolean
Whether the import succeeded.
string
The created facade ID (e.g.,
F2026A00018). Use this to view the dashboard in the UI.array
Array of created experiments.
curl -X POST https://<your-instance>/v1/sdk/import \
-H "Authorization: Bearer trvh_sdk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Revenue Dashboard",
"dataSource": {
"dbId": "D2026A00002",
"vdmId": "VDM2026A00001",
"connType": "VDM"
},
"charts": [
{
"title": "Revenue by Region",
"type": "column",
"measures": [{"field": "revenue", "aggregation": "sum"}],
"dimensions": ["region"]
}
],
"category": ["Sales"],
"tags": ["quarterly"]
}'
curl -X POST https://<your-instance>/v1/sdk/import \
-H "Authorization: Bearer trvh_sdk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Executive Dashboard",
"dataSource": {"dbId": "D2026A00002", "vdmId": "VDM2026A00001", "connType": "VDM"},
"templateType": "realEstate",
"sections": [
{
"name": "KPIs",
"topSection": true,
"charts": [
{
"title": "Total Revenue",
"type": "kpi",
"measures": [{"field": "revenue", "aggregation": "sum"}],
"dimensions": ["period"],
"grid": {"width": 3, "height": 6, "x": 0, "y": 0},
"card": {
"icon": "BsCurrencyDollar",
"color": "#237e11",
"trend": {"field": "revenue", "dateField": "order_date", "interval": "Month", "format": "percentage"}
}
}
]
},
{
"name": "Sales",
"category": true,
"charts": [
{
"title": "Revenue by Region",
"type": "donut",
"measures": [{"field": "revenue", "aggregation": "sum"}],
"dimensions": ["region"],
"grid": {"width": 4, "height": 13, "x": 0, "y": 0},
"display": {"showValues": true, "showLegend": true}
},
{
"title": "Revenue by Product",
"type": "column",
"measures": [{"field": "revenue", "aggregation": "sum"}],
"dimensions": ["product"],
"drillDown": "Revenue by Region",
"grid": {"width": 8, "height": 13, "x": 4, "y": 0},
"sort": [{"field": "revenue", "direction": "desc"}]
}
]
}
]
}'
{
"success": true,
"facadeId": "F2026A00018",
"experiments": [
{
"experimentId": "E2026A00042",
"section": "Revenue Dashboard",
"charts": [
{
"chartId": "chart_1",
"chartType": "CH00003",
"chartTitle": "Revenue by Region"
}
]
}
]
}
{
"success": false,
"error": "Request body must include a non-empty 'charts' array or 'sections' array with charts"
}
{
"error": "API key required"
}