Depot portaldashboard
Registers GET …/dashboard and …/dashboard/data.
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/portal/v1/orgs/{clientID}/dashboard
Section titled “GET /api/portal/v1/orgs/{clientID}/dashboard”GETportal facemspIdempotent
Source: [object Object]
portalDashboard answers the template’s name and its portal-safe definition.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
clientID | path | string | Yes |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, PortalDashboard | Success. |
404 | application/problem+json, ProblemDetails | This organization has no dashboard. |
500 | application/problem+json, ProblemDetails | Could not read the dashboard. |
200 response body
| Field | Type | Description |
|---|---|---|
definitionrequired | Definition | Definition is the stored dashboard ("Dashboard"."DefinitionJson"). |
definition.rangerequired | Range | Range is a preset, or custom with RFC3339 From and To. |
definition.range.from | string | |
definition.range.presetrequired | string | |
definition.range.to | string | |
definition.versionrequired | integer | |
definition.widgetsrequired | array of Widget | |
definition.widgets[].chart | string | |
definition.widgets[].compare | string | |
definition.widgets[].drill | boolean or null | |
definition.widgets[].idrequired | string | |
definition.widgets[].kindrequired | string | |
definition.widgets[].layoutrequired | Layout | Layout is library-neutral, on 12 columns (D16). |
definition.widgets[].layout.hrequired | integer | |
definition.widgets[].layout.wrequired | integer | |
definition.widgets[].layout.xrequired | integer | |
definition.widgets[].layout.yrequired | integer | |
definition.widgets[].mine | boolean | |
definition.widgets[].range | Range | Range is a preset, or custom with RFC3339 From and To. |
definition.widgets[].range.from | string | |
definition.widgets[].range.presetrequired | string | |
definition.widgets[].range.to | string | |
definition.widgets[].sourcerequired | Source | Source is one struct with a Type discriminator (D2). |
definition.widgets[].source.as | string, one of count, list | |
definition.widgets[].source.bucket | Bucket | Bucket mirrors reporting.Bucket without the time zone, which comes from the request (D3). |
definition.widgets[].source.columns | array of string | |
definition.widgets[].source.dataset | string | |
definition.widgets[].source.filters | array of Filter | |
definition.widgets[].source.groupBy | string | |
definition.widgets[].source.key | string | |
definition.widgets[].source.limit | integer | |
definition.widgets[].source.metric | Metric | Metric mirrors reporting.Metric with JSON tags (D15). |
definition.widgets[].source.params | object | |
definition.widgets[].source.query | object | |
definition.widgets[].source.sort | array of SortKey | |
definition.widgets[].source.surface | string | |
definition.widgets[].source.typerequired | string | |
definition.widgets[].source.viewId | string | |
definition.widgets[].source.viewName | string | |
definition.widgets[].target | number or null | double. |
definition.widgets[].thresholds | Thresholds | Thresholds (D4). |
definition.widgets[].thresholds.badrequired | number | double. |
definition.widgets[].thresholds.basisrequired | string | |
definition.widgets[].thresholds.directionrequired | string | |
definition.widgets[].thresholds.warnrequired | number | double. |
definition.widgets[].titlerequired | string | |
namerequired | string |
Request samples
Section titled “Request samples”# Sign in first. __Host-portal_session 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/portal/v1/orgs/<clientID>/dashboard' \ -H 'X-Csrf-Token: <portal-csrf>' \ -H 'Accept: application/json' \ -b '__Host-portal_session=<portal-session>'# Sign in first. __Host-portal_session 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' = '<portal-csrf>' 'Accept' = 'application/json' 'Cookie' = '__Host-portal_session=<portal-session>'}
$response = Invoke-RestMethod ` -Method Get ` -Uri 'https://depot.example.com/api/portal/v1/orgs/<clientID>/dashboard' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. __Host-portal_session 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/portal/v1/orgs/<clientID>/dashboard"headers = { "X-Csrf-Token": "<portal-csrf>", "Accept": "application/json",}cookies = { "__Host-portal_session": "<portal-session>",}
response = requests.get(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. __Host-portal_session 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/portal/v1/orgs/<clientID>/dashboard", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-Csrf-Token", "<portal-csrf>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "__Host-portal_session", Value: "<portal-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))}// Sign in first. __Host-portal_session 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/portal/v1/orgs/<clientID>/dashboard";
const response = await fetch(url, { method: "GET", headers: { "X-Csrf-Token": "<portal-csrf>", "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);// Sign in first. __Host-portal_session 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/portal/v1/orgs/<clientID>/dashboard");request.Headers.TryAddWithoutValidation("X-Csrf-Token", "<portal-csrf>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "__Host-portal_session=<portal-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());GET /api/portal/v1/orgs/{clientID}/dashboard/data
Section titled “GET /api/portal/v1/orgs/{clientID}/dashboard/data”GETportal facemspIdempotent
Source: [object Object]
portalDashboardData answers the D7 body for the org, read as the member.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
clientID | path | string | Yes | |
from | query | string | No | |
range | query | string | No | |
to | query | string | No | |
tz | query | string | No |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, Data | Success. |
404 | application/problem+json, ProblemDetails | This organization has no dashboard. |
500 | application/problem+json, ProblemDetails | Could not read the dashboard. |
200 response body
| Field | Type | Description |
|---|---|---|
fleetEmpty | boolean | |
generatedAtrequired | string (date-time) | |
rangerequired | DataRange | DataRange is the resolved dashboard range. |
range.fromrequired | string (date-time) | |
range.torequired | string (date-time) | |
scoperequired | DataScope | DataScope drives the "9 of 12 clients" banner. |
scope.clientName | string | |
scope.clientsrequired | integer | |
scope.kindrequired | string, one of client, practice | |
scope.unavailableClientsrequired | array of string | |
widgetsrequired | object |
Request samples
Section titled “Request samples”# Sign in first. __Host-portal_session 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/portal/v1/orgs/<clientID>/dashboard/data?from=<from>&range=<range>&to=<to>&tz=<tz>' \ -H 'X-Csrf-Token: <portal-csrf>' \ -H 'Accept: application/json' \ -b '__Host-portal_session=<portal-session>'# Sign in first. __Host-portal_session 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' = '<portal-csrf>' 'Accept' = 'application/json' 'Cookie' = '__Host-portal_session=<portal-session>'}
$response = Invoke-RestMethod ` -Method Get ` -Uri 'https://depot.example.com/api/portal/v1/orgs/<clientID>/dashboard/data?from=<from>&range=<range>&to=<to>&tz=<tz>' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. __Host-portal_session 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/portal/v1/orgs/<clientID>/dashboard/data"params = { "from": "<from>", "range": "<range>", "to": "<to>", "tz": "<tz>",}headers = { "X-Csrf-Token": "<portal-csrf>", "Accept": "application/json",}cookies = { "__Host-portal_session": "<portal-session>",}
response = requests.get(url, params=params, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. __Host-portal_session 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/portal/v1/orgs/<clientID>/dashboard/data?from=<from>&range=<range>&to=<to>&tz=<tz>", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-Csrf-Token", "<portal-csrf>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "__Host-portal_session", Value: "<portal-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))}// Sign in first. __Host-portal_session 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/portal/v1/orgs/<clientID>/dashboard/data");url.searchParams.set("from", "<from>");url.searchParams.set("range", "<range>");url.searchParams.set("to", "<to>");url.searchParams.set("tz", "<tz>");
const response = await fetch(url, { method: "GET", headers: { "X-Csrf-Token": "<portal-csrf>", "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);// Sign in first. __Host-portal_session 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/portal/v1/orgs/<clientID>/dashboard/data?from=<from>&range=<range>&to=<to>&tz=<tz>");request.Headers.TryAddWithoutValidation("X-Csrf-Token", "<portal-csrf>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "__Host-portal_session=<portal-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());Content is licensed CC BY 4.0. Code samples are MIT. Outpost and the Outpost mark are trademarks of Outpost Business Solutions, PBC and are not covered by either license.