---
title: "Depot dashboards"
description: "Every dashboards operation in the Depot API, with parameters, responses and code samples in six languages."
url: "https://support.outpostplatform.com/api/generated/depot/dashboards/"
product: "depot"
type: "reference"
status: "reviewed"
last_reviewed: 2026-11-11
source: "https://gitlab.com/outpostplatform/docs/-/edit/main/src/content/docs/api/generated/depot/dashboards.mdx"
license: "CC BY 4.0"
---

# Depot dashboards

Registers the dashboard console routes (D18).

This page is generated from the Depot route table. Every operation carries the permission it needs and the anchor an agent can link to.

### GET `/api/v1/console/dashboards` {#depot.dashboards.list}

**listDashboards lists the dashboards the caller may open on a face, with the one that opens by default and why.**

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `clientId` | query | string | No |  |
| `face` | query | string | No |  |
| `siteId` | query | string | No |  |

#### Responses

| Status | Body | Description |
| --- | --- | --- |
| `200` | `application/json`, ListResponse | Success. |
| `400` | `application/problem+json`, ProblemDetails | One or more validation errors occurred. |
| `401` | `application/problem+json`, ProblemDetails | Authentication is required. |
| `404` | `application/problem+json`, ProblemDetails | There are no practice dashboards here. |
| `500` | `application/problem+json`, ProblemDetails | Could not evaluate permissions. |
| `503` | `application/problem+json`, ProblemDetails | Dashboards are not available on this server. |

#### Request samples

```bash
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.
curl -X GET 'https://depot.example.com/api/v1/console/dashboards?clientId=<clientId>&face=<face>&siteId=<siteId>' \
  -H 'X-CSRF-Token: <csrf-token>' \
  -H 'Accept: application/json' \
  -b 'outpost_console=<console-session>'
```

```powershell
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

$headers = @{
    'X-CSRF-Token' = '<csrf-token>'
    'Accept' = 'application/json'
    'Cookie' = 'outpost_console=<console-session>'
}

$response = Invoke-RestMethod `
    -Method Get `
    -Uri 'https://depot.example.com/api/v1/console/dashboards?clientId=<clientId>&face=<face>&siteId=<siteId>' `
    -Headers $headers

$response | ConvertTo-Json -Depth 10
```

```python
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

import requests

url = "https://depot.example.com/api/v1/console/dashboards"
params = {
    "clientId": "<clientId>",
    "face": "<face>",
    "siteId": "<siteId>",
}
headers = {
    "X-CSRF-Token": "<csrf-token>",
    "Accept": "application/json",
}
cookies = {
    "outpost_console": "<console-session>",
}

response = requests.get(url, params=params, headers=headers, cookies=cookies, timeout=30)
response.raise_for_status()
print(response.json())
```

```go
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/console/dashboards?clientId=<clientId>&face=<face>&siteId=<siteId>", nil)
	if err != nil {
		log.Fatal(err)
	}

	req.Header.Set("X-CSRF-Token", "<csrf-token>")
	req.Header.Set("Accept", "application/json")
	req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status, string(out))
}
```

```ts
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
// The session cookie is set by signing in. A script cannot set it itself.

const url = new URL("https://depot.example.com/api/v1/console/dashboards");
url.searchParams.set("clientId", "<clientId>");
url.searchParams.set("face", "<face>");
url.searchParams.set("siteId", "<siteId>");

const response = await fetch(url, {
	method: "GET",
	headers: {
		"X-CSRF-Token": "<csrf-token>",
		"Accept": "application/json",
	},
	credentials: "include",
});

if (!response.ok) {
	throw new Error(`Request failed with status ${response.status}`);
}

const data = await response.json();
console.log(data);
```

```csharp
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.

using System;
using System.Net.Http;

using var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/console/dashboards?clientId=<clientId>&face=<face>&siteId=<siteId>");
request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

### POST `/api/v1/console/dashboards` {#depot.dashboards.create}

**createDashboard saves a new dashboard owned by the caller.**

A shared one needs dashboard:manage.

#### Request body

Required, sent as `application/json`.

#### Responses

| Status | Body | Description |
| --- | --- | --- |
| `200` | `application/json`, Detail | Success. |
| `400` | `application/problem+json`, ProblemDetails | One or more validation errors occurred. |
| `401` | `application/problem+json`, ProblemDetails | Authentication is required. |
| `403` | `application/problem+json`, ProblemDetails | Sharing dashboards and changing shared ones needs the Dashboards permission. |
| `500` | `application/problem+json`, ProblemDetails | Could not evaluate permissions. |
| `503` | `application/problem+json`, ProblemDetails | Dashboards are not available on this server. |

#### Request samples

```bash
# Sign in first. outpost_console is a session cookie, so send it with every request.
curl -X POST 'https://depot.example.com/api/v1/console/dashboards' \
  -H 'X-CSRF-Token: <csrf-token>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -b 'outpost_console=<console-session>' \
  --data '{
  "definition": {
    "range": {
      "from": "string",
      "preset": "string",
      "to": "string"
    },
    "version": 0,
    "widgets": [
      {
        "chart": "string",
        "compare": "string",
        "drill": false,
        "id": "string",
        "kind": "string",
        "layout": {
          "h": 0,
          "w": 0,
          "x": 0,
          "y": 0
        },
        "mine": false,
        "range": {
          "from": "string",
          "preset": "string",
          "to": "string"
        },
        "source": {
          "as": "count",
          "bucket": {
            "column": null,
            "unit": null
          },
          "columns": [],
          "dataset": "string",
          "filters": [],
          "groupBy": "string",
          "key": "string",
          "limit": 0,
          "metric": {
            "column": null,
            "op": null
          },
          "params": {
            "key": null
          },
          "query": {
            "key": null
          },
          "sort": [],
          "surface": "string",
          "type": "string",
          "viewId": "string",
          "viewName": "string"
        },
        "target": 0,
        "thresholds": {
          "bad": 0,
          "basis": "string",
          "direction": "string",
          "warn": 0
        },
        "title": "string"
      }
    ]
  },
  "face": "string",
  "name": "string",
  "roles": [
    "string"
  ],
  "sharing": "string"
}'
```

```powershell
# Sign in first. outpost_console is a session cookie, so send it with every request.

$headers = @{
    'X-CSRF-Token' = '<csrf-token>'
    'Accept' = 'application/json'
    'Content-Type' = 'application/json'
    'Cookie' = 'outpost_console=<console-session>'
}

$body = @'
{
  "definition": {
    "range": {
      "from": "string",
      "preset": "string",
      "to": "string"
    },
    "version": 0,
    "widgets": [
      {
        "chart": "string",
        "compare": "string",
        "drill": false,
        "id": "string",
        "kind": "string",
        "layout": {
          "h": 0,
          "w": 0,
          "x": 0,
          "y": 0
        },
        "mine": false,
        "range": {
          "from": "string",
          "preset": "string",
          "to": "string"
        },
        "source": {
          "as": "count",
          "bucket": {
            "column": null,
            "unit": null
          },
          "columns": [],
          "dataset": "string",
          "filters": [],
          "groupBy": "string",
          "key": "string",
          "limit": 0,
          "metric": {
            "column": null,
            "op": null
          },
          "params": {
            "key": null
          },
          "query": {
            "key": null
          },
          "sort": [],
          "surface": "string",
          "type": "string",
          "viewId": "string",
          "viewName": "string"
        },
        "target": 0,
        "thresholds": {
          "bad": 0,
          "basis": "string",
          "direction": "string",
          "warn": 0
        },
        "title": "string"
      }
    ]
  },
  "face": "string",
  "name": "string",
  "roles": [
    "string"
  ],
  "sharing": "string"
}
'@

$response = Invoke-RestMethod `
    -Method Post `
    -Uri 'https://depot.example.com/api/v1/console/dashboards' `
    -Headers $headers `
    -ContentType 'application/json' `
    -Body $body

$response | ConvertTo-Json -Depth 10
```

```python
# Sign in first. outpost_console is a session cookie, so send it with every request.

import requests

