dashboards
Create a dashboard
POST
/
api
/
v1
/
dashboards
Create a dashboard
curl --request POST \
--url https://api.example.com/api/v1/dashboards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"columns": 12,
"components": [
{
"chart": {
"chart_id": "abc-123"
},
"component_type": "chart",
"position": {
"col": 0,
"height": 4,
"row": 0,
"width": 8
}
},
{
"component_type": "key_value",
"key_value": {
"label": "Total runs today",
"unit": "runs",
"value": 2481
},
"position": {
"col": 8,
"height": 2,
"row": 0,
"width": 4
}
}
],
"slug": "agent-ops",
"title": "Agent operations"
}
'import requests
url = "https://api.example.com/api/v1/dashboards"
payload = {
"columns": 12,
"components": [
{
"chart": { "chart_id": "abc-123" },
"component_type": "chart",
"position": {
"col": 0,
"height": 4,
"row": 0,
"width": 8
}
},
{
"component_type": "key_value",
"key_value": {
"label": "Total runs today",
"unit": "runs",
"value": 2481
},
"position": {
"col": 8,
"height": 2,
"row": 0,
"width": 4
}
}
],
"slug": "agent-ops",
"title": "Agent operations"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
columns: 12,
components: [
{
chart: {chart_id: 'abc-123'},
component_type: 'chart',
position: {col: 0, height: 4, row: 0, width: 8}
},
{
component_type: 'key_value',
key_value: {label: 'Total runs today', unit: 'runs', value: 2481},
position: {col: 8, height: 2, row: 0, width: 4}
}
],
slug: 'agent-ops',
title: 'Agent operations'
})
};
fetch('https://api.example.com/api/v1/dashboards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/dashboards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'columns' => 12,
'components' => [
[
'chart' => [
'chart_id' => 'abc-123'
],
'component_type' => 'chart',
'position' => [
'col' => 0,
'height' => 4,
'row' => 0,
'width' => 8
]
],
[
'component_type' => 'key_value',
'key_value' => [
'label' => 'Total runs today',
'unit' => 'runs',
'value' => 2481
],
'position' => [
'col' => 8,
'height' => 2,
'row' => 0,
'width' => 4
]
]
],
'slug' => 'agent-ops',
'title' => 'Agent operations'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/dashboards"
payload := strings.NewReader("{\n \"columns\": 12,\n \"components\": [\n {\n \"chart\": {\n \"chart_id\": \"abc-123\"\n },\n \"component_type\": \"chart\",\n \"position\": {\n \"col\": 0,\n \"height\": 4,\n \"row\": 0,\n \"width\": 8\n }\n },\n {\n \"component_type\": \"key_value\",\n \"key_value\": {\n \"label\": \"Total runs today\",\n \"unit\": \"runs\",\n \"value\": 2481\n },\n \"position\": {\n \"col\": 8,\n \"height\": 2,\n \"row\": 0,\n \"width\": 4\n }\n }\n ],\n \"slug\": \"agent-ops\",\n \"title\": \"Agent operations\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/dashboards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"columns\": 12,\n \"components\": [\n {\n \"chart\": {\n \"chart_id\": \"abc-123\"\n },\n \"component_type\": \"chart\",\n \"position\": {\n \"col\": 0,\n \"height\": 4,\n \"row\": 0,\n \"width\": 8\n }\n },\n {\n \"component_type\": \"key_value\",\n \"key_value\": {\n \"label\": \"Total runs today\",\n \"unit\": \"runs\",\n \"value\": 2481\n },\n \"position\": {\n \"col\": 8,\n \"height\": 2,\n \"row\": 0,\n \"width\": 4\n }\n }\n ],\n \"slug\": \"agent-ops\",\n \"title\": \"Agent operations\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/dashboards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"columns\": 12,\n \"components\": [\n {\n \"chart\": {\n \"chart_id\": \"abc-123\"\n },\n \"component_type\": \"chart\",\n \"position\": {\n \"col\": 0,\n \"height\": 4,\n \"row\": 0,\n \"width\": 8\n }\n },\n {\n \"component_type\": \"key_value\",\n \"key_value\": {\n \"label\": \"Total runs today\",\n \"unit\": \"runs\",\n \"value\": 2481\n },\n \"position\": {\n \"col\": 8,\n \"height\": 2,\n \"row\": 0,\n \"width\": 4\n }\n }\n ],\n \"slug\": \"agent-ops\",\n \"title\": \"Agent operations\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"title": "<string>",
"description": "<string>",
"slug": "<string>",
"columns": 123,
"version": 123,
"components": [
{
"id": "<string>",
"position": {
"row": 0,
"col": 0,
"width": 6,
"height": 4
},
"chart": {
"chart_id": "<string>",
"title_override": "<string>",
"refresh_interval_override": 123
},
"key_value": {
"id": "<string>",
"label": "<string>",
"value": 123,
"unit": "<string>",
"description": "<string>",
"trend": {
"value": 123,
"is_percentage": true,
"label": "<string>"
},
"source_query": "<string>",
"refresh_interval": 123
},
"table": {
"id": "<string>",
"title": "<string>",
"description": "<string>",
"source_query": "<string>",
"columns": [
{
"key": "<string>",
"label": "<string>",
"sortable": true,
"filterable": true,
"width": 123,
"format": "<string>"
}
],
"default_page_size": 123,
"default_sort_field": "<string>",
"searchable": true,
"refresh_interval": 123
}
}
],
"permissions": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"agent_id": 123
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
Successful Response
Full dashboard returned by the API.
Available options:
draft, published, archived Available options:
private, organization, public Show child attributes
Show child attributes
Related topics
Schedule automatic refresh of a dashboard via an agentAdd a component to a dashboardDelete a dashboardPublish a dashboardUnpublish a dashboard⌘I
Create a dashboard
curl --request POST \
--url https://api.example.com/api/v1/dashboards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"columns": 12,
"components": [
{
"chart": {
"chart_id": "abc-123"
},
"component_type": "chart",
"position": {
"col": 0,
"height": 4,
"row": 0,
"width": 8
}
},
{
"component_type": "key_value",
"key_value": {
"label": "Total runs today",
"unit": "runs",
"value": 2481
},
"position": {
"col": 8,
"height": 2,
"row": 0,
"width": 4
}
}
],
"slug": "agent-ops",
"title": "Agent operations"
}
'import requests
url = "https://api.example.com/api/v1/dashboards"
payload = {
"columns": 12,
"components": [
{
"chart": { "chart_id": "abc-123" },
"component_type": "chart",
"position": {
"col": 0,
"height": 4,
"row": 0,
"width": 8
}
},
{
"component_type": "key_value",
"key_value": {
"label": "Total runs today",
"unit": "runs",
"value": 2481
},
"position": {
"col": 8,
"height": 2,
"row": 0,
"width": 4
}
}
],
"slug": "agent-ops",
"title": "Agent operations"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
columns: 12,
components: [
{
chart: {chart_id: 'abc-123'},
component_type: 'chart',
position: {col: 0, height: 4, row: 0, width: 8}
},
{
component_type: 'key_value',
key_value: {label: 'Total runs today', unit: 'runs', value: 2481},
position: {col: 8, height: 2, row: 0, width: 4}
}
],
slug: 'agent-ops',
title: 'Agent operations'
})
};
fetch('https://api.example.com/api/v1/dashboards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/dashboards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'columns' => 12,
'components' => [
[
'chart' => [
'chart_id' => 'abc-123'
],
'component_type' => 'chart',
'position' => [
'col' => 0,
'height' => 4,
'row' => 0,
'width' => 8
]
],
[
'component_type' => 'key_value',
'key_value' => [
'label' => 'Total runs today',
'unit' => 'runs',
'value' => 2481
],
'position' => [
'col' => 8,
'height' => 2,
'row' => 0,
'width' => 4
]
]
],
'slug' => 'agent-ops',
'title' => 'Agent operations'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/dashboards"
payload := strings.NewReader("{\n \"columns\": 12,\n \"components\": [\n {\n \"chart\": {\n \"chart_id\": \"abc-123\"\n },\n \"component_type\": \"chart\",\n \"position\": {\n \"col\": 0,\n \"height\": 4,\n \"row\": 0,\n \"width\": 8\n }\n },\n {\n \"component_type\": \"key_value\",\n \"key_value\": {\n \"label\": \"Total runs today\",\n \"unit\": \"runs\",\n \"value\": 2481\n },\n \"position\": {\n \"col\": 8,\n \"height\": 2,\n \"row\": 0,\n \"width\": 4\n }\n }\n ],\n \"slug\": \"agent-ops\",\n \"title\": \"Agent operations\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/dashboards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"columns\": 12,\n \"components\": [\n {\n \"chart\": {\n \"chart_id\": \"abc-123\"\n },\n \"component_type\": \"chart\",\n \"position\": {\n \"col\": 0,\n \"height\": 4,\n \"row\": 0,\n \"width\": 8\n }\n },\n {\n \"component_type\": \"key_value\",\n \"key_value\": {\n \"label\": \"Total runs today\",\n \"unit\": \"runs\",\n \"value\": 2481\n },\n \"position\": {\n \"col\": 8,\n \"height\": 2,\n \"row\": 0,\n \"width\": 4\n }\n }\n ],\n \"slug\": \"agent-ops\",\n \"title\": \"Agent operations\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/dashboards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"columns\": 12,\n \"components\": [\n {\n \"chart\": {\n \"chart_id\": \"abc-123\"\n },\n \"component_type\": \"chart\",\n \"position\": {\n \"col\": 0,\n \"height\": 4,\n \"row\": 0,\n \"width\": 8\n }\n },\n {\n \"component_type\": \"key_value\",\n \"key_value\": {\n \"label\": \"Total runs today\",\n \"unit\": \"runs\",\n \"value\": 2481\n },\n \"position\": {\n \"col\": 8,\n \"height\": 2,\n \"row\": 0,\n \"width\": 4\n }\n }\n ],\n \"slug\": \"agent-ops\",\n \"title\": \"Agent operations\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"title": "<string>",
"description": "<string>",
"slug": "<string>",
"columns": 123,
"version": 123,
"components": [
{
"id": "<string>",
"position": {
"row": 0,
"col": 0,
"width": 6,
"height": 4
},
"chart": {
"chart_id": "<string>",
"title_override": "<string>",
"refresh_interval_override": 123
},
"key_value": {
"id": "<string>",
"label": "<string>",
"value": 123,
"unit": "<string>",
"description": "<string>",
"trend": {
"value": 123,
"is_percentage": true,
"label": "<string>"
},
"source_query": "<string>",
"refresh_interval": 123
},
"table": {
"id": "<string>",
"title": "<string>",
"description": "<string>",
"source_query": "<string>",
"columns": [
{
"key": "<string>",
"label": "<string>",
"sortable": true,
"filterable": true,
"width": 123,
"format": "<string>"
}
],
"default_page_size": 123,
"default_sort_field": "<string>",
"searchable": true,
"refresh_interval": 123
}
}
],
"permissions": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"agent_id": 123
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}