dashboards
Link or unlink an agent to a dashboard
Associate an agent with a dashboard for traceability and refresh scheduling.
PATCH
/
api
/
v1
/
dashboards
/
{dashboard_id}
/
agent
Link or unlink an agent to a dashboard
curl --request PATCH \
--url https://api.example.com/api/v1/dashboards/{dashboard_id}/agent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": 123
}
'import requests
url = "https://api.example.com/api/v1/dashboards/{dashboard_id}/agent"
payload = { "agent_id": 123 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({agent_id: 123})
};
fetch('https://api.example.com/api/v1/dashboards/{dashboard_id}/agent', 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/{dashboard_id}/agent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => 123
]),
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/{dashboard_id}/agent"
payload := strings.NewReader("{\n \"agent_id\": 123\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.example.com/api/v1/dashboards/{dashboard_id}/agent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/dashboards/{dashboard_id}/agent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": 123\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.
Path Parameters
Body
application/json
Agent ID to link. Set to null to unlink.
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
Get agent linked to dashboardCreate a dashboardUnpublish a dashboardPublish a dashboardPartially update a dashboard⌘I
Link or unlink an agent to a dashboard
curl --request PATCH \
--url https://api.example.com/api/v1/dashboards/{dashboard_id}/agent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": 123
}
'import requests
url = "https://api.example.com/api/v1/dashboards/{dashboard_id}/agent"
payload = { "agent_id": 123 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({agent_id: 123})
};
fetch('https://api.example.com/api/v1/dashboards/{dashboard_id}/agent', 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/{dashboard_id}/agent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => 123
]),
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/{dashboard_id}/agent"
payload := strings.NewReader("{\n \"agent_id\": 123\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.example.com/api/v1/dashboards/{dashboard_id}/agent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/dashboards/{dashboard_id}/agent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": 123\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": {}
}
]
}