Skip to main content
POST
Create a dashboard view
Required scope: dashboards:write Use this when you need control over the exact layout. A common case is copying a view between pixels: read it with Get a dashboard view using the source pixel’s key, then post its type, name, and configuration here with the destination pixel’s key. To get a dashboard from a list of measures without placing each widget yourself, use Build a dashboard from a measure list.

What the server checks

  • type, name (1 to 200 characters), and configuration are required. order defaults to 0.
  • Inside configuration, the top-level fields and each section’s fields are validated. Widget objects are saved exactly as sent, so check each widget’s layout and dataConfig yourself. widgets must be present, even as an empty array.
  • attributionModel: "last_touch" is accepted and saved as last_click.
  • Names don’t have to be unique, and every call creates a new view. Retrying a request that timed out can leave a duplicate, so list views before you retry.

Response

The new view, including its id. createdBy and updatedBy are empty strings, because writes made with an API key aren’t attributed to a user. type is always view. The dashboard type you sent comes back in sk.

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
type
enum<string>
required

Type of dashboard view.

  • view: the regular KPI dashboard.
  • attribution_view: the attribution dashboard.
  • pnl_view: the P&L dashboard.
Available options:
view,
attribution_view,
pnl_view
name
string
required

Display name. Doesn't have to be unique.

Required string length: 1 - 200
configuration
object
required

Everything the web app needs to render a view. The server checks the top-level fields and each section's fields, but stores widget objects as sent, so a malformed widget is saved without an error.

order
integer

Sort position among the pixel's views. Defaults to 0.

Response

Created view.

dashboardView
object
required