url = "https://depot.example.com/api/v1/console/dashboards"
headers = {
    "X-CSRF-Token": "<csrf-token>",
    "Accept": "application/json",
    "Content-Type": "application/json",
}
cookies = {
    "outpost_console": "<console-session>",
}
payload = {
    "definition": {
        "range": {
            "from": "string",
            "preset": "string",
            "to": "string",
        },
        "version": 0,
        "widgets": [
            {
                "chart": "string",
                "compare": "string",
                "drill": False,
                "id": "string",
                "kind": "string",
                "layout": {
                    "h": 0,
                    "w": 0,
                    "x": 0,
                    "y": 0,
                },
                "mine": False,
                "range": {
                    "from": "string",
                    "preset": "string",
                    "to": "string",
                },
                "source": {
                    "as": "count",
                    "bucket": {
                        "column": None,
                        "unit": None,
                    },
                    "columns": [],
                    "dataset": "string",
                    "filters": [],
                    "groupBy": "string",
                    "key": "string",
                    "limit": 0,
                    "metric": {
                        "column": None,
                        "op": None,
                    },
                    "params": {
                        "key": None,
                    },
                    "query": {
                        "key": None,
                    },
                    "sort": [],
                    "surface": "string",
                    "type": "string",
                    "viewId": "string",
                    "viewName": "string",
                },
                "target": 0,
                "thresholds": {
                    "bad": 0,
                    "basis": "string",
                    "direction": "string",
                    "warn": 0,
                },
                "title": "string",
            },
        ],
    },
    "face": "string",
    "name": "string",
    "roles": [
        "string",
    ],
    "sharing": "string",
}

response = requests.post(url, headers=headers, cookies=cookies, json=payload, timeout=30)
response.raise_for_status()
print(response.json())
```

```go
// Sign in first. outpost_console is a session cookie, so send it with every request.
package main

import (
	"bytes"
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	body := []byte(`{
  "definition": {
    "range": {
      "from": "string",
      "preset": "string",
      "to": "string"
    },
    "version": 0,
    "widgets": [
      {
        "chart": "string",
        "compare": "string",
        "drill": false,
        "id": "string",
        "kind": "string",
        "layout": {
          "h": 0,
          "w": 0,
          "x": 0,
          "y": 0
        },
        "mine": false,
        "range": {
          "from": "string",
          "preset": "string",
          "to": "string"
        },
        "source": {
          "as": "count",
          "bucket": {
            "column": null,
            "unit": null
          },
          "columns": [],
          "dataset": "string",
          "filters": [],
          "groupBy": "string",
          "key": "string",
          "limit": 0,
          "metric": {
            "column": null,
            "op": null
          },
          "params": {
            "key": null
          },
          "query": {
            "key": null
          },
          "sort": [],
          "surface": "string",
          "type": "string",
          "viewId": "string",
          "viewName": "string"
        },
        "target": 0,
        "thresholds": {
          "bad": 0,
          "basis": "string",
          "direction": "string",
          "warn": 0
        },
        "title": "string"
      }
    ]
  },
  "face": "string",
  "name": "string",
  "roles": [
    "string"
  ],
  "sharing": "string"
}`)

	req, err := http.NewRequest(http.MethodPost, "https://depot.example.com/api/v1/console/dashboards", bytes.NewReader(body))
	if err != nil {
		log.Fatal(err)
	}

	req.Header.Set("X-CSRF-Token", "<csrf-token>")
	req.Header.Set("Accept", "application/json")
	req.Header.Set("Content-Type", "application/json")
	req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status, string(out))
}
```

```ts
// Sign in first. outpost_console is a session cookie, so send it with every request.
// The session cookie is set by signing in. A script cannot set it itself.

const url = "https://depot.example.com/api/v1/console/dashboards";

const response = await fetch(url, {
	method: "POST",
	headers: {
		"X-CSRF-Token": "<csrf-token>",
		"Accept": "application/json",
		"Content-Type": "application/json",
	},
	credentials: "include",
	body: JSON.stringify({
		"definition": {
			"range": {
				"from": "string",
				"preset": "string",
				"to": "string"
			},
			"version": 0,
			"widgets": [
				{
					"chart": "string",
					"compare": "string",
					"drill": false,
					"id": "string",
					"kind": "string",
					"layout": {
						"h": 0,
						"w": 0,
						"x": 0,
						"y": 0
					},
					"mine": false,
					"range": {
						"from": "string",
						"preset": "string",
						"to": "string"
					},
					"source": {
						"as": "count",
						"bucket": {
							"column": null,
							"unit": null
						},
						"columns": [],
						"dataset": "string",
						"filters": [],
						"groupBy": "string",
						"key": "string",
						"limit": 0,
						"metric": {
							"column": null,
							"op": null
						},
						"params": {
							"key": null
						},
						"query": {
							"key": null
						},
						"sort": [],
						"surface": "string",
						"type": "string",
						"viewId": "string",
						"viewName": "string"
					},
					"target": 0,
					"thresholds": {
						"bad": 0,
						"basis": "string",
						"direction": "string",
						"warn": 0
					},
					"title": "string"
				}
			]
		},
		"face": "string",
		"name": "string",
		"roles": [
			"string"
		],
		"sharing": "string"
	}),
});

if (!response.ok) {
	throw new Error(`Request failed with status ${response.status}`);
}

const data = await response.json();
console.log(data);
```

```csharp
// Sign in first. outpost_console is a session cookie, so send it with every request.

using System;
using System.Net.Http;
using System.Text;

using var client = new HttpClient();

const string body = """
{
  "definition": {
    "range": {
      "from": "string",
      "preset": "string",
      "to": "string"
    },
    "version": 0,
    "widgets": [
      {
        "chart": "string",
        "compare": "string",
        "drill": false,
        "id": "string",
        "kind": "string",
        "layout": {
          "h": 0,
          "w": 0,
          "x": 0,
          "y": 0
        },
        "mine": false,
        "range": {
          "from": "string",
          "preset": "string",
          "to": "string"
        },
        "source": {
          "as": "count",
          "bucket": {
            "column": null,
            "unit": null
          },
          "columns": [],
          "dataset": "string",
          "filters": [],
          "groupBy": "string",
          "key": "string",
          "limit": 0,
          "metric": {
            "column": null,
            "op": null
          },
          "params": {
            "key": null
          },
          "query": {
            "key": null
          },
          "sort": [],
          "surface": "string",
          "type": "string",
          "viewId": "string",
          "viewName": "string"
        },
        "target": 0,
        "thresholds": {
          "bad": 0,
          "basis": "string",
          "direction": "string",
          "warn": 0
        },
        "title": "string"
      }
    ]
  },
  "face": "string",
  "name": "string",
  "roles": [
    "string"
  ],
  "sharing": "string"
}
""";

var request = new HttpRequestMessage(HttpMethod.Post, "https://depot.example.com/api/v1/console/dashboards");
request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
request.Content = new StringContent(body, Encoding.UTF8, "application/json");

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

### GET `/api/v1/console/dashboards/{id}` {#depot.dashboards.get}

**getDashboard reads one dashboard (or builtin) with its definition.**

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes |  |
| `clientId` | query | string | No |  |
| `face` | query | string | No |  |

#### Responses

| Status | Body | Description |
| --- | --- | --- |
| `200` | `application/json`, Detail | Success. |
| `400` | `application/problem+json`, ProblemDetails | One or more validation errors occurred. |
| `401` | `application/problem+json`, ProblemDetails | Authentication is required. |
| `404` | `application/problem+json`, ProblemDetails | No dashboard matches that id. |
| `500` | `application/problem+json`, ProblemDetails | Could not evaluate permissions. |
| `503` | `application/problem+json`, ProblemDetails | Dashboards are not available on this server. |

#### Request samples

```bash
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.
curl -X GET 'https://depot.example.com/api/v1/console/dashboards/<id>?clientId=<clientId>&face=<face>' \
  -H 'X-CSRF-Token: <csrf-token>' \
  -H 'Accept: application/json' \
  -b 'outpost_console=<console-session>'
```

```powershell
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

$headers = @{
    'X-CSRF-Token' = '<csrf-token>'
    'Accept' = 'application/json'
    'Cookie' = 'outpost_console=<console-session>'
}

$response = Invoke-RestMethod `
    -Method Get `
    -Uri 'https://depot.example.com/api/v1/console/dashboards/<id>?clientId=<clientId>&face=<face>' `
    -Headers $headers

$response | ConvertTo-Json -Depth 10
```

```python
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

import requests

