curl --request POST \
--url https://api.neoagent.io/public-api/dashboards/{dashboard_id}/widgets/copy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_dashboard_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"widget_id": "<string>"
}
'import requests
url = "https://api.neoagent.io/public-api/dashboards/{dashboard_id}/widgets/copy"
payload = {
"source_dashboard_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"widget_id": "<string>"
}
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({
source_dashboard_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
widget_id: '<string>'
})
};
fetch('https://api.neoagent.io/public-api/dashboards/{dashboard_id}/widgets/copy', 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}/widgets/copy",
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([
'source_dashboard_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'widget_id' => '<string>'
]),
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}/widgets/copy"
payload := strings.NewReader("{\n \"source_dashboard_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"widget_id\": \"<string>\"\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.neoagent.io/public-api/dashboards/{dashboard_id}/widgets/copy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source_dashboard_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"widget_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.neoagent.io/public-api/dashboards/{dashboard_id}/widgets/copy")
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 \"source_dashboard_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"widget_id\": \"<string>\"\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_id": "<string>",
"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"
}
}Copy a widget onto this dashboard
Copies widget_id of source_dashboard_id onto the dashboard in the path, in a new row at its bottom, as a new definition (the version history keeps the one before). A described widget (query) is checked as any write is, against this dashboard’s dataset columns (422 when it does not fit, a measure named label or values, a history query on a dashboard with no schedule); a dashboard with no dataset gets the source’s dataset and collect(ctx) too. A function widget brings widget_<id> and every module-level helper, constant and import it reads; a name this dashboard’s module already binds to other code is a 409 dashboard_widget_copy_conflict naming it, and nothing is stored. Code copied over runs under the source’s permission groups and Custom API connections too, so those are added to this dashboard’s. A widget that reads other widgets (inputs) is a 422. The copy keeps the source’s id, or takes <id>_copy when this dashboard has one: widget_id in the answer. A described widget copied onto a dashboard that already has the dataset refreshes nothing (refresh_started null); any other copy refreshes the dashboard. 409 dashboard_update_conflict when this dashboard changed while saving. An acting user must be an admin (403 insufficient_scope); 404 dashboard_not_found when either dashboard is not the workspace’s.
curl --request POST \
--url https://api.neoagent.io/public-api/dashboards/{dashboard_id}/widgets/copy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_dashboard_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"widget_id": "<string>"
}
'import requests
url = "https://api.neoagent.io/public-api/dashboards/{dashboard_id}/widgets/copy"
payload = {
"source_dashboard_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"widget_id": "<string>"
}
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({
source_dashboard_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
widget_id: '<string>'
})
};
fetch('https://api.neoagent.io/public-api/dashboards/{dashboard_id}/widgets/copy', 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}/widgets/copy",
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([
'source_dashboard_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'widget_id' => '<string>'
]),
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}/widgets/copy"
payload := strings.NewReader("{\n \"source_dashboard_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"widget_id\": \"<string>\"\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.neoagent.io/public-api/dashboards/{dashboard_id}/widgets/copy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source_dashboard_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"widget_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.neoagent.io/public-api/dashboards/{dashboard_id}/widgets/copy")
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 \"source_dashboard_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"widget_id\": \"<string>\"\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_id": "<string>",
"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).
