Skip to main content
POST
Required scope: dashboards:write The quickest way to make a dashboard from a script or an AI agent: pass the measures you want (“NC ROAS, NC MER, and Meta CPM”) and get back a finished view that opens in the web app. The upstack dashboard view build CLI command wraps this endpoint.

Layout

  • Widgets default to sparkline. Each sparkline is 3 columns wide and 1 row tall, and they fill rows of four in array order.
  • Any other chartType gets a full-width tile (12 columns, 4 rows) stacked below all the sparklines, in array order.
  • The view has a flat widget list and no sections. Rearrange it later in the web app or with Update a dashboard view.

Defaults

order is always 0.

Validation

  • Measure ids aren’t checked against the catalog. A typo is saved as a widget for a measure that doesn’t exist, so confirm ids with List available measures first. The same call returns each measure’s shortTitle, which makes a good title.
  • Titles are capped at 200 characters and name at 200.
  • Every call creates a new view, even with a name that already exists.

Authorizations

x-api-key
string
header
required

Your Upstack API key. Starts with upstack_.

x-pixel-id
string
header
required

The pixel id the request targets.

Body

application/json
name
string
required

Display name for the new view. Names don't have to be unique.

Required string length: 1 - 200
widgets
object[]
required

One entry per widget. Sparkline tiles fill rows of four in array order; other chart types stack below all the sparklines, full width, also in array order.

Minimum array length: 1
type
enum<string>

Defaults to view.

Available options:
view,
attribution_view,
pnl_view
layout
enum<string>

Auto-layout strategy. Default kpi-grid.

Available options:
kpi-grid
attribution
object

Attribution defaults saved with the view.

granularity
enum<string>

Defaults to day.

Available options:
none,
second,
minute,
hour,
day,
week,
month,
quarter,
year
dateRange
object

Defaults to 30 days ago through today (UTC).

Response

The created view.

dashboardView
object
required