url = "https://depot.example.com/api/v1/console/dashboards/<id>"
params = {
    "clientId": "<clientId>",
    "face": "<face>",
}
headers = {
    "X-CSRF-Token": "<csrf-token>",
    "Accept": "application/json",
}
cookies = {
    "outpost_console": "<console-session>",
}

response = requests.get(url, params=params, headers=headers, cookies=cookies, timeout=30)
response.raise_for_status()
print(response.json())
```

```go
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/console/dashboards/<id>?clientId=<clientId>&face=<face>", nil)
	if err != nil {
		log.Fatal(err)
	}

	req.Header.Set("X-CSRF-Token", "<csrf-token>")
	req.Header.Set("Accept", "application/json")
	req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status, string(out))
}
```

```ts
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
// The session cookie is set by signing in. A script cannot set it itself.

const url = new URL("https://depot.example.com/api/v1/console/dashboards/<id>");
url.searchParams.set("clientId", "<clientId>");
url.searchParams.set("face", "<face>");

const response = await fetch(url, {
	method: "GET",
	headers: {
		"X-CSRF-Token": "<csrf-token>",
		"Accept": "application/json",
	},
	credentials: "include",
});

if (!response.ok) {
	throw new Error(`Request failed with status ${response.status}`);
}

const data = await response.json();
console.log(data);
```

```csharp
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.

using System;
using System.Net.Http;

using var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/console/dashboards/<id>?clientId=<clientId>&face=<face>");
request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

### PUT `/api/v1/console/dashboards/{id}` {#depot.dashboards.update}

**updateDashboard replaces a dashboard's name, sharing, roles and definition.**

If-Match carries the rowVersion it was read at; a stale one is 409.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes |  |

#### Request body

Required, sent as `application/json`.

#### Responses

| Status | Body | Description |
| --- | --- | --- |
| `200` | `application/json`, Detail | Success. |
| `400` | `application/problem+json`, ProblemDetails | One or more validation errors occurred. |
| `401` | `application/problem+json`, ProblemDetails | Authentication is required. |
| `403` | `application/problem+json`, ProblemDetails | Sharing dashboards and changing shared ones needs the Dashboards permission. |
| `404` | `application/problem+json`, ProblemDetails | No dashboard matches that id. |
| `405` | `application/problem+json`, ProblemDetails | Built-in dashboards cannot be changed. Copy it to make your own. |
| `409` | `application/problem+json`, ProblemDetails | Someone else changed this dashboard. Reload it and try again. |
| `500` | `application/problem+json`, ProblemDetails | Could not evaluate permissions. |
| `503` | `application/problem+json`, ProblemDetails | Dashboards are not available on this server. |

#### Request samples

```bash
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.
curl -X PUT 'https://depot.example.com/api/v1/console/dashboards/<id>' \
  -H 'X-CSRF-Token: <csrf-token>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -b 'outpost_console=<console-session>' \
  --data '{
  "definition": {
    "range": {
      "from": "string",
      "preset": "string",
      "to": "string"
    },
    "version": 0,
    "widgets": [
      {
        "chart": "string",
        "compare": "string",
        "drill": false,
        "id": "string",
        "kind": "string",
        "layout": {
          "h": 0,
          "w": 0,
          "x": 0,
          "y": 0
        },
        "mine": false,
        "range": {
          "from": "string",
          "preset": "string",
          "to": "string"
        },
        "source": {
          "as": "count",
          "bucket": {
            "column": null,
            "unit": null
          },
          "columns": [],
          "dataset": "string",
          "filters": [],
          "groupBy": "string",
          "key": "string",
          "limit": 0,
          "metric": {
            "column": null,
            "op": null
          },
          "params": {
            "key": null
          },
          "query": {
            "key": null
          },
          "sort": [],
          "surface": "string",
          "type": "string",
          "viewId": "string",
          "viewName": "string"
        },
        "target": 0,
        "thresholds": {
          "bad": 0,
          "basis": "string",
          "direction": "string",
          "warn": 0
        },
        "title": "string"
      }
    ]
  },
  "face": "string",
  "name": "string",
  "roles": [
    "string"
  ],
  "sharing": "string"
}'
```

```powershell
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

$headers = @{
    'X-CSRF-Token' = '<csrf-token>'
    'Accept' = 'application/json'
    'Content-Type' = 'application/json'
    'Cookie' = 'outpost_console=<console-session>'
}

$body = @'
{
  "definition": {
    "range": {
      "from": "string",
      "preset": "string",
      "to": "string"
    },
    "version": 0,
    "widgets": [
      {
        "chart": "string",
        "compare": "string",
        "drill": false,
        "id": "string",
        "kind": "string",
        "layout": {
          "h": 0,
          "w": 0,
          "x": 0,
          "y": 0
        },
        "mine": false,
        "range": {
          "from": "string",
          "preset": "string",
          "to": "string"
        },
        "source": {
          "as": "count",
          "bucket": {
            "column": null,
            "unit": null
          },
          "columns": [],
          "dataset": "string",
          "filters": [],
          "groupBy": "string",
          "key": "string",
          "limit": 0,
          "metric": {
            "column": null,
            "op": null
          },
          "params": {
            "key": null
          },
          "query": {
            "key": null
          },
          "sort": [],
          "surface": "string",
          "type": "string",
          "viewId": "string",
          "viewName": "string"
        },
        "target": 0,
        "thresholds": {
          "bad": 0,
          "basis": "string",
          "direction": "string",
          "warn": 0
        },
        "title": "string"
      }
    ]
  },
  "face": "string",
  "name": "string",
  "roles": [
    "string"
  ],
  "sharing": "string"
}
'@

$response = Invoke-RestMethod `
    -Method Put `
    -Uri 'https://depot.example.com/api/v1/console/dashboards/<id>' `
    -Headers $headers `
    -ContentType 'application/json' `
    -Body $body

$response | ConvertTo-Json -Depth 10
```

```python
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

import requests

url = "https://depot.example.com/api/v1/console/dashboards/<id>"
headers = {
    "X-CSRF-Token": "<csrf-token>",
    "Accept": "application/json",
    "Content-Type": "application/json",
}
cookies = {
    "outpost_console": "<console-session>",
}
payload = {
    "definition": {
        "range": {
            "from": "string",
            "preset": "string",
            "to": "string",
        },
        "version": 0,
        "widgets": [
            {
                "chart": "string",
                "compare": "string",
                "drill": False,
                "id": "string",
                "kind": "string",
                "layout": {
                    "h": 0,
                    "w": 0,
                    "x": 0,
                    "y": 0,
                },
                "mine": False,
                "range": {
                    "from": "string",
                    "preset": "string",
                    "to": "string",
                },
                "source": {
                    "as": "count",
                    "bucket": {
                        "column": None,
                        "unit": None,
                    },
                    "columns": [],
                    "dataset": "string",
                    "filters": [],
                    "groupBy": "string",
                    "key": "string",
                    "limit": 0,
                    "metric": {
                        "column": None,
                        "op": None,
                    },
                    "params": {
                        "key": None,
                    },
                    "query": {
                        "key": None,
                    },
                    "sort": [],
                    "surface": "string",
                    "type": "string",
                    "viewId": "string",
                    "viewName": "string",
                },
                "target": 0,
                "thresholds": {
                    "bad": 0,
                    "basis": "string",
                    "direction": "string",
                    "warn": 0,
                },
                "title": "string",
            },
        ],
    },
    "face": "string",
    "name": "string",
    "roles": [
        "string",
    ],
    "sharing": "string",
}

response = requests.put(url, headers=headers, cookies=cookies, json=payload, timeout=30)
response.raise_for_status()
print(response.json())
```

```go
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
package main

