curl --request PUT \
--url https://api.neoagent.io/public-api/dashboards/{dashboard_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"custom_api_connections": [
"<string>"
],
"dataset": {
"columns": [
{
"key": "<string>",
"label": "<string>",
"derived": false
}
],
"date_column": "<string>",
"id_column": "<string>",
"pinned_columns": [
"<string>"
]
},
"default_view": {
"f": [
"<string>"
],
"p": "<string>"
},
"expected_definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"folder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"module": "<string>",
"name": "<string>",
"parameters": [
{
"key": "<string>",
"label": "<string>",
"currency": "<string>",
"default": 123,
"max": 123,
"min": 123,
"per_month": false
}
],
"period_rule": {
"timezone": "<string>",
"days": 183
},
"permission_groups": {},
"removed_widget_ids": [
"<string>"
],
"restore_definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"schedule": {
"start_datetimes": [
"2023-11-07T05:31:56Z"
],
"time_period": {
"interval": 2
},
"should_skip_weekends": false,
"timezone": "UTC"
},
"theme": {
"accent": "<string>",
"background": "<string>",
"primary": "<string>",
"series": [
"<string>"
],
"title_size": 26
},
"widgets": [
{
"id": "<string>",
"layout": {
"h": 6,
"w": 6,
"x": 1,
"y": 1
},
"title": "<string>",
"data_schema": {},
"fit": "content",
"hand_edited_at": "2023-11-07T05:31:56Z",
"hand_edited_by": "<string>",
"html": "<string>",
"inputs": [
"<string>"
],
"libs": [],
"query": {
"columns": [
"<string>"
],
"filter": [
{
"column": "<string>",
"value": null
}
],
"group_by": [
{
"column": "<string>"
}
],
"history": {
"last": 123,
"bucket": "day"
},
"limit": 1000,
"measure": [
{
"column": "<string>",
"label": "<string>",
"where": [
{
"column": "<string>",
"value": null
}
]
}
],
"sort": {
"by": "<string>",
"dir": "desc"
}
},
"table_controls": true
}
]
}
'import requests
url = "https://api.neoagent.io/public-api/dashboards/{dashboard_id}"
payload = {
"custom_api_connections": ["<string>"],
"dataset": {
"columns": [
{
"key": "<string>",
"label": "<string>",
"derived": False
}
],
"date_column": "<string>",
"id_column": "<string>",
"pinned_columns": ["<string>"]
},
"default_view": {
"f": ["<string>"],
"p": "<string>"
},
"expected_definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"folder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"module": "<string>",
"name": "<string>",
"parameters": [
{
"key": "<string>",
"label": "<string>",
"currency": "<string>",
"default": 123,
"max": 123,
"min": 123,
"per_month": False
}
],
"period_rule": {
"timezone": "<string>",
"days": 183
},
"permission_groups": {},
"removed_widget_ids": ["<string>"],
"restore_definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"schedule": {
"start_datetimes": ["2023-11-07T05:31:56Z"],
"time_period": { "interval": 2 },
"should_skip_weekends": False,
"timezone": "UTC"
},
"theme": {
"accent": "<string>",
"background": "<string>",
"primary": "<string>",
"series": ["<string>"],
"title_size": 26
},
"widgets": [
{
"id": "<string>",
"layout": {
"h": 6,
"w": 6,
"x": 1,
"y": 1
},
"title": "<string>",
"data_schema": {},
"fit": "content",
"hand_edited_at": "2023-11-07T05:31:56Z",
"hand_edited_by": "<string>",
"html": "<string>",
"inputs": ["<string>"],
"libs": [],
"query": {
"columns": ["<string>"],
"filter": [
{
"column": "<string>",
"value": None
}
],
"group_by": [{ "column": "<string>" }],
"history": {
"last": 123,
"bucket": "day"
},
"limit": 1000,
"measure": [
{
"column": "<string>",
"label": "<string>",
"where": [
{
"column": "<string>",
"value": None
}
]
}
],
"sort": {
"by": "<string>",
"dir": "desc"
}
},
"table_controls": True
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
custom_api_connections: ['<string>'],
dataset: {
columns: [{key: '<string>', label: '<string>', derived: false}],
date_column: '<string>',
id_column: '<string>',
pinned_columns: ['<string>']
},
default_view: {f: ['<string>'], p: '<string>'},
expected_definition_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
folder_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
module: '<string>',
name: '<string>',
parameters: [
{
key: '<string>',
label: '<string>',
currency: '<string>',
default: 123,
max: 123,
min: 123,
per_month: false
}
],
period_rule: {timezone: '<string>', days: 183},
permission_groups: {},
removed_widget_ids: ['<string>'],
restore_definition_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
schedule: {
start_datetimes: ['2023-11-07T05:31:56Z'],
time_period: {interval: 2},
should_skip_weekends: false,
timezone: 'UTC'
},
theme: {
accent: '<string>',
background: '<string>',
primary: '<string>',
series: ['<string>'],
title_size: 26
},
widgets: [
{
id: '<string>',
layout: {h: 6, w: 6, x: 1, y: 1},
title: '<string>',
data_schema: {},
fit: 'content',
hand_edited_at: '2023-11-07T05:31:56Z',
hand_edited_by: '<string>',
html: '<string>',
inputs: ['<string>'],
libs: [],
query: {
columns: ['<string>'],
filter: [{column: '<string>', value: null}],
group_by: [{column: '<string>'}],
history: {last: 123, bucket: 'day'},
limit: 1000,
measure: [
{
column: '<string>',
label: '<string>',
where: [{column: '<string>', value: null}]
}
],
sort: {by: '<string>', dir: 'desc'}
},
table_controls: true
}
]
})
};
fetch('https://api.neoagent.io/public-api/dashboards/{dashboard_id}', 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.neoagent.io/public-api/dashboards/{dashboard_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'custom_api_connections' => [
'<string>'
],
'dataset' => [
'columns' => [
[
'key' => '<string>',
'label' => '<string>',
'derived' => false
]
],
'date_column' => '<string>',
'id_column' => '<string>',
'pinned_columns' => [
'<string>'
]
],
'default_view' => [
'f' => [
'<string>'
],
'p' => '<string>'
],
'expected_definition_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'folder_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'module' => '<string>',
'name' => '<string>',
'parameters' => [
[
'key' => '<string>',
'label' => '<string>',
'currency' => '<string>',
'default' => 123,
'max' => 123,
'min' => 123,
'per_month' => false
]
],
'period_rule' => [
'timezone' => '<string>',
'days' => 183
],
'permission_groups' => [
],
'removed_widget_ids' => [
'<string>'
],
'restore_definition_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'schedule' => [
'start_datetimes' => [
'2023-11-07T05:31:56Z'
],
'time_period' => [
'interval' => 2
],
'should_skip_weekends' => false,
'timezone' => 'UTC'
],
'theme' => [
'accent' => '<string>',
'background' => '<string>',
'primary' => '<string>',
'series' => [
'<string>'
],
'title_size' => 26
],
'widgets' => [
[
'id' => '<string>',
'layout' => [
'h' => 6,
'w' => 6,
'x' => 1,
'y' => 1
],
'title' => '<string>',
'data_schema' => [
],
'fit' => 'content',
'hand_edited_at' => '2023-11-07T05:31:56Z',
'hand_edited_by' => '<string>',
'html' => '<string>',
'inputs' => [
'<string>'
],
'libs' => [
],
'query' => [
'columns' => [
'<string>'
],
'filter' => [
[
'column' => '<string>',
'value' => null
]
],
'group_by' => [
[
'column' => '<string>'
]
],
'history' => [
'last' => 123,
'bucket' => 'day'
],
'limit' => 1000,
'measure' => [
[
'column' => '<string>',
'label' => '<string>',
'where' => [
[
'column' => '<string>',
'value' => null
]
]
]
],
'sort' => [
'by' => '<string>',
'dir' => 'desc'
]
],
'table_controls' => true
]
]
]),
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.neoagent.io/public-api/dashboards/{dashboard_id}"
payload := strings.NewReader("{\n \"custom_api_connections\": [\n \"<string>\"\n ],\n \"dataset\": {\n \"columns\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"derived\": false\n }\n ],\n \"date_column\": \"<string>\",\n \"id_column\": \"<string>\",\n \"pinned_columns\": [\n \"<string>\"\n ]\n },\n \"default_view\": {\n \"f\": [\n \"<string>\"\n ],\n \"p\": \"<string>\"\n },\n \"expected_definition_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"folder_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"module\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"currency\": \"<string>\",\n \"default\": 123,\n \"max\": 123,\n \"min\": 123,\n \"per_month\": false\n }\n ],\n \"period_rule\": {\n \"timezone\": \"<string>\",\n \"days\": 183\n },\n \"permission_groups\": {},\n \"removed_widget_ids\": [\n \"<string>\"\n ],\n \"restore_definition_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"schedule\": {\n \"start_datetimes\": [\n \"2023-11-07T05:31:56Z\"\n ],\n \"time_period\": {\n \"interval\": 2\n },\n \"should_skip_weekends\": false,\n \"timezone\": \"UTC\"\n },\n \"theme\": {\n \"accent\": \"<string>\",\n \"background\": \"<string>\",\n \"primary\": \"<string>\",\n \"series\": [\n \"<string>\"\n ],\n \"title_size\": 26\n },\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"layout\": {\n \"h\": 6,\n \"w\": 6,\n \"x\": 1,\n \"y\": 1\n },\n \"title\": \"<string>\",\n \"data_schema\": {},\n \"fit\": \"content\",\n \"hand_edited_at\": \"2023-11-07T05:31:56Z\",\n \"hand_edited_by\": \"<string>\",\n \"html\": \"<string>\",\n \"inputs\": [\n \"<string>\"\n ],\n \"libs\": [],\n \"query\": {\n \"columns\": [\n \"<string>\"\n ],\n \"filter\": [\n {\n \"column\": \"<string>\",\n \"value\": null\n }\n ],\n \"group_by\": [\n {\n \"column\": \"<string>\"\n }\n ],\n \"history\": {\n \"last\": 123,\n \"bucket\": \"day\"\n },\n \"limit\": 1000,\n \"measure\": [\n {\n \"column\": \"<string>\",\n \"label\": \"<string>\",\n \"where\": [\n {\n \"column\": \"<string>\",\n \"value\": null\n }\n ]\n }\n ],\n \"sort\": {\n \"by\": \"<string>\",\n \"dir\": \"desc\"\n }\n },\n \"table_controls\": true\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.neoagent.io/public-api/dashboards/{dashboard_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"custom_api_connections\": [\n \"<string>\"\n ],\n \"dataset\": {\n \"columns\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"derived\": false\n }\n ],\n \"date_column\": \"<string>\",\n \"id_column\": \"<string>\",\n \"pinned_columns\": [\n \"<string>\"\n ]\n },\n \"default_view\": {\n \"f\": [\n \"<string>\"\n ],\n \"p\": \"<string>\"\n },\n \"expected_definition_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"folder_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"module\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"currency\": \"<string>\",\n \"default\": 123,\n \"max\": 123,\n \"min\": 123,\n \"per_month\": false\n }\n ],\n \"period_rule\": {\n \"timezone\": \"<string>\",\n \"days\": 183\n },\n \"permission_groups\": {},\n \"removed_widget_ids\": [\n \"<string>\"\n ],\n \"restore_definition_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"schedule\": {\n \"start_datetimes\": [\n \"2023-11-07T05:31:56Z\"\n ],\n \"time_period\": {\n \"interval\": 2\n },\n \"should_skip_weekends\": false,\n \"timezone\": \"UTC\"\n },\n \"theme\": {\n \"accent\": \"<string>\",\n \"background\": \"<string>\",\n \"primary\": \"<string>\",\n \"series\": [\n \"<string>\"\n ],\n \"title_size\": 26\n },\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"layout\": {\n \"h\": 6,\n \"w\": 6,\n \"x\": 1,\n \"y\": 1\n },\n \"title\": \"<string>\",\n \"data_schema\": {},\n \"fit\": \"content\",\n \"hand_edited_at\": \"2023-11-07T05:31:56Z\",\n \"hand_edited_by\": \"<string>\",\n \"html\": \"<string>\",\n \"inputs\": [\n \"<string>\"\n ],\n \"libs\": [],\n \"query\": {\n \"columns\": [\n \"<string>\"\n ],\n \"filter\": [\n {\n \"column\": \"<string>\",\n \"value\": null\n }\n ],\n \"group_by\": [\n {\n \"column\": \"<string>\"\n }\n ],\n \"history\": {\n \"last\": 123,\n \"bucket\": \"day\"\n },\n \"limit\": 1000,\n \"measure\": [\n {\n \"column\": \"<string>\",\n \"label\": \"<string>\",\n \"where\": [\n {\n \"column\": \"<string>\",\n \"value\": null\n }\n ]\n }\n ],\n \"sort\": {\n \"by\": \"<string>\",\n \"dir\": \"desc\"\n }\n },\n \"table_controls\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.neoagent.io/public-api/dashboards/{dashboard_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"custom_api_connections\": [\n \"<string>\"\n ],\n \"dataset\": {\n \"columns\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"derived\": false\n }\n ],\n \"date_column\": \"<string>\",\n \"id_column\": \"<string>\",\n \"pinned_columns\": [\n \"<string>\"\n ]\n },\n \"default_view\": {\n \"f\": [\n \"<string>\"\n ],\n \"p\": \"<string>\"\n },\n \"expected_definition_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"folder_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"module\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"currency\": \"<string>\",\n \"default\": 123,\n \"max\": 123,\n \"min\": 123,\n \"per_month\": false\n }\n ],\n \"period_rule\": {\n \"timezone\": \"<string>\",\n \"days\": 183\n },\n \"permission_groups\": {},\n \"removed_widget_ids\": [\n \"<string>\"\n ],\n \"restore_definition_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"schedule\": {\n \"start_datetimes\": [\n \"2023-11-07T05:31:56Z\"\n ],\n \"time_period\": {\n \"interval\": 2\n },\n \"should_skip_weekends\": false,\n \"timezone\": \"UTC\"\n },\n \"theme\": {\n \"accent\": \"<string>\",\n \"background\": \"<string>\",\n \"primary\": \"<string>\",\n \"series\": [\n \"<string>\"\n ],\n \"title_size\": 26\n },\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"layout\": {\n \"h\": 6,\n \"w\": 6,\n \"x\": 1,\n \"y\": 1\n },\n \"title\": \"<string>\",\n \"data_schema\": {},\n \"fit\": \"content\",\n \"hand_edited_at\": \"2023-11-07T05:31:56Z\",\n \"hand_edited_by\": \"<string>\",\n \"html\": \"<string>\",\n \"inputs\": [\n \"<string>\"\n ],\n \"libs\": [],\n \"query\": {\n \"columns\": [\n \"<string>\"\n ],\n \"filter\": [\n {\n \"column\": \"<string>\",\n \"value\": null\n }\n ],\n \"group_by\": [\n {\n \"column\": \"<string>\"\n }\n ],\n \"history\": {\n \"last\": 123,\n \"bucket\": \"day\"\n },\n \"limit\": 1000,\n \"measure\": [\n {\n \"column\": \"<string>\",\n \"label\": \"<string>\",\n \"where\": [\n {\n \"column\": \"<string>\",\n \"value\": null\n }\n ]\n }\n ],\n \"sort\": {\n \"by\": \"<string>\",\n \"dir\": \"desc\"\n }\n },\n \"table_controls\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"dashboard_id": "<string>",
"definition_id": "<string>",
"name": "<string>",
"refresh_started": true,
"widget_count": 123,
"widget_ids": [
"<string>"
]
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"timings_ms": {},
"pagination": {
"has_more": true,
"next_cursor": "<string>"
},
"warnings": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Update a dashboard
Every field is optional, and a field left out keeps the stored value: send only what you change, so a rename someone made since you read the dashboard is not undone. name and period_rule replace theirs; permission_groups replaces the groups ({} clears them); custom_api_connections replaces the Custom API connections ([] clears them); theme replaces the brand colours ({} goes back to the page’s own) and refreshes nothing; schedule replaces the schedule (null removes it) and refreshes nothing now, its first fire does; the dashboard’s next_run_at is the next one; module and widgets together replace the definition. Then asks for a refresh of every widget and returns at once; every widget is pending until it lands. A rename alone, or widgets that only move or drop widgets of the current definition (the same module), keeps the kept widgets’ data, so none is pending; a refresh starts only when their rows cannot be kept as they are (a refresh already running, or a store that could not be reached), and refresh_started says so. refresh_started is false when the change was stored but the refresh could not start, and null when the change needed none. restore_definition_id (an id from GET /dashboards/<id>/definitions) instead makes that earlier definition the one in use, stores no new one, and refreshes every widget; sent with module or widgets it is a 422, and so is an id that is not this dashboard’s. Sending module or widgets, restore_definition_id, or other permission groups or Custom API connections, is building: admins only. A rename, a period, a schedule or a theme change: the creator or an admin. Otherwise 403. The old definition’s data shows as stale until the refresh replaces it. expected_definition_id: the definition_id your GET returned (a UUID). Send it on every PUT: when the dashboard uses another definition now, the PUT is a 409 dashboard_update_conflict and nothing is stored. Without it, only a change made while this PUT was saving is a 409; a change made between your GET and the PUT is overwritten, and a module or widgets sent alone is paired with the other half as it is when the PUT arrives. After a 409, GET the dashboard and apply your change to what it has now. removed_widget_ids: every widget of the current definition that widgets leaves out (a renamed id counts). A widgets that drops an unlisted id, or lists a kept one, is a 422 and nothing is stored.
curl --request PUT \
--url https://api.neoagent.io/public-api/dashboards/{dashboard_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"custom_api_connections": [
"<string>"
],
"dataset": {
"columns": [
{
"key": "<string>",
"label": "<string>",
"derived": false
}
],
"date_column": "<string>",
"id_column": "<string>",
"pinned_columns": [
"<string>"
]
},
"default_view": {
"f": [
"<string>"
],
"p": "<string>"
},
"expected_definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"folder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"module": "<string>",
"name": "<string>",
"parameters": [
{
"key": "<string>",
"label": "<string>",
"currency": "<string>",
"default": 123,
"max": 123,
"min": 123,
"per_month": false
}
],
"period_rule": {
"timezone": "<string>",
"days": 183
},
"permission_groups": {},
"removed_widget_ids": [
"<string>"
],
"restore_definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"schedule": {
"start_datetimes": [
"2023-11-07T05:31:56Z"
],
"time_period": {
"interval": 2
},
"should_skip_weekends": false,
"timezone": "UTC"
},
"theme": {
"accent": "<string>",
"background": "<string>",
"primary": "<string>",
"series": [
"<string>"
],
"title_size": 26
},
"widgets": [
{
"id": "<string>",
"layout": {
"h": 6,
"w": 6,
"x": 1,
"y": 1
},
"title": "<string>",
"data_schema": {},
"fit": "content",
"hand_edited_at": "2023-11-07T05:31:56Z",
"hand_edited_by": "<string>",
"html": "<string>",
"inputs": [
"<string>"
],
"libs": [],
"query": {
"columns": [
"<string>"
],
"filter": [
{
"column": "<string>",
"value": null
}
],
"group_by": [
{
"column": "<string>"
}
],
"history": {
"last": 123,
"bucket": "day"
},
"limit": 1000,
"measure": [
{
"column": "<string>",
"label": "<string>",
"where": [
{
"column": "<string>",
"value": null
}
]
}
],
"sort": {
"by": "<string>",
"dir": "desc"
}
},
"table_controls": true
}
]
}
'import requests
url = "https://api.neoagent.io/public-api/dashboards/{dashboard_id}"
payload = {
"custom_api_connections": ["<string>"],
"dataset": {
"columns": [
{
"key": "<string>",
"label": "<string>",
"derived": False
}
],
"date_column": "<string>",
"id_column": "<string>",
"pinned_columns": ["<string>"]
},
"default_view": {
"f": ["<string>"],
"p": "<string>"
},
"expected_definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"folder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"module": "<string>",
"name": "<string>",
"parameters": [
{
"key": "<string>",
"label": "<string>",
"currency": "<string>",
"default": 123,
"max": 123,
"min": 123,
"per_month": False
}
],
"period_rule": {
"timezone": "<string>",
"days": 183
},
"permission_groups": {},
"removed_widget_ids": ["<string>"],
"restore_definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"schedule": {
"start_datetimes": ["2023-11-07T05:31:56Z"],
"time_period": { "interval": 2 },
"should_skip_weekends": False,
"timezone": "UTC"
},
"theme": {
"accent": "<string>",
"background": "<string>",
"primary": "<string>",
"series": ["<string>"],
"title_size": 26
},
"widgets": [
{
"id": "<string>",
"layout": {
"h": 6,
"w": 6,
"x": 1,
"y": 1
},
"title": "<string>",
"data_schema": {},
"fit": "content",
"hand_edited_at": "2023-11-07T05:31:56Z",
"hand_edited_by": "<string>",
"html": "<string>",
"inputs": ["<string>"],
"libs": [],
"query": {
"columns": ["<string>"],
"filter": [
{
"column": "<string>",
"value": None
}
],
"group_by": [{ "column": "<string>" }],
"history": {
"last": 123,
"bucket": "day"
},
"limit": 1000,
"measure": [
{
"column": "<string>",
"label": "<string>",
"where": [
{
"column": "<string>",
"value": None
}
]
}
],
"sort": {
"by": "<string>",
"dir": "desc"
}
},
"table_controls": True
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
custom_api_connections: ['<string>'],
dataset: {
columns: [{key: '<string>', label: '<string>', derived: false}],
date_column: '<string>',
id_column: '<string>',
pinned_columns: ['<string>']
},
default_view: {f: ['<string>'], p: '<string>'},
expected_definition_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
folder_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
module: '<string>',
name: '<string>',
parameters: [
{
key: '<string>',
label: '<string>',
currency: '<string>',
default: 123,
max: 123,
min: 123,
per_month: false
}
],
period_rule: {timezone: '<string>', days: 183},
permission_groups: {},
removed_widget_ids: ['<string>'],
restore_definition_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
schedule: {
start_datetimes: ['2023-11-07T05:31:56Z'],
time_period: {interval: 2},
should_skip_weekends: false,
timezone: 'UTC'
},
theme: {
accent: '<string>',
background: '<string>',
primary: '<string>',
series: ['<string>'],
title_size: 26
},
widgets: [
{
id: '<string>',
layout: {h: 6, w: 6, x: 1, y: 1},
title: '<string>',
data_schema: {},
fit: 'content',
hand_edited_at: '2023-11-07T05:31:56Z',
hand_edited_by: '<string>',
html: '<string>',
inputs: ['<string>'],
libs: [],
query: {
columns: ['<string>'],
filter: [{column: '<string>', value: null}],
group_by: [{column: '<string>'}],
history: {last: 123, bucket: 'day'},
limit: 1000,
measure: [
{
column: '<string>',
label: '<string>',
where: [{column: '<string>', value: null}]
}
],
sort: {by: '<string>', dir: 'desc'}
},
table_controls: true
}
]
})
};
fetch('https://api.neoagent.io/public-api/dashboards/{dashboard_id}', 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.neoagent.io/public-api/dashboards/{dashboard_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'custom_api_connections' => [
'<string>'
],
'dataset' => [
'columns' => [
[
'key' => '<string>',
'label' => '<string>',
'derived' => false
]
],
'date_column' => '<string>',
'id_column' => '<string>',
'pinned_columns' => [
'<string>'
]
],
'default_view' => [
'f' => [
'<string>'
],
'p' => '<string>'
],
'expected_definition_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'folder_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'module' => '<string>',
'name' => '<string>',
'parameters' => [
[
'key' => '<string>',
'label' => '<string>',
'currency' => '<string>',
'default' => 123,
'max' => 123,
'min' => 123,
'per_month' => false
]
],
'period_rule' => [
'timezone' => '<string>',
'days' => 183
],
'permission_groups' => [
],
'removed_widget_ids' => [
'<string>'
],
'restore_definition_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'schedule' => [
'start_datetimes' => [
'2023-11-07T05:31:56Z'
],
'time_period' => [
'interval' => 2
],
'should_skip_weekends' => false,
'timezone' => 'UTC'
],
'theme' => [
'accent' => '<string>',
'background' => '<string>',
'primary' => '<string>',
'series' => [
'<string>'
],
'title_size' => 26
],
'widgets' => [
[
'id' => '<string>',
'layout' => [
'h' => 6,
'w' => 6,
'x' => 1,
'y' => 1
],
'title' => '<string>',
'data_schema' => [
],
'fit' => 'content',
'hand_edited_at' => '2023-11-07T05:31:56Z',
'hand_edited_by' => '<string>',
'html' => '<string>',
'inputs' => [
'<string>'
],
'libs' => [
],
'query' => [
'columns' => [
'<string>'
],
'filter' => [
[
'column' => '<string>',
'value' => null
]
],
'group_by' => [
[
'column' => '<string>'
]
],
'history' => [
'last' => 123,
'bucket' => 'day'
],
'limit' => 1000,
'measure' => [
[
'column' => '<string>',
'label' => '<string>',
'where' => [
[
'column' => '<string>',
'value' => null
]
]
]
],
'sort' => [
'by' => '<string>',
'dir' => 'desc'
]
],
'table_controls' => true
]
]
]),
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.neoagent.io/public-api/dashboards/{dashboard_id}"
payload := strings.NewReader("{\n \"custom_api_connections\": [\n \"<string>\"\n ],\n \"dataset\": {\n \"columns\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"derived\": false\n }\n ],\n \"date_column\": \"<string>\",\n \"id_column\": \"<string>\",\n \"pinned_columns\": [\n \"<string>\"\n ]\n },\n \"default_view\": {\n \"f\": [\n \"<string>\"\n ],\n \"p\": \"<string>\"\n },\n \"expected_definition_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"folder_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"module\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"currency\": \"<string>\",\n \"default\": 123,\n \"max\": 123,\n \"min\": 123,\n \"per_month\": false\n }\n ],\n \"period_rule\": {\n \"timezone\": \"<string>\",\n \"days\": 183\n },\n \"permission_groups\": {},\n \"removed_widget_ids\": [\n \"<string>\"\n ],\n \"restore_definition_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"schedule\": {\n \"start_datetimes\": [\n \"2023-11-07T05:31:56Z\"\n ],\n \"time_period\": {\n \"interval\": 2\n },\n \"should_skip_weekends\": false,\n \"timezone\": \"UTC\"\n },\n \"theme\": {\n \"accent\": \"<string>\",\n \"background\": \"<string>\",\n \"primary\": \"<string>\",\n \"series\": [\n \"<string>\"\n ],\n \"title_size\": 26\n },\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"layout\": {\n \"h\": 6,\n \"w\": 6,\n \"x\": 1,\n \"y\": 1\n },\n \"title\": \"<string>\",\n \"data_schema\": {},\n \"fit\": \"content\",\n \"hand_edited_at\": \"2023-11-07T05:31:56Z\",\n \"hand_edited_by\": \"<string>\",\n \"html\": \"<string>\",\n \"inputs\": [\n \"<string>\"\n ],\n \"libs\": [],\n \"query\": {\n \"columns\": [\n \"<string>\"\n ],\n \"filter\": [\n {\n \"column\": \"<string>\",\n \"value\": null\n }\n ],\n \"group_by\": [\n {\n \"column\": \"<string>\"\n }\n ],\n \"history\": {\n \"last\": 123,\n \"bucket\": \"day\"\n },\n \"limit\": 1000,\n \"measure\": [\n {\n \"column\": \"<string>\",\n \"label\": \"<string>\",\n \"where\": [\n {\n \"column\": \"<string>\",\n \"value\": null\n }\n ]\n }\n ],\n \"sort\": {\n \"by\": \"<string>\",\n \"dir\": \"desc\"\n }\n },\n \"table_controls\": true\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.neoagent.io/public-api/dashboards/{dashboard_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"custom_api_connections\": [\n \"<string>\"\n ],\n \"dataset\": {\n \"columns\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"derived\": false\n }\n ],\n \"date_column\": \"<string>\",\n \"id_column\": \"<string>\",\n \"pinned_columns\": [\n \"<string>\"\n ]\n },\n \"default_view\": {\n \"f\": [\n \"<string>\"\n ],\n \"p\": \"<string>\"\n },\n \"expected_definition_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"folder_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"module\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"currency\": \"<string>\",\n \"default\": 123,\n \"max\": 123,\n \"min\": 123,\n \"per_month\": false\n }\n ],\n \"period_rule\": {\n \"timezone\": \"<string>\",\n \"days\": 183\n },\n \"permission_groups\": {},\n \"removed_widget_ids\": [\n \"<string>\"\n ],\n \"restore_definition_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"schedule\": {\n \"start_datetimes\": [\n \"2023-11-07T05:31:56Z\"\n ],\n \"time_period\": {\n \"interval\": 2\n },\n \"should_skip_weekends\": false,\n \"timezone\": \"UTC\"\n },\n \"theme\": {\n \"accent\": \"<string>\",\n \"background\": \"<string>\",\n \"primary\": \"<string>\",\n \"series\": [\n \"<string>\"\n ],\n \"title_size\": 26\n },\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"layout\": {\n \"h\": 6,\n \"w\": 6,\n \"x\": 1,\n \"y\": 1\n },\n \"title\": \"<string>\",\n \"data_schema\": {},\n \"fit\": \"content\",\n \"hand_edited_at\": \"2023-11-07T05:31:56Z\",\n \"hand_edited_by\": \"<string>\",\n \"html\": \"<string>\",\n \"inputs\": [\n \"<string>\"\n ],\n \"libs\": [],\n \"query\": {\n \"columns\": [\n \"<string>\"\n ],\n \"filter\": [\n {\n \"column\": \"<string>\",\n \"value\": null\n }\n ],\n \"group_by\": [\n {\n \"column\": \"<string>\"\n }\n ],\n \"history\": {\n \"last\": 123,\n \"bucket\": \"day\"\n },\n \"limit\": 1000,\n \"measure\": [\n {\n \"column\": \"<string>\",\n \"label\": \"<string>\",\n \"where\": [\n {\n \"column\": \"<string>\",\n \"value\": null\n }\n ]\n }\n ],\n \"sort\": {\n \"by\": \"<string>\",\n \"dir\": \"desc\"\n }\n },\n \"table_controls\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.neoagent.io/public-api/dashboards/{dashboard_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"custom_api_connections\": [\n \"<string>\"\n ],\n \"dataset\": {\n \"columns\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"derived\": false\n }\n ],\n \"date_column\": \"<string>\",\n \"id_column\": \"<string>\",\n \"pinned_columns\": [\n \"<string>\"\n ]\n },\n \"default_view\": {\n \"f\": [\n \"<string>\"\n ],\n \"p\": \"<string>\"\n },\n \"expected_definition_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"folder_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"module\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"currency\": \"<string>\",\n \"default\": 123,\n \"max\": 123,\n \"min\": 123,\n \"per_month\": false\n }\n ],\n \"period_rule\": {\n \"timezone\": \"<string>\",\n \"days\": 183\n },\n \"permission_groups\": {},\n \"removed_widget_ids\": [\n \"<string>\"\n ],\n \"restore_definition_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"schedule\": {\n \"start_datetimes\": [\n \"2023-11-07T05:31:56Z\"\n ],\n \"time_period\": {\n \"interval\": 2\n },\n \"should_skip_weekends\": false,\n \"timezone\": \"UTC\"\n },\n \"theme\": {\n \"accent\": \"<string>\",\n \"background\": \"<string>\",\n \"primary\": \"<string>\",\n \"series\": [\n \"<string>\"\n ],\n \"title_size\": 26\n },\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"layout\": {\n \"h\": 6,\n \"w\": 6,\n \"x\": 1,\n \"y\": 1\n },\n \"title\": \"<string>\",\n \"data_schema\": {},\n \"fit\": \"content\",\n \"hand_edited_at\": \"2023-11-07T05:31:56Z\",\n \"hand_edited_by\": \"<string>\",\n \"html\": \"<string>\",\n \"inputs\": [\n \"<string>\"\n ],\n \"libs\": [],\n \"query\": {\n \"columns\": [\n \"<string>\"\n ],\n \"filter\": [\n {\n \"column\": \"<string>\",\n \"value\": null\n }\n ],\n \"group_by\": [\n {\n \"column\": \"<string>\"\n }\n ],\n \"history\": {\n \"last\": 123,\n \"bucket\": \"day\"\n },\n \"limit\": 1000,\n \"measure\": [\n {\n \"column\": \"<string>\",\n \"label\": \"<string>\",\n \"where\": [\n {\n \"column\": \"<string>\",\n \"value\": null\n }\n ]\n }\n ],\n \"sort\": {\n \"by\": \"<string>\",\n \"dir\": \"desc\"\n }\n },\n \"table_controls\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"dashboard_id": "<string>",
"definition_id": "<string>",
"name": "<string>",
"refresh_started": true,
"widget_count": 123,
"widget_ids": [
"<string>"
]
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"timings_ms": {},
"pagination": {
"has_more": true,
"next_cursor": "<string>"
},
"warnings": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Authorizations
Authorization: Bearer <token> where <token> is either a neo_sk_<env>_<secret> API key (service account) or a Microsoft Entra ID access token (dashboard user). A key created with scopes reaches only the permission groups they name, and gets 403 insufficient_scope elsewhere; GET /public-api/scopes lists them.
Body
Every field left out keeps the stored value. module and widgets together replace the
definition. restore_definition_id instead makes an earlier definition the one in use.
permission_groups {} clears the groups; custom_api_connections [] the connections.
Replaces them; [] clears them. Custom API connections the module reads, by id or name: from external_api.client import http_request, then http_request("<connection id>"). GET connections only; stored and returned as ids. A miss lists the workspace's GET connections.
