Create a dashboard view
curl --request POST \
--url https://api.upstackdata.com/accounts/api/dashboard/views \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-pixel-id: <api-key>' \
--data '
{
"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>"
}
]
}
}
},
"order": 123
}
'import requests
url = "https://api.upstackdata.com/accounts/api/dashboard/views"
payload = {
"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>" }] }
}
},
"order": 123
}
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: '<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>'}]}
}
},
order: 123
})
};
fetch('https://api.upstackdata.com/accounts/api/dashboard/views', 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",
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' => '<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>'
]
]
]
]
],
'order' => 123
]),
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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"configuration\": {\n \"attributionWindow\": 123,\n \"dateRange\": {\n \"start\": \"2026-04-01\",\n \"end\": \"2026-04-30\"\n },\n \"grid\": {\n \"maxWidth\": 1200\n },\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"layout\": {\n \"x\": 5,\n \"y\": 1,\n \"rows\": 2,\n \"columns\": 6,\n \"minColumns\": 2,\n \"maxColumns\": 11,\n \"minRows\": 2,\n \"maxRows\": 123,\n \"static\": true\n },\n \"dataConfig\": {\n \"measures\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {}\n ]\n },\n \"sourceWidgetId\": \"<string>\"\n }\n ],\n \"filters\": {},\n \"sections\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"ordinal\": 0,\n \"collapsed\": true,\n \"hidden\": true,\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"layout\": {\n \"x\": 5,\n \"y\": 1,\n \"rows\": 2,\n \"columns\": 6,\n \"minColumns\": 2,\n \"maxColumns\": 11,\n \"minRows\": 2,\n \"maxRows\": 123,\n \"static\": true\n },\n \"dataConfig\": {\n \"measures\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {}\n ]\n },\n \"sourceWidgetId\": \"<string>\"\n }\n ],\n \"settings\": {\n \"pacing\": true,\n \"theme\": \"<string>\",\n \"backgroundColor\": \"<string>\",\n \"filters\": {\n \"and\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n }\n }\n ],\n \"defaultSettings\": {\n \"pacing\": true,\n \"theme\": \"<string>\",\n \"backgroundColor\": \"<string>\",\n \"filters\": {\n \"and\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n }\n },\n \"order\": 123\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")
.header("x-api-key", "<api-key>")
.header("x-pixel-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"configuration\": {\n \"attributionWindow\": 123,\n \"dateRange\": {\n \"start\": \"2026-04-01\",\n \"end\": \"2026-04-30\"\n },\n \"grid\": {\n \"maxWidth\": 1200\n },\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"layout\": {\n \"x\": 5,\n \"y\": 1,\n \"rows\": 2,\n \"columns\": 6,\n \"minColumns\": 2,\n \"maxColumns\": 11,\n \"minRows\": 2,\n \"maxRows\": 123,\n \"static\": true\n },\n \"dataConfig\": {\n \"measures\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {}\n ]\n },\n \"sourceWidgetId\": \"<string>\"\n }\n ],\n \"filters\": {},\n \"sections\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"ordinal\": 0,\n \"collapsed\": true,\n \"hidden\": true,\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"layout\": {\n \"x\": 5,\n \"y\": 1,\n \"rows\": 2,\n \"columns\": 6,\n \"minColumns\": 2,\n \"maxColumns\": 11,\n \"minRows\": 2,\n \"maxRows\": 123,\n \"static\": true\n },\n \"dataConfig\": {\n \"measures\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {}\n ]\n },\n \"sourceWidgetId\": \"<string>\"\n }\n ],\n \"settings\": {\n \"pacing\": true,\n \"theme\": \"<string>\",\n \"backgroundColor\": \"<string>\",\n \"filters\": {\n \"and\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n }\n }\n ],\n \"defaultSettings\": {\n \"pacing\": true,\n \"theme\": \"<string>\",\n \"backgroundColor\": \"<string>\",\n \"filters\": {\n \"and\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n }\n },\n \"order\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upstackdata.com/accounts/api/dashboard/views")
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\": \"<string>\",\n \"configuration\": {\n \"attributionWindow\": 123,\n \"dateRange\": {\n \"start\": \"2026-04-01\",\n \"end\": \"2026-04-30\"\n },\n \"grid\": {\n \"maxWidth\": 1200\n },\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"layout\": {\n \"x\": 5,\n \"y\": 1,\n \"rows\": 2,\n \"columns\": 6,\n \"minColumns\": 2,\n \"maxColumns\": 11,\n \"minRows\": 2,\n \"maxRows\": 123,\n \"static\": true\n },\n \"dataConfig\": {\n \"measures\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {}\n ]\n },\n \"sourceWidgetId\": \"<string>\"\n }\n ],\n \"filters\": {},\n \"sections\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"ordinal\": 0,\n \"collapsed\": true,\n \"hidden\": true,\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"layout\": {\n \"x\": 5,\n \"y\": 1,\n \"rows\": 2,\n \"columns\": 6,\n \"minColumns\": 2,\n \"maxColumns\": 11,\n \"minRows\": 2,\n \"maxRows\": 123,\n \"static\": true\n },\n \"dataConfig\": {\n \"measures\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {}\n ]\n },\n \"sourceWidgetId\": \"<string>\"\n }\n ],\n \"settings\": {\n \"pacing\": true,\n \"theme\": \"<string>\",\n \"backgroundColor\": \"<string>\",\n \"filters\": {\n \"and\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n }\n }\n ],\n \"defaultSettings\": {\n \"pacing\": true,\n \"theme\": \"<string>\",\n \"backgroundColor\": \"<string>\",\n \"filters\": {\n \"and\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n }\n },\n \"order\": 123\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
Create a dashboard view
Create a dashboard view from a full DashboardViewConfiguration body. For
the high-level builder that auto-lays-out widgets from a measure list, see
the POST /api/dashboard/views/from-preset endpoint.
Required scope: dashboards:write.
createdBy and updatedBy on the resulting record are empty strings —
api-key writes intentionally don’t store a fake user id. Audit info
(apiKeyPk) is recorded in CloudWatch logs.
POST
/
accounts
/
api
/
dashboard
/
views
Create a dashboard view
curl --request POST \
--url https://api.upstackdata.com/accounts/api/dashboard/views \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-pixel-id: <api-key>' \
--data '
{
"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>"
}
]
}
}
},
"order": 123
}
'import requests
url = "https://api.upstackdata.com/accounts/api/dashboard/views"
payload = {
"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>" }] }
}
},
"order": 123
}
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: '<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>'}]}
}
},
order: 123
})
};
fetch('https://api.upstackdata.com/accounts/api/dashboard/views', 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",
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' => '<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>'
]
]
]
]
],
'order' => 123
]),
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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"configuration\": {\n \"attributionWindow\": 123,\n \"dateRange\": {\n \"start\": \"2026-04-01\",\n \"end\": \"2026-04-30\"\n },\n \"grid\": {\n \"maxWidth\": 1200\n },\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"layout\": {\n \"x\": 5,\n \"y\": 1,\n \"rows\": 2,\n \"columns\": 6,\n \"minColumns\": 2,\n \"maxColumns\": 11,\n \"minRows\": 2,\n \"maxRows\": 123,\n \"static\": true\n },\n \"dataConfig\": {\n \"measures\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {}\n ]\n },\n \"sourceWidgetId\": \"<string>\"\n }\n ],\n \"filters\": {},\n \"sections\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"ordinal\": 0,\n \"collapsed\": true,\n \"hidden\": true,\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"layout\": {\n \"x\": 5,\n \"y\": 1,\n \"rows\": 2,\n \"columns\": 6,\n \"minColumns\": 2,\n \"maxColumns\": 11,\n \"minRows\": 2,\n \"maxRows\": 123,\n \"static\": true\n },\n \"dataConfig\": {\n \"measures\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {}\n ]\n },\n \"sourceWidgetId\": \"<string>\"\n }\n ],\n \"settings\": {\n \"pacing\": true,\n \"theme\": \"<string>\",\n \"backgroundColor\": \"<string>\",\n \"filters\": {\n \"and\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n }\n }\n ],\n \"defaultSettings\": {\n \"pacing\": true,\n \"theme\": \"<string>\",\n \"backgroundColor\": \"<string>\",\n \"filters\": {\n \"and\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n }\n },\n \"order\": 123\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")
.header("x-api-key", "<api-key>")
.header("x-pixel-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"configuration\": {\n \"attributionWindow\": 123,\n \"dateRange\": {\n \"start\": \"2026-04-01\",\n \"end\": \"2026-04-30\"\n },\n \"grid\": {\n \"maxWidth\": 1200\n },\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"layout\": {\n \"x\": 5,\n \"y\": 1,\n \"rows\": 2,\n \"columns\": 6,\n \"minColumns\": 2,\n \"maxColumns\": 11,\n \"minRows\": 2,\n \"maxRows\": 123,\n \"static\": true\n },\n \"dataConfig\": {\n \"measures\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {}\n ]\n },\n \"sourceWidgetId\": \"<string>\"\n }\n ],\n \"filters\": {},\n \"sections\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"ordinal\": 0,\n \"collapsed\": true,\n \"hidden\": true,\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"layout\": {\n \"x\": 5,\n \"y\": 1,\n \"rows\": 2,\n \"columns\": 6,\n \"minColumns\": 2,\n \"maxColumns\": 11,\n \"minRows\": 2,\n \"maxRows\": 123,\n \"static\": true\n },\n \"dataConfig\": {\n \"measures\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {}\n ]\n },\n \"sourceWidgetId\": \"<string>\"\n }\n ],\n \"settings\": {\n \"pacing\": true,\n \"theme\": \"<string>\",\n \"backgroundColor\": \"<string>\",\n \"filters\": {\n \"and\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n }\n }\n ],\n \"defaultSettings\": {\n \"pacing\": true,\n \"theme\": \"<string>\",\n \"backgroundColor\": \"<string>\",\n \"filters\": {\n \"and\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n }\n },\n \"order\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upstackdata.com/accounts/api/dashboard/views")
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\": \"<string>\",\n \"configuration\": {\n \"attributionWindow\": 123,\n \"dateRange\": {\n \"start\": \"2026-04-01\",\n \"end\": \"2026-04-30\"\n },\n \"grid\": {\n \"maxWidth\": 1200\n },\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"layout\": {\n \"x\": 5,\n \"y\": 1,\n \"rows\": 2,\n \"columns\": 6,\n \"minColumns\": 2,\n \"maxColumns\": 11,\n \"minRows\": 2,\n \"maxRows\": 123,\n \"static\": true\n },\n \"dataConfig\": {\n \"measures\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {}\n ]\n },\n \"sourceWidgetId\": \"<string>\"\n }\n ],\n \"filters\": {},\n \"sections\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"ordinal\": 0,\n \"collapsed\": true,\n \"hidden\": true,\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"layout\": {\n \"x\": 5,\n \"y\": 1,\n \"rows\": 2,\n \"columns\": 6,\n \"minColumns\": 2,\n \"maxColumns\": 11,\n \"minRows\": 2,\n \"maxRows\": 123,\n \"static\": true\n },\n \"dataConfig\": {\n \"measures\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {}\n ]\n },\n \"sourceWidgetId\": \"<string>\"\n }\n ],\n \"settings\": {\n \"pacing\": true,\n \"theme\": \"<string>\",\n \"backgroundColor\": \"<string>\",\n \"filters\": {\n \"and\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n }\n }\n ],\n \"defaultSettings\": {\n \"pacing\": true,\n \"theme\": \"<string>\",\n \"backgroundColor\": \"<string>\",\n \"filters\": {\n \"and\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n }\n },\n \"order\": 123\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
Type of dashboard view.
view— the regular KPI dashboard.attribution_view— attribution-specific dashboard.pnl_view— P&L dashboard.
Available options:
view, attribution_view, pnl_view Required string length:
1 - 200Show child attributes
Show child attributes
Response
Created view.
Show child attributes
Show child attributes
Was this page helpful?
⌘I