import (
	"bytes"
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	body := []byte(`{
  "definition": {
    "range": {
      "from": "string",
      "preset": "string",
      "to": "string"
    },
    "version": 0,
    "widgets": [
      {
        "chart": "string",
        "compare": "string",
        "drill": false,
        "id": "string",
        "kind": "string",
        "layout": {
          "h": 0,
          "w": 0,
          "x": 0,
          "y": 0
        },
        "mine": false,
        "range": {
          "from": "string",
          "preset": "string",
          "to": "string"
        },
        "source": {
          "as": "count",
          "bucket": {
            "column": null,
            "unit": null
          },
          "columns": [],
          "dataset": "string",
          "filters": [],
          "groupBy": "string",
          "key": "string",
          "limit": 0,
          "metric": {
            "column": null,
            "op": null
          },
          "params": {
            "key": null
          },
          "query": {
            "key": null
          },
          "sort": [],
          "surface": "string",
          "type": "string",
          "viewId": "string",
          "viewName": "string"
        },
        "target": 0,
        "thresholds": {
          "bad": 0,
          "basis": "string",
          "direction": "string",
          "warn": 0
        },
        "title": "string"
      }
    ]
  },
  "face": "string",
  "name": "string",
  "roles": [
    "string"
  ],
  "sharing": "string"
}`)

	req, err := http.NewRequest(http.MethodPut, "https://depot.example.com/api/v1/console/dashboards/<id>", bytes.NewReader(body))
	if err != nil {
		log.Fatal(err)
	}

	req.Header.Set("X-CSRF-Token", "<csrf-token>")
	req.Header.Set("Accept", "application/json")
	req.Header.Set("Content-Type", "application/json")
	req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status, string(out))
}
```

```ts
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
// The session cookie is set by signing in. A script cannot set it itself.

const url = "https://depot.example.com/api/v1/console/dashboards/<id>";

const response = await fetch(url, {
	method: "PUT",
	headers: {
		"X-CSRF-Token": "<csrf-token>",
		"Accept": "application/json",
		"Content-Type": "application/json",
	},
	credentials: "include",
	body: JSON.stringify({
		"definition": {
			"range": {
				"from": "string",
				"preset": "string",
				"to": "string"
			},
			"version": 0,
			"widgets": [
				{
					"chart": "string",
					"compare": "string",
					"drill": false,
					"id": "string",
					"kind": "string",
					"layout": {
						"h": 0,
						"w": 0,
						"x": 0,
						"y": 0
					},
					"mine": false,
					"range": {
						"from": "string",
						"preset": "string",
						"to": "string"
					},
					"source": {
						"as": "count",
						"bucket": {
							"column": null,
							"unit": null
						},
						"columns": [],
						"dataset": "string",
						"filters": [],
						"groupBy": "string",
						"key": "string",
						"limit": 0,
						"metric": {
							"column": null,
							"op": null
						},
						"params": {
							"key": null
						},
						"query": {
							"key": null
						},
						"sort": [],
						"surface": "string",
						"type": "string",
						"viewId": "string",
						"viewName": "string"
					},
					"target": 0,
					"thresholds": {
						"bad": 0,
						"basis": "string",
						"direction": "string",
						"warn": 0
					},
					"title": "string"
				}
			]
		},
		"face": "string",
		"name": "string",
		"roles": [
			"string"
		],
		"sharing": "string"
	}),
});

if (!response.ok) {
	throw new Error(`Request failed with status ${response.status}`);
}

const data = await response.json();
console.log(data);
```

```csharp
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.

using System;
using System.Net.Http;
using System.Text;

using var client = new HttpClient();

const string body = """
{
  "definition": {
    "range": {
      "from": "string",
      "preset": "string",
      "to": "string"
    },
    "version": 0,
    "widgets": [
      {
        "chart": "string",
        "compare": "string",
        "drill": false,
        "id": "string",
        "kind": "string",
        "layout": {
          "h": 0,
          "w": 0,
          "x": 0,
          "y": 0
        },
        "mine": false,
        "range": {
          "from": "string",
          "preset": "string",
          "to": "string"
        },
        "source": {
          "as": "count",
          "bucket": {
            "column": null,
            "unit": null
          },
          "columns": [],
          "dataset": "string",
          "filters": [],
          "groupBy": "string",
          "key": "string",
          "limit": 0,
          "metric": {
            "column": null,
            "op": null
          },
          "params": {
            "key": null
          },
          "query": {
            "key": null
          },
          "sort": [],
          "surface": "string",
          "type": "string",
          "viewId": "string",
          "viewName": "string"
        },
        "target": 0,
        "thresholds": {
          "bad": 0,
          "basis": "string",
          "direction": "string",
          "warn": 0
        },
        "title": "string"
      }
    ]
  },
  "face": "string",
  "name": "string",
  "roles": [
    "string"
  ],
  "sharing": "string"
}
""";

var request = new HttpRequestMessage(HttpMethod.Put, "https://depot.example.com/api/v1/console/dashboards/<id>");
request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
request.Content = new StringContent(body, Encoding.UTF8, "application/json");

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

### DELETE `/api/v1/console/dashboards/{id}` {#depot.dashboards.delete}

**deleteDashboard removes a dashboard (soft delete).**

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes |  |

#### Responses

| Status | Body | Description |
| --- | --- | --- |
| `204` | None | Success, with no body. |
| `400` | `application/problem+json`, ProblemDetails | One or more validation errors occurred. |
| `401` | `application/problem+json`, ProblemDetails | Authentication is required. |
| `403` | `application/problem+json`, ProblemDetails | Sharing dashboards and changing shared ones needs the Dashboards permission. |
| `404` | `application/problem+json`, ProblemDetails | No dashboard matches that id. |
| `405` | `application/problem+json`, ProblemDetails | Built-in dashboards cannot be changed. Copy it to make your own. |
| `500` | `application/problem+json`, ProblemDetails | Could not evaluate permissions. |
| `503` | `application/problem+json`, ProblemDetails | Dashboards are not available on this server. |

#### Request samples

```bash
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.
curl -X DELETE 'https://depot.example.com/api/v1/console/dashboards/<id>' \
  -H 'X-CSRF-Token: <csrf-token>' \
  -H 'Accept: application/json' \
  -b 'outpost_console=<console-session>'
```

```powershell
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

$headers = @{
    'X-CSRF-Token' = '<csrf-token>'
    'Accept' = 'application/json'
    'Cookie' = 'outpost_console=<console-session>'
}

$response = Invoke-RestMethod `
    -Method Delete `
    -Uri 'https://depot.example.com/api/v1/console/dashboards/<id>' `
    -Headers $headers

$response | ConvertTo-Json -Depth 10
```

```python
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

import requests

url = "https://depot.example.com/api/v1/console/dashboards/<id>"
headers = {
    "X-CSRF-Token": "<csrf-token>",
    "Accept": "application/json",
}
cookies = {
    "outpost_console": "<console-session>",
}

response = requests.delete(url, headers=headers, cookies=cookies, timeout=30)
response.raise_for_status()
print(response.json())
```

```go
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	req, err := http.NewRequest(http.MethodDelete, "https://depot.example.com/api/v1/console/dashboards/<id>", nil)
	if err != nil {
		log.Fatal(err)
	}

	req.Header.Set("X-CSRF-Token", "<csrf-token>")
	req.Header.Set("Accept", "application/json")
	req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status, string(out))
}
```

```ts
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
// The session cookie is set by signing in. A script cannot set it itself.

const url = "https://depot.example.com/api/v1/console/dashboards/<id>";

const response = await fetch(url, {
	method: "DELETE",
	headers: {
		"X-CSRF-Token": "<csrf-token>",
		"Accept": "application/json",
	},
	credentials: "include",
});

if (!response.ok) {
	throw new Error(`Request failed with status ${response.status}`);
}

const data = await response.json();
console.log(data);
```

```csharp
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.

using System;
using System.Net.Http;

using var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Delete, "https://depot.example.com/api/v1/console/dashboards/<id>");
request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

### POST `/api/v1/console/dashboards/{id}/copy` {#depot.dashboards.copy}

**copyDashboard makes a private copy of a dashboard or builtin the caller can open, named "`&lt;name>` (copy)" unless a name is sent.**

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes |  |
| `clientId` | query | string | No |  |
| `face` | query | string | No |  |

#### Request body

Required, sent as `application/json`.

#### Responses

| Status | Body | Description |
| --- | --- | --- |
| `200` | `application/json`, Detail | Success. |
| `400` | `application/problem+json`, ProblemDetails | One or more validation errors occurred. |
| `401` | `application/problem+json`, ProblemDetails | Authentication is required. |
| `404` | `application/problem+json`, ProblemDetails | No dashboard matches that id. |
| `500` | `application/problem+json`, ProblemDetails | Could not evaluate permissions. |
| `503` | `application/problem+json`, ProblemDetails | Dashboards are not available on this server. |

