---
title: Create Dashboard
description: Reference for the POST /console/v1/dashboards API endpoint.
product: general
token_estimate: 1721
---
# Create Dashboard

> For AI agents: a documentation index is available at [/llms.txt](/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

## Create Dashboard

**POST** `/console/v1/dashboards`

Full URL: `https://statsigapi.net/console/v1/dashboards`

Create Dashboard

## Authorizations

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| STATSIG-API-KEY | string | Yes | — | apiKey (header) |

## Body (application/json)

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| name | string | Yes | — | Constraints: min length: 1, max length: 200 |
| description | string | No | — | Constraints: max length: 10000 |
| defaults | object | No | — | — |
| defaults.date | object | No | — | — |
| defaults.date.value | integer | Yes | — | Constraints: format: int64, min: 0 |
| defaults.date.unit | string | Yes | — | Allowed values: day, week, month |
| defaults.granularity | string | No | — | Allowed values: auto, daily, weekly, monthly |
| widgets | oneOf[] | No | — | — |
| widgets.type | string | Yes | — | Allowed values: text, header, timeseries, funnel |
| widgets.title | string | Yes | — | — |
| widgets.content | string | No | — | — |
| widgets.width | integer | No | — | Constraints: min: 0, max: 12 |
| widgets.height | integer | No | — | Constraints: min: 0 |
| widgets.color | string | No | — | — |
| widgets.description | string | No | — | — |
| widgets.query | object | No | — | — |
| widgets.query.source | object | No | — | — |
| widgets.query.source.type | string | Yes | — | Allowed values: event |
| widgets.query.source.event_name | string | Yes | — | — |
| widgets.query.source.filters | object[] | No | — | — |
| widgets.query.source.filters.property | object | Yes | — | — |
| widgets.query.source.filters.property.key | string | Yes | — | — |
| widgets.query.source.filters.property.column | unknown | Yes | — | — |
| widgets.query.source.filters.operator | unknown | Yes | — | — |
| widgets.query.source.filters.values | string[] | No | [] | — |
| widgets.query.sources | object[] | No | — | — |
| widgets.query.sources.type | string | Yes | — | Allowed values: event |
| widgets.query.sources.event_name | string | Yes | — | — |
| widgets.query.sources.filters | object[] | No | — | — |
| widgets.query.sources.filters.property | object | Yes | — | — |
| widgets.query.sources.filters.property.key | string | Yes | — | — |
| widgets.query.sources.filters.property.column | unknown | Yes | — | — |
| widgets.query.sources.filters.operator | unknown | Yes | — | — |
| widgets.query.sources.filters.values | string[] | No | [] | — |
| widgets.query.aggregation | object | Yes | — | — |
| widgets.query.aggregation.type | unknown | Yes | — | — |
| widgets.query.aggregation.property | object | No | — | — |
| widgets.query.aggregation.property.key | string | Yes | — | — |
| widgets.query.aggregation.property.column | unknown | Yes | — | — |
| widgets.query.unit_type | string | No | — | — |
| widgets.query.group_bys | object[] | No | — | — |
| widgets.query.group_bys.key | string | Yes | — | — |
| widgets.query.group_bys.column | unknown | Yes | — | — |
| widgets.query.viz | object | No | — | — |
| widgets.query.viz.chart_type | unknown | Yes | — | — |
| widgets.query.steps | object[] | No | — | — |
| widgets.query.steps.event_name | string | Yes | — | — |
| widgets.query.steps.filters | object[] | No | — | — |
| widgets.query.steps.filters.property | object | Yes | — | — |
| widgets.query.steps.filters.property.key | string | Yes | — | — |
| widgets.query.steps.filters.property.column | unknown | Yes | — | — |
| widgets.query.steps.filters.operator | unknown | Yes | — | — |
| widgets.query.steps.filters.values | string[] | No | [] | — |
| widgets.query.conversion_window | object | No | — | — |
| widgets.query.conversion_window.value | integer | Yes | — | Constraints: min: 0 |
| widgets.query.conversion_window.unit | string | Yes | — | Allowed values: second, minute, hour, day |
| widgets.query.chart_type | string | No | — | Allowed values: conversion-rate, conversions |

## Response (application/json)

**200** — Create dashboard response

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| message | string | Yes | — | A simple string explaining the result of the operation. |
| data | object | Yes | — | — |
| data.id | string | Yes | — | — |
| data.dashboard_url | string | Yes | — | — |

```json
{
  "message": "Dashboard Created Successfully",
  "data": {
    "id": "dashboard_id",
    "dashboard_url": "https://console.statsig.com/company_id/dashboards/dashboard_id"
  }
}
```

## Code samples

### cURL

```bash
curl -X POST "https://statsigapi.net/console/v1/dashboards" \
  -H "Content-Type: application/json" \
  -H "STATSIG-API-KEY: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.post(
    "https://statsigapi.net/console/v1/dashboards",
    headers={
        "Content-Type": "application/json",
        "STATSIG-API-KEY": "YOUR_API_KEY"
    }
)
data = response.json()
```

### JavaScript

```javascript
const response = await fetch("https://statsigapi.net/console/v1/dashboards", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "STATSIG-API-KEY": "YOUR_API_KEY"
  }
});
const data = await response.json();
```

### PHP

```php
<?php
$ch = curl_init("https://statsigapi.net/console/v1/dashboards");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "STATSIG-API-KEY: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
```

### Go

```go
package main

import (
  "bytes"
  "net/http"
)

func main() {
req, _ := http.NewRequest("POST", "https://statsigapi.net/console/v1/dashboards", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("STATSIG-API-KEY", "YOUR_API_KEY")
  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()
}
```

### Java

```java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://statsigapi.net/console/v1/dashboards"))
      .method("POST", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
      .header("STATSIG-API-KEY", "YOUR_API_KEY")
      .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```ruby
require "net/http"
require "json"

uri = URI("https://statsigapi.net/console/v1/dashboards")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["STATSIG-API-KEY"] = "YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
```

