Build a dashboard from a measure list (preset)
curl --request POST \
--url https://api.upstackdata.com/accounts/api/dashboard/views/from-preset \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-pixel-id: <api-key>' \
--data '
{
"name": "NC + Meta Pulse",
"widgets": [
{
"measure": "core.new_customer_roas",
"title": "NC ROAS"
},
{
"measure": "core.new_customer_mer",
"title": "NC MER"
},
{
"measure": "meta.cpm",
"title": "Meta CPM"
}
]
}
'import requests
url = "https://api.upstackdata.com/accounts/api/dashboard/views/from-preset"
payload = {
"name": "NC + Meta Pulse",
"widgets": [
{
"measure": "core.new_customer_roas",
"title": "NC ROAS"
},
{
"measure": "core.new_customer_mer",
"title": "NC MER"
},
{
"measure": "meta.cpm",
"title": "Meta CPM"
}
]
}
headers = {
"x-api-key": "<api-key>",
"x-pixel-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-pixel-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'NC + Meta Pulse',
widgets: [
{measure: 'core.new_customer_roas', title: 'NC ROAS'},
{measure: 'core.new_customer_mer', title: 'NC MER'},
{measure: 'meta.cpm', title: 'Meta CPM'}
]
})
};
fetch('https://api.upstackdata.com/accounts/api/dashboard/views/from-preset', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.upstackdata.com/accounts/api/dashboard/views/from-preset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'NC + Meta Pulse',
'widgets' => [
[
'measure' => 'core.new_customer_roas',
'title' => 'NC ROAS'
],
[
'measure' => 'core.new_customer_mer',
'title' => 'NC MER'
],
[
'measure' => 'meta.cpm',
'title' => 'Meta CPM'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-pixel-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.upstackdata.com/accounts/api/dashboard/views/from-preset"
payload := strings.NewReader("{\n \"name\": \"NC + Meta Pulse\",\n \"widgets\": [\n {\n \"measure\": \"core.new_customer_roas\",\n \"title\": \"NC ROAS\"\n },\n {\n \"measure\": \"core.new_customer_mer\",\n \"title\": \"NC MER\"\n },\n {\n \"measure\": \"meta.cpm\",\n \"title\": \"Meta CPM\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-pixel-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.upstackdata.com/accounts/api/dashboard/views/from-preset")
.header("x-api-key", "<api-key>")
.header("x-pixel-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"NC + Meta Pulse\",\n \"widgets\": [\n {\n \"measure\": \"core.new_customer_roas\",\n \"title\": \"NC ROAS\"\n },\n {\n \"measure\": \"core.new_customer_mer\",\n \"title\": \"NC MER\"\n },\n {\n \"measure\": \"meta.cpm\",\n \"title\": \"Meta CPM\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upstackdata.com/accounts/api/dashboard/views/from-preset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-pixel-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"NC + Meta Pulse\",\n \"widgets\": [\n {\n \"measure\": \"core.new_customer_roas\",\n \"title\": \"NC ROAS\"\n },\n {\n \"measure\": \"core.new_customer_mer\",\n \"title\": \"NC MER\"\n },\n {\n \"measure\": \"meta.cpm\",\n \"title\": \"Meta CPM\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"dashboardView": {
"id": "<string>",
"pixelId": "<string>",
"name": "<string>",
"configuration": {
"attributionWindow": 123,
"dateRange": {
"start": "2026-04-01",
"end": "2026-04-30"
},
"grid": {
"maxWidth": 1200
},
"widgets": [
{
"id": "<string>",
"title": "<string>",
"layout": {
"x": 5,
"y": 1,
"rows": 2,
"columns": 6,
"minColumns": 2,
"maxColumns": 11,
"minRows": 2,
"maxRows": 123,
"static": true
},
"dataConfig": {
"measures": [
"<string>"
],
"dimensions": [
"<string>"
],
"filters": [
{}
]
},
"sourceWidgetId": "<string>"
}
],
"filters": {},
"sections": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"ordinal": 0,
"collapsed": true,
"hidden": true,
"widgets": [
{
"id": "<string>",
"title": "<string>",
"layout": {
"x": 5,
"y": 1,
"rows": 2,
"columns": 6,
"minColumns": 2,
"maxColumns": 11,
"minRows": 2,
"maxRows": 123,
"static": true
},
"dataConfig": {
"measures": [
"<string>"
],
"dimensions": [
"<string>"
],
"filters": [
{}
]
},
"sourceWidgetId": "<string>"
}
],
"settings": {
"pacing": true,
"theme": "<string>",
"backgroundColor": "<string>",
"filters": {
"and": [
{
"value": "<string>"
}
]
}
}
}
],
"defaultSettings": {
"pacing": true,
"theme": "<string>",
"backgroundColor": "<string>",
"filters": {
"and": [
{
"value": "<string>"
}
]
}
}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"updatedBy": "<string>",
"order": 123
}
}{
"message": "<string>",
"errors": [
{
"message": "<string>",
"key": "<string>",
"path": [
"<string>"
]
}
]
}{
"message": "<string>",
"errors": [
{
"message": "<string>",
"key": "<string>",
"path": [
"<string>"
]
}
]
}{
"message": "<string>",
"errors": [
{
"message": "<string>",
"key": "<string>",
"path": [
"<string>"
]
}
]
}DASHBOARDS
Build a dashboard from a measure list (preset)
High-level builder — pass a list of measures, get back a finished dashboard
with auto-laid-out widgets. The backend packs sparkline tiles 4-per-row in
the kpi-grid layout and fills in sensible defaults for attribution,
granularity, date range, and filters.
Required scope: dashboards:write.
Designed for AI-driven workflows (“make me a dashboard with NC ROAS, MER,
and Facebook CPM”). The
upstack dashboard view build CLI command wraps
this endpoint.
POST
/
accounts
/
api
/
dashboard
/
views
/
from-preset
Build a dashboard from a measure list (preset)
curl --request POST \
--url https://api.upstackdata.com/accounts/api/dashboard/views/from-preset \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-pixel-id: <api-key>' \
--data '
{
"name": "NC + Meta Pulse",
"widgets": [
{
"measure": "core.new_customer_roas",
"title": "NC ROAS"
},
{
"measure": "core.new_customer_mer",
"title": "NC MER"
},
{
"measure": "meta.cpm",
"title": "Meta CPM"
}
]
}
'import requests
url = "https://api.upstackdata.com/accounts/api/dashboard/views/from-preset"
payload = {
"name": "NC + Meta Pulse",
"widgets": [
{
"measure": "core.new_customer_roas",
"title": "NC ROAS"
},
{
"measure": "core.new_customer_mer",
"title": "NC MER"
},
{
"measure": "meta.cpm",
"title": "Meta CPM"
}
]
}
headers = {
"x-api-key": "<api-key>",
"x-pixel-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-pixel-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'NC + Meta Pulse',
widgets: [
{measure: 'core.new_customer_roas', title: 'NC ROAS'},
{measure: 'core.new_customer_mer', title: 'NC MER'},
{measure: 'meta.cpm', title: 'Meta CPM'}
]
})
};
fetch('https://api.upstackdata.com/accounts/api/dashboard/views/from-preset', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.upstackdata.com/accounts/api/dashboard/views/from-preset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'NC + Meta Pulse',
'widgets' => [
[
'measure' => 'core.new_customer_roas',
'title' => 'NC ROAS'
],
[
'measure' => 'core.new_customer_mer',
'title' => 'NC MER'
],
[
'measure' => 'meta.cpm',
'title' => 'Meta CPM'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-pixel-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.upstackdata.com/accounts/api/dashboard/views/from-preset"
payload := strings.NewReader("{\n \"name\": \"NC + Meta Pulse\",\n \"widgets\": [\n {\n \"measure\": \"core.new_customer_roas\",\n \"title\": \"NC ROAS\"\n },\n {\n \"measure\": \"core.new_customer_mer\",\n \"title\": \"NC MER\"\n },\n {\n \"measure\": \"meta.cpm\",\n \"title\": \"Meta CPM\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-pixel-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.upstackdata.com/accounts/api/dashboard/views/from-preset")
.header("x-api-key", "<api-key>")
.header("x-pixel-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"NC + Meta Pulse\",\n \"widgets\": [\n {\n \"measure\": \"core.new_customer_roas\",\n \"title\": \"NC ROAS\"\n },\n {\n \"measure\": \"core.new_customer_mer\",\n \"title\": \"NC MER\"\n },\n {\n \"measure\": \"meta.cpm\",\n \"title\": \"Meta CPM\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upstackdata.com/accounts/api/dashboard/views/from-preset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-pixel-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"NC + Meta Pulse\",\n \"widgets\": [\n {\n \"measure\": \"core.new_customer_roas\",\n \"title\": \"NC ROAS\"\n },\n {\n \"measure\": \"core.new_customer_mer\",\n \"title\": \"NC MER\"\n },\n {\n \"measure\": \"meta.cpm\",\n \"title\": \"Meta CPM\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"dashboardView": {
"id": "<string>",
"pixelId": "<string>",
"name": "<string>",
"configuration": {
"attributionWindow": 123,
"dateRange": {
"start": "2026-04-01",
"end": "2026-04-30"
},
"grid": {
"maxWidth": 1200
},
"widgets": [
{
"id": "<string>",
"title": "<string>",
"layout": {
"x": 5,
"y": 1,
"rows": 2,
"columns": 6,
"minColumns": 2,
"maxColumns": 11,
"minRows": 2,
"maxRows": 123,
"static": true
},
"dataConfig": {
"measures": [
"<string>"
],
"dimensions": [
"<string>"
],
"filters": [
{}
]
},
"sourceWidgetId": "<string>"
}
],
"filters": {},
"sections": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"ordinal": 0,
"collapsed": true,
"hidden": true,
"widgets": [
{
"id": "<string>",
"title": "<string>",
"layout": {
"x": 5,
"y": 1,
"rows": 2,
"columns": 6,
"minColumns": 2,
"maxColumns": 11,
"minRows": 2,
"maxRows": 123,
"static": true
},
"dataConfig": {
"measures": [
"<string>"
],
"dimensions": [
"<string>"
],
"filters": [
{}
]
},
"sourceWidgetId": "<string>"
}
],
"settings": {
"pacing": true,
"theme": "<string>",
"backgroundColor": "<string>",
"filters": {
"and": [
{
"value": "<string>"
}
]
}
}
}
],
"defaultSettings": {
"pacing": true,
"theme": "<string>",
"backgroundColor": "<string>",
"filters": {
"and": [
{
"value": "<string>"
}
]
}
}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"updatedBy": "<string>",
"order": 123
}
}{
"message": "<string>",
"errors": [
{
"message": "<string>",
"key": "<string>",
"path": [
"<string>"
]
}
]
}{
"message": "<string>",
"errors": [
{
"message": "<string>",
"key": "<string>",
"path": [
"<string>"
]
}
]
}{
"message": "<string>",
"errors": [
{
"message": "<string>",
"key": "<string>",
"path": [
"<string>"
]
}
]
}Authorizations
Your Upstack API key. Starts with upstack_.
The pixel id the request targets.
Body
application/json
Required string length:
1 - 200Minimum array length:
1Show child attributes
Show child attributes
Defaults to view.
Available options:
view, attribution_view, pnl_view Auto-layout strategy. Default kpi-grid.
Available options:
kpi-grid Show child attributes
Show child attributes
Available options:
none, second, minute, hour, day, week, month, quarter, year Defaults to the last 30 days.
Show child attributes
Show child attributes
Response
The created view.
Show child attributes
Show child attributes
Was this page helpful?
⌘I