#### Request samples

```bash
# Sign in first. outpost_console is a session cookie, so send it with every request.
curl -X POST 'https://depot.example.com/api/v1/console/dashboards/<id>/copy?clientId=<clientId>&face=<face>' \
  -H 'X-CSRF-Token: <csrf-token>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -b 'outpost_console=<console-session>' \
  --data '{
  "name": "string"
}'
```

```powershell
# Sign in first. outpost_console is a session cookie, so send it with every request.

$headers = @{
    'X-CSRF-Token' = '<csrf-token>'
    'Accept' = 'application/json'
    'Content-Type' = 'application/json'
    'Cookie' = 'outpost_console=<console-session>'
}

$body = @'
{
  "name": "string"
}
'@

$response = Invoke-RestMethod `
    -Method Post `
    -Uri 'https://depot.example.com/api/v1/console/dashboards/<id>/copy?clientId=<clientId>&face=<face>' `
    -Headers $headers `
    -ContentType 'application/json' `
    -Body $body

$response | ConvertTo-Json -Depth 10
```

```python
# Sign in first. outpost_console is a session cookie, so send it with every request.

import requests

url = "https://depot.example.com/api/v1/console/dashboards/<id>/copy"
params = {
    "clientId": "<clientId>",
    "face": "<face>",
}
headers = {
    "X-CSRF-Token": "<csrf-token>",
    "Accept": "application/json",
    "Content-Type": "application/json",
}
cookies = {
    "outpost_console": "<console-session>",
}
payload = {
    "name": "string",
}

response = requests.post(url, params=params, headers=headers, cookies=cookies, json=payload, timeout=30)
response.raise_for_status()
print(response.json())
```

```go
// Sign in first. outpost_console is a session cookie, so send it with every request.
package main

import (
	"bytes"
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	body := []byte(`{
  "name": "string"
}`)

	req, err := http.NewRequest(http.MethodPost, "https://depot.example.com/api/v1/console/dashboards/<id>/copy?clientId=<clientId>&face=<face>", bytes.NewReader(body))
	if err != nil {
		log.Fatal(err)
	}

	req.Header.Set("X-CSRF-Token", "<csrf-token>")
	req.Header.Set("Accept", "application/json")
	req.Header.Set("Content-Type", "application/json")
	req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status, string(out))
}
```

```ts
// Sign in first. outpost_console is a session cookie, so send it with every request.
// The session cookie is set by signing in. A script cannot set it itself.

const url = new URL("https://depot.example.com/api/v1/console/dashboards/<id>/copy");
url.searchParams.set("clientId", "<clientId>");
url.searchParams.set("face", "<face>");

const response = await fetch(url, {
	method: "POST",
	headers: {
		"X-CSRF-Token": "<csrf-token>",
		"Accept": "application/json",
		"Content-Type": "application/json",
	},
	credentials: "include",
	body: JSON.stringify({
		"name": "string"
	}),
});

if (!response.ok) {
	throw new Error(`Request failed with status ${response.status}`);
}

const data = await response.json();
console.log(data);
```

```csharp
// Sign in first. outpost_console is a session cookie, so send it with every request.

using System;
using System.Net.Http;
using System.Text;

using var client = new HttpClient();

const string body = """
{
  "name": "string"
}
""";

var request = new HttpRequestMessage(HttpMethod.Post, "https://depot.example.com/api/v1/console/dashboards/<id>/copy?clientId=<clientId>&face=<face>");
request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
request.Content = new StringContent(body, Encoding.UTF8, "application/json");

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

### GET `/api/v1/console/dashboards/{id}/data` {#depot.dashboards.data}

**dashboardData reads a dashboard's widgets for the caller (D7).**

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes |  |
| `clientId` | query | string | No |  |
| `face` | query | string | No |  |
| `from` | query | string | No |  |
| `range` | query | string | No |  |
| `siteId` | query | string | No |  |
| `to` | query | string | No |  |
| `tz` | query | string | No |  |
| `widgets` | query | string | No |  |

#### Responses

| Status | Body | Description |
| --- | --- | --- |
| `200` | `application/json`, Data | Success. |
| `400` | `application/problem+json`, ProblemDetails | One or more validation errors occurred. |
| `401` | `application/problem+json`, ProblemDetails | Authentication is required. |
| `404` | `application/problem+json`, ProblemDetails | No dashboard matches that id. |
| `500` | `application/problem+json`, ProblemDetails | Could not evaluate permissions. |
| `503` | `application/problem+json`, ProblemDetails | Dashboards are not available on this server. |

#### Request samples

```bash
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.
curl -X GET 'https://depot.example.com/api/v1/console/dashboards/<id>/data?clientId=<clientId>&face=<face>&from=<from>&range=<range>&siteId=<siteId>&to=<to>' \
  -H 'X-CSRF-Token: <csrf-token>' \
  -H 'Accept: application/json' \
  -b 'outpost_console=<console-session>'
```

```powershell
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

$headers = @{
    'X-CSRF-Token' = '<csrf-token>'
    'Accept' = 'application/json'
    'Cookie' = 'outpost_console=<console-session>'
}

$response = Invoke-RestMethod `
    -Method Get `
    -Uri 'https://depot.example.com/api/v1/console/dashboards/<id>/data?clientId=<clientId>&face=<face>&from=<from>&range=<range>&siteId=<siteId>&to=<to>' `
    -Headers $headers

$response | ConvertTo-Json -Depth 10
```

```python
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

import requests

url = "https://depot.example.com/api/v1/console/dashboards/<id>/data"
params = {
    "clientId": "<clientId>",
    "face": "<face>",
    "from": "<from>",
    "range": "<range>",
    "siteId": "<siteId>",
    "to": "<to>",
}
headers = {
    "X-CSRF-Token": "<csrf-token>",
    "Accept": "application/json",
}
cookies = {
    "outpost_console": "<console-session>",
}

response = requests.get(url, params=params, headers=headers, cookies=cookies, timeout=30)
response.raise_for_status()
print(response.json())
```

```go
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/console/dashboards/<id>/data?clientId=<clientId>&face=<face>&from=<from>&range=<range>&siteId=<siteId>&to=<to>", nil)
	if err != nil {
		log.Fatal(err)
	}

	req.Header.Set("X-CSRF-Token", "<csrf-token>")
	req.Header.Set("Accept", "application/json")
	req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status, string(out))
}
```

```ts
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
// The session cookie is set by signing in. A script cannot set it itself.

const url = new URL("https://depot.example.com/api/v1/console/dashboards/<id>/data");
url.searchParams.set("clientId", "<clientId>");
url.searchParams.set("face", "<face>");
url.searchParams.set("from", "<from>");
url.searchParams.set("range", "<range>");
url.searchParams.set("siteId", "<siteId>");
url.searchParams.set("to", "<to>");

const response = await fetch(url, {
	method: "GET",
	headers: {
		"X-CSRF-Token": "<csrf-token>",
		"Accept": "application/json",
	},
	credentials: "include",
});

if (!response.ok) {
	throw new Error(`Request failed with status ${response.status}`);
}

const data = await response.json();
console.log(data);
```

```csharp
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.

using System;
using System.Net.Http;

using var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/console/dashboards/<id>/data?clientId=<clientId>&face=<face>&from=<from>&range=<range>&siteId=<siteId>&to=<to>");
request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

### GET `/api/v1/console/dashboards/catalog` {#depot.dashboards.catalog}

**dashboardCatalog lists what a widget can show on a face: the builtin widgets, the report datasets the caller may run, and the list surfaces a saved view can be pinned from.**

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `clientId` | query | string | No |  |
| `face` | query | string | No |  |

#### Responses

| Status | Body | Description |
| --- | --- | --- |
| `200` | `application/json`, Catalog | Success. |
| `400` | `application/problem+json`, ProblemDetails | One or more validation errors occurred. |
| `401` | `application/problem+json`, ProblemDetails | Authentication is required. |
| `404` | `application/problem+json`, ProblemDetails | There are no practice dashboards here. |
| `500` | `application/problem+json`, ProblemDetails | Could not evaluate permissions. |
| `503` | `application/problem+json`, ProblemDetails | Dashboards are not available on this server. |

#### Request samples

```bash
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.
curl -X GET 'https://depot.example.com/api/v1/console/dashboards/catalog?clientId=<clientId>&face=<face>' \
  -H 'X-CSRF-Token: <csrf-token>' \
  -H 'Accept: application/json' \
  -b 'outpost_console=<console-session>'
```

```powershell
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

$headers = @{
    'X-CSRF-Token' = '<csrf-token>'
    'Accept' = 'application/json'
    'Cookie' = 'outpost_console=<console-session>'
}

$response = Invoke-RestMethod `
    -Method Get `
    -Uri 'https://depot.example.com/api/v1/console/dashboards/catalog?clientId=<clientId>&face=<face>' `
    -Headers $headers

$response | ConvertTo-Json -Depth 10
```

```python
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

import requests

url = "https://depot.example.com/api/v1/console/dashboards/catalog"
params = {
    "clientId": "<clientId>",
    "face": "<face>",
}
headers = {
    "X-CSRF-Token": "<csrf-token>",
    "Accept": "application/json",
}
cookies = {
    "outpost_console": "<console-session>",
}

response = requests.get(url, params=params, headers=headers, cookies=cookies, timeout=30)
response.raise_for_status()
print(response.json())
```

```go
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/console/dashboards/catalog?clientId=<clientId>&face=<face>", nil)
	if err != nil {
		log.Fatal(err)
	}

	req.Header.Set("X-CSRF-Token", "<csrf-token>")
	req.Header.Set("Accept", "application/json")
	req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status, string(out))
}
```

```ts
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
// The session cookie is set by signing in. A script cannot set it itself.

const url = new URL("https://depot.example.com/api/v1/console/dashboards/catalog");
url.searchParams.set("clientId", "<clientId>");
url.searchParams.set("face", "<face>");

const response = await fetch(url, {
	method: "GET",
	headers: {
		"X-CSRF-Token": "<csrf-token>",
		"Accept": "application/json",
	},
	credentials: "include",
});

if (!response.ok) {
	throw new Error(`Request failed with status ${response.status}`);
}

const data = await response.json();
console.log(data);
```

```csharp
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.

using System;
using System.Net.Http;

using var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/console/dashboards/catalog?clientId=<clientId>&face=<face>");
request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

### GET `/api/v1/console/dashboards/defaults` {#depot.dashboards.getDefaults}

**getDefaults reads the practice, role, client and portal defaults for a face.**

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `clientId` | query | string | No |  |
| `face` | query | string | No |  |

#### Responses

| Status | Body | Description |
| --- | --- | --- |
| `200` | `application/json`, Defaults | Success. |
| `400` | `application/problem+json`, ProblemDetails | One or more validation errors occurred. |
| `401` | `application/problem+json`, ProblemDetails | Authentication is required. |
| `403` | `application/problem+json`, ProblemDetails | The identity does not hold dashboard:manage. |
| `404` | `application/problem+json`, ProblemDetails | There are no practice dashboards here. |
| `500` | `application/problem+json`, ProblemDetails | Could not evaluate permissions. |
| `503` | `application/problem+json`, ProblemDetails | Dashboards are not available on this server. |

#### Request samples

```bash
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.
curl -X GET 'https://depot.example.com/api/v1/console/dashboards/defaults?clientId=<clientId>&face=<face>' \
  -H 'X-CSRF-Token: <csrf-token>' \
  -H 'Accept: application/json' \
  -b 'outpost_console=<console-session>'
```

```powershell
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

$headers = @{
    'X-CSRF-Token' = '<csrf-token>'
    'Accept' = 'application/json'
    'Cookie' = 'outpost_console=<console-session>'
}

$response = Invoke-RestMethod `
    -Method Get `
    -Uri 'https://depot.example.com/api/v1/console/dashboards/defaults?clientId=<clientId>&face=<face>' `
    -Headers $headers

$response | ConvertTo-Json -Depth 10
```

```python
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

import requests

url = "https://depot.example.com/api/v1/console/dashboards/defaults"
params = {
    "clientId": "<clientId>",
    "face": "<face>",
}
headers = {
    "X-CSRF-Token": "<csrf-token>",
    "Accept": "application/json",
}
cookies = {
    "outpost_console": "<console-session>",
}

response = requests.get(url, params=params, headers=headers, cookies=cookies, timeout=30)
response.raise_for_status()
print(response.json())
```

```go
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/console/dashboards/defaults?clientId=<clientId>&face=<face>", nil)
	if err != nil {
		log.Fatal(err)
	}

	req.Header.Set("X-CSRF-Token", "<csrf-token>")
	req.Header.Set("Accept", "application/json")
	req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status, string(out))
}
```

```ts
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
// The session cookie is set by signing in. A script cannot set it itself.

const url = new URL("https://depot.example.com/api/v1/console/dashboards/defaults");
url.searchParams.set("clientId", "<clientId>");
url.searchParams.set("face", "<face>");

const response = await fetch(url, {
	method: "GET",
	headers: {
		"X-CSRF-Token": "<csrf-token>",
		"Accept": "application/json",
	},
	credentials: "include",
});

if (!response.ok) {
	throw new Error(`Request failed with status ${response.status}`);
}

const data = await response.json();
console.log(data);
```

```csharp
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.

using System;
using System.Net.Http;

using var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/console/dashboards/defaults?clientId=<clientId>&face=<face>");
request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

### PUT `/api/v1/console/dashboards/defaults` {#depot.dashboards.setDefaults}

**setDefaults changes the practice, role, client and portal defaults on a face (L26): practice and roles are replaced only when their key is sent; each clients and portal entry is an upsert for that client, and a null target clears it; clients not named are untouched.**

#### Request body

Required, sent as `application/json`.

The body is `object`.

#### Responses

| Status | Body | Description |
| --- | --- | --- |
| `200` | `application/json`, Defaults | Success. |
| `400` | `application/problem+json`, ProblemDetails | One or more validation errors occurred. |
| `401` | `application/problem+json`, ProblemDetails | Authentication is required. |
| `403` | `application/problem+json`, ProblemDetails | The identity does not hold dashboard:manage. |
| `500` | `application/problem+json`, ProblemDetails | Could not evaluate permissions. |
| `503` | `application/problem+json`, ProblemDetails | Dashboards are not available on this server. |

#### Request samples

```bash
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.
curl -X PUT 'https://depot.example.com/api/v1/console/dashboards/defaults' \
  -H 'X-CSRF-Token: <csrf-token>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -b 'outpost_console=<console-session>' \
  --data '{
  "key": "string"
}'
```

```powershell
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

$headers = @{
    'X-CSRF-Token' = '<csrf-token>'
    'Accept' = 'application/json'
    'Content-Type' = 'application/json'
    'Cookie' = 'outpost_console=<console-session>'
}

$body = @'
{
  "key": "string"
}
'@

$response = Invoke-RestMethod `
    -Method Put `
    -Uri 'https://depot.example.com/api/v1/console/dashboards/defaults' `
    -Headers $headers `
    -ContentType 'application/json' `
    -Body $body

$response | ConvertTo-Json -Depth 10
```

```python
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

import requests

url = "https://depot.example.com/api/v1/console/dashboards/defaults"
headers = {
    "X-CSRF-Token": "<csrf-token>",
    "Accept": "application/json",
    "Content-Type": "application/json",
}
cookies = {
    "outpost_console": "<console-session>",
}
payload = {
    "key": "string",
}

response = requests.put(url, headers=headers, cookies=cookies, json=payload, timeout=30)
response.raise_for_status()
print(response.json())
```

```go
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
package main

import (
	"bytes"
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	body := []byte(`{
  "key": "string"
}`)

	req, err := http.NewRequest(http.MethodPut, "https://depot.example.com/api/v1/console/dashboards/defaults", bytes.NewReader(body))
	if err != nil {
		log.Fatal(err)
	}

	req.Header.Set("X-CSRF-Token", "<csrf-token>")
	req.Header.Set("Accept", "application/json")
	req.Header.Set("Content-Type", "application/json")
	req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status, string(out))
}
```

```ts
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
// The session cookie is set by signing in. A script cannot set it itself.

const url = "https://depot.example.com/api/v1/console/dashboards/defaults";

const response = await fetch(url, {
	method: "PUT",
	headers: {
		"X-CSRF-Token": "<csrf-token>",
		"Accept": "application/json",
		"Content-Type": "application/json",
	},
	credentials: "include",
	body: JSON.stringify({
		"key": "string"
	}),
});

if (!response.ok) {
	throw new Error(`Request failed with status ${response.status}`);
}

const data = await response.json();
console.log(data);
```

```csharp
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.

using System;
using System.Net.Http;
using System.Text;

using var client = new HttpClient();

const string body = """
{
  "key": "string"
}
""";

var request = new HttpRequestMessage(HttpMethod.Put, "https://depot.example.com/api/v1/console/dashboards/defaults");
request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
request.Content = new StringContent(body, Encoding.UTF8, "application/json");

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

### PUT `/api/v1/console/dashboards/my-default` {#depot.dashboards.setMyDefault}

**setMyDefault sets or clears the caller's own default for a face.**

#### Request body

Required, sent as `application/json`.

#### Responses

| Status | Body | Description |
| --- | --- | --- |
| `204` | None | Success, with no body. |
| `400` | `application/problem+json`, ProblemDetails | One or more validation errors occurred. |
| `401` | `application/problem+json`, ProblemDetails | Authentication is required. |
| `500` | `application/problem+json`, ProblemDetails | Could not evaluate permissions. |
| `503` | `application/problem+json`, ProblemDetails | Dashboards are not available on this server. |

#### Request samples

```bash
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.
curl -X PUT 'https://depot.example.com/api/v1/console/dashboards/my-default' \
  -H 'X-CSRF-Token: <csrf-token>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -b 'outpost_console=<console-session>' \
  --data '{
  "face": "string",
  "target": {
    "builtinKey": "string",
    "dashboardId": "string"
  }
}'
```

```powershell
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

$headers = @{
    'X-CSRF-Token' = '<csrf-token>'
    'Accept' = 'application/json'
    'Content-Type' = 'application/json'
    'Cookie' = 'outpost_console=<console-session>'
}

$body = @'
{
  "face": "string",
  "target": {
    "builtinKey": "string",
    "dashboardId": "string"
  }
}
'@

$response = Invoke-RestMethod `
    -Method Put `
    -Uri 'https://depot.example.com/api/v1/console/dashboards/my-default' `
    -Headers $headers `
    -ContentType 'application/json' `
    -Body $body

$response | ConvertTo-Json -Depth 10
```

```python
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation is idempotent. Repeating it does not repeat its effect.

import requests

url = "https://depot.example.com/api/v1/console/dashboards/my-default"
headers = {
    "X-CSRF-Token": "<csrf-token>",
    "Accept": "application/json",
    "Content-Type": "application/json",
}
cookies = {
    "outpost_console": "<console-session>",
}
payload = {
    "face": "string",
    "target": {
        "builtinKey": "string",
        "dashboardId": "string",
    },
}

response = requests.put(url, headers=headers, cookies=cookies, json=payload, timeout=30)
response.raise_for_status()
print(response.json())
```

```go
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
package main

import (
	"bytes"
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	body := []byte(`{
  "face": "string",
  "target": {
    "builtinKey": "string",
    "dashboardId": "string"
  }
}`)

	req, err := http.NewRequest(http.MethodPut, "https://depot.example.com/api/v1/console/dashboards/my-default", bytes.NewReader(body))
	if err != nil {
		log.Fatal(err)
	}

	req.Header.Set("X-CSRF-Token", "<csrf-token>")
	req.Header.Set("Accept", "application/json")
	req.Header.Set("Content-Type", "application/json")
	req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status, string(out))
}
```

```ts
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.
// The session cookie is set by signing in. A script cannot set it itself.

const url = "https://depot.example.com/api/v1/console/dashboards/my-default";

const response = await fetch(url, {
	method: "PUT",
	headers: {
		"X-CSRF-Token": "<csrf-token>",
		"Accept": "application/json",
		"Content-Type": "application/json",
	},
	credentials: "include",
	body: JSON.stringify({
		"face": "string",
		"target": {
			"builtinKey": "string",
			"dashboardId": "string"
		}
	}),
});

if (!response.ok) {
	throw new Error(`Request failed with status ${response.status}`);
}

const data = await response.json();
console.log(data);
```

```csharp
// Sign in first. outpost_console is a session cookie, so send it with every request.
// This operation is idempotent. Repeating it does not repeat its effect.

using System;
using System.Net.Http;
using System.Text;

using var client = new HttpClient();

const string body = """
{
  "face": "string",
  "target": {
    "builtinKey": "string",
    "dashboardId": "string"
  }
}
""";

var request = new HttpRequestMessage(HttpMethod.Put, "https://depot.example.com/api/v1/console/dashboards/my-default");
request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
request.Content = new StringContent(body, Encoding.UTF8, "application/json");

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

### POST `/api/v1/console/dashboards/preview` {#depot.dashboards.preview}

**previewDashboard reads an unsaved definition, for the editor.**

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `clientId` | query | string | No |  |
| `from` | query | string | No |  |
| `range` | query | string | No |  |
| `siteId` | query | string | No |  |
| `to` | query | string | No |  |
| `tz` | query | string | No |  |
| `widgets` | query | string | No |  |

#### Request body

Required, sent as `application/json`.

#### Responses

| Status | Body | Description |
| --- | --- | --- |
| `200` | `application/json`, Data | Success. |
| `400` | `application/problem+json`, ProblemDetails | One or more validation errors occurred. |
| `401` | `application/problem+json`, ProblemDetails | Authentication is required. |
| `404` | `application/problem+json`, ProblemDetails | There are no practice dashboards here. |
| `500` | `application/problem+json`, ProblemDetails | Could not evaluate permissions. |
| `503` | `application/problem+json`, ProblemDetails | Dashboards are not available on this server. |

#### Request samples

```bash
# Sign in first. outpost_console is a session cookie, so send it with every request.
curl -X POST 'https://depot.example.com/api/v1/console/dashboards/preview?clientId=<clientId>&from=<from>&range=<range>&siteId=<siteId>&to=<to>&tz=<tz>' \
  -H 'X-CSRF-Token: <csrf-token>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -b 'outpost_console=<console-session>' \
  --data '{
  "definition": {
    "range": {
      "from": "string",
      "preset": "string",
      "to": "string"
    },
    "version": 0,
    "widgets": [
      {
        "chart": "string",
        "compare": "string",
        "drill": false,
        "id": "string",
        "kind": "string",
        "layout": {
          "h": 0,
          "w": 0,
          "x": 0,
          "y": 0
        },
        "mine": false,
        "range": {
          "from": "string",
          "preset": "string",
          "to": "string"
        },
        "source": {
          "as": "count",
          "bucket": {
            "column": null,
            "unit": null
          },
          "columns": [],
          "dataset": "string",
          "filters": [],
          "groupBy": "string",
          "key": "string",
          "limit": 0,
          "metric": {
            "column": null,
            "op": null
          },
          "params": {
            "key": null
          },
          "query": {
            "key": null
          },
          "sort": [],
          "surface": "string",
          "type": "string",
          "viewId": "string",
          "viewName": "string"
        },
        "target": 0,
        "thresholds": {
          "bad": 0,
          "basis": "string",
          "direction": "string",
          "warn": 0
        },
        "title": "string"
      }
    ]
  },
  "face": "string"
}'
```

```powershell
# Sign in first. outpost_console is a session cookie, so send it with every request.

$headers = @{
    'X-CSRF-Token' = '<csrf-token>'
    'Accept' = 'application/json'
    'Content-Type' = 'application/json'
    'Cookie' = 'outpost_console=<console-session>'
}

$body = @'
{
  "definition": {
    "range": {
      "from": "string",
      "preset": "string",
      "to": "string"
    },
    "version": 0,
    "widgets": [
      {
        "chart": "string",
        "compare": "string",
        "drill": false,
        "id": "string",
        "kind": "string",
        "layout": {
          "h": 0,
          "w": 0,
          "x": 0,
          "y": 0
        },
        "mine": false,
        "range": {
          "from": "string",
          "preset": "string",
          "to": "string"
        },
        "source": {
          "as": "count",
          "bucket": {
            "column": null,
            "unit": null
          },
          "columns": [],
          "dataset": "string",
          "filters": [],
          "groupBy": "string",
          "key": "string",
          "limit": 0,
          "metric": {
            "column": null,
            "op": null
          },
          "params": {
            "key": null
          },
          "query": {
            "key": null
          },
          "sort": [],
          "surface": "string",
          "type": "string",
          "viewId": "string",
          "viewName": "string"
        },
        "target": 0,
        "thresholds": {
          "bad": 0,
          "basis": "string",
          "direction": "string",
          "warn": 0
        },
        "title": "string"
      }
    ]
  },
  "face": "string"
}
'@

$response = Invoke-RestMethod `
    -Method Post `
    -Uri 'https://depot.example.com/api/v1/console/dashboards/preview?clientId=<clientId>&from=<from>&range=<range>&siteId=<siteId>&to=<to>&tz=<tz>' `
    -Headers $headers `
    -ContentType 'application/json' `
    -Body $body

$response | ConvertTo-Json -Depth 10
```

```python
# Sign in first. outpost_console is a session cookie, so send it with every request.

import requests

url = "https://depot.example.com/api/v1/console/dashboards/preview"
params = {
    "clientId": "<clientId>",
    "from": "<from>",
    "range": "<range>",
    "siteId": "<siteId>",
    "to": "<to>",
    "tz": "<tz>",
}
headers = {
    "X-CSRF-Token": "<csrf-token>",
    "Accept": "application/json",
    "Content-Type": "application/json",
}
cookies = {
    "outpost_console": "<console-session>",
}
payload = {
    "definition": {
        "range": {
            "from": "string",
            "preset": "string",
            "to": "string",
        },
        "version": 0,
        "widgets": [
            {
                "chart": "string",
                "compare": "string",
                "drill": False,
                "id": "string",
                "kind": "string",
                "layout": {
                    "h": 0,
                    "w": 0,
                    "x": 0,
                    "y": 0,
                },
                "mine": False,
                "range": {
                    "from": "string",
                    "preset": "string",
                    "to": "string",
                },
                "source": {
                    "as": "count",
                    "bucket": {
                        "column": None,
                        "unit": None,
                    },
                    "columns": [],
                    "dataset": "string",
                    "filters": [],
                    "groupBy": "string",
                    "key": "string",
                    "limit": 0,
                    "metric": {
                        "column": None,
                        "op": None,
                    },
                    "params": {
                        "key": None,
                    },
                    "query": {
                        "key": None,
                    },
                    "sort": [],
                    "surface": "string",
                    "type": "string",
                    "viewId": "string",
                    "viewName": "string",
                },
                "target": 0,
                "thresholds": {
                    "bad": 0,
                    "basis": "string",
                    "direction": "string",
                    "warn": 0,
                },
                "title": "string",
            },
        ],
    },
    "face": "string",
}

response = requests.post(url, params=params, headers=headers, cookies=cookies, json=payload, timeout=30)
response.raise_for_status()
print(response.json())
```

```go
// Sign in first. outpost_console is a session cookie, so send it with every request.
package main

import (
	"bytes"
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	body := []byte(`{
  "definition": {
    "range": {
      "from": "string",
      "preset": "string",
      "to": "string"
    },
    "version": 0,
    "widgets": [
      {
        "chart": "string",
        "compare": "string",
        "drill": false,
        "id": "string",
        "kind": "string",
        "layout": {
          "h": 0,
          "w": 0,
          "x": 0,
          "y": 0
        },
        "mine": false,
        "range": {
          "from": "string",
          "preset": "string",
          "to": "string"
        },
        "source": {
          "as": "count",
          "bucket": {
            "column": null,
            "unit": null
          },
          "columns": [],
          "dataset": "string",
          "filters": [],
          "groupBy": "string",
          "key": "string",
          "limit": 0,
          "metric": {
            "column": null,
            "op": null
          },
          "params": {
            "key": null
          },
          "query": {
            "key": null
          },
          "sort": [],
          "surface": "string",
          "type": "string",
          "viewId": "string",
          "viewName": "string"
        },
        "target": 0,
        "thresholds": {
          "bad": 0,
          "basis": "string",
          "direction": "string",
          "warn": 0
        },
        "title": "string"
      }
    ]
  },
  "face": "string"
}`)

	req, err := http.NewRequest(http.MethodPost, "https://depot.example.com/api/v1/console/dashboards/preview?clientId=<clientId>&from=<from>&range=<range>&siteId=<siteId>&to=<to>&tz=<tz>", bytes.NewReader(body))
	if err != nil {
		log.Fatal(err)
	}

	req.Header.Set("X-CSRF-Token", "<csrf-token>")
	req.Header.Set("Accept", "application/json")
	req.Header.Set("Content-Type", "application/json")
	req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status, string(out))
}
```

```ts
// Sign in first. outpost_console is a session cookie, so send it with every request.
// The session cookie is set by signing in. A script cannot set it itself.

const url = new URL("https://depot.example.com/api/v1/console/dashboards/preview");
url.searchParams.set("clientId", "<clientId>");
url.searchParams.set("from", "<from>");
url.searchParams.set("range", "<range>");
url.searchParams.set("siteId", "<siteId>");
url.searchParams.set("to", "<to>");
url.searchParams.set("tz", "<tz>");

const response = await fetch(url, {
	method: "POST",
	headers: {
		"X-CSRF-Token": "<csrf-token>",
		"Accept": "application/json",
		"Content-Type": "application/json",
	},
	credentials: "include",
	body: JSON.stringify({
		"definition": {
			"range": {
				"from": "string",
				"preset": "string",
				"to": "string"
			},
			"version": 0,
			"widgets": [
				{
					"chart": "string",
					"compare": "string",
					"drill": false,
					"id": "string",
					"kind": "string",
					"layout": {
						"h": 0,
						"w": 0,
						"x": 0,
						"y": 0
					},
					"mine": false,
					"range": {
						"from": "string",
						"preset": "string",
						"to": "string"
					},
					"source": {
						"as": "count",
						"bucket": {
							"column": null,
							"unit": null
						},
						"columns": [],
						"dataset": "string",
						"filters": [],
						"groupBy": "string",
						"key": "string",
						"limit": 0,
						"metric": {
							"column": null,
							"op": null
						},
						"params": {
							"key": null
						},
						"query": {
							"key": null
						},
						"sort": [],
						"surface": "string",
						"type": "string",
						"viewId": "string",
						"viewName": "string"
					},
					"target": 0,
					"thresholds": {
						"bad": 0,
						"basis": "string",
						"direction": "string",
						"warn": 0
					},
					"title": "string"
				}
			]
		},
		"face": "string"
	}),
});

if (!response.ok) {
	throw new Error(`Request failed with status ${response.status}`);
}

const data = await response.json();
console.log(data);
```

```csharp
// Sign in first. outpost_console is a session cookie, so send it with every request.

using System;
using System.Net.Http;
using System.Text;

using var client = new HttpClient();

const string body = """
{
  "definition": {
    "range": {
      "from": "string",
      "preset": "string",
      "to": "string"
    },
    "version": 0,
    "widgets": [
      {
        "chart": "string",
        "compare": "string",
        "drill": false,
        "id": "string",
        "kind": "string",
        "layout": {
          "h": 0,
          "w": 0,
          "x": 0,
          "y": 0
        },
        "mine": false,
        "range": {
          "from": "string",
          "preset": "string",
          "to": "string"
        },
        "source": {
          "as": "count",
          "bucket": {
            "column": null,
            "unit": null
          },
          "columns": [],
          "dataset": "string",
          "filters": [],
          "groupBy": "string",
          "key": "string",
          "limit": 0,
          "metric": {
            "column": null,
            "op": null
          },
          "params": {
            "key": null
          },
          "query": {
            "key": null
          },
          "sort": [],
          "surface": "string",
          "type": "string",
          "viewId": "string",
          "viewName": "string"
        },
        "target": 0,
        "thresholds": {
          "bad": 0,
          "basis": "string",
          "direction": "string",
          "warn": 0
        },
        "title": "string"
      }
    ]
  },
  "face": "string"
}
""";

var request = new HttpRequestMessage(HttpMethod.Post, "https://depot.example.com/api/v1/console/dashboards/preview?clientId=<clientId>&from=<from>&range=<range>&siteId=<siteId>&to=<to>&tz=<tz>");
request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
request.Content = new StringContent(body, Encoding.UTF8, "application/json");

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```
