Add a panel (members)
curl --request POST \
--url https://api.apsio.io/v1/projects/{projectId}/dashboards/{dashboardId}/panels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "sql",
"title": "<string>",
"sql": "<string>",
"chart": {
"x": "<string>",
"y": [
"<string>"
],
"series": "<string>",
"unit": "<string>",
"threshold": 123
},
"layout": {
"x": 5,
"y": 500,
"w": 6,
"h": 6
}
}
'import requests
url = "https://api.apsio.io/v1/projects/{projectId}/dashboards/{dashboardId}/panels"
payload = {
"kind": "sql",
"title": "<string>",
"sql": "<string>",
"chart": {
"x": "<string>",
"y": ["<string>"],
"series": "<string>",
"unit": "<string>",
"threshold": 123
},
"layout": {
"x": 5,
"y": 500,
"w": 6,
"h": 6
}
}
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({
kind: 'sql',
title: '<string>',
sql: '<string>',
chart: {
x: '<string>',
y: ['<string>'],
series: '<string>',
unit: '<string>',
threshold: 123
},
layout: {x: 5, y: 500, w: 6, h: 6}
})
};
fetch('https://api.apsio.io/v1/projects/{projectId}/dashboards/{dashboardId}/panels', 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.apsio.io/v1/projects/{projectId}/dashboards/{dashboardId}/panels",
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([
'kind' => 'sql',
'title' => '<string>',
'sql' => '<string>',
'chart' => [
'x' => '<string>',
'y' => [
'<string>'
],
'series' => '<string>',
'unit' => '<string>',
'threshold' => 123
],
'layout' => [
'x' => 5,
'y' => 500,
'w' => 6,
'h' => 6
]
]),
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.apsio.io/v1/projects/{projectId}/dashboards/{dashboardId}/panels"
payload := strings.NewReader("{\n \"kind\": \"sql\",\n \"title\": \"<string>\",\n \"sql\": \"<string>\",\n \"chart\": {\n \"x\": \"<string>\",\n \"y\": [\n \"<string>\"\n ],\n \"series\": \"<string>\",\n \"unit\": \"<string>\",\n \"threshold\": 123\n },\n \"layout\": {\n \"x\": 5,\n \"y\": 500,\n \"w\": 6,\n \"h\": 6\n }\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.apsio.io/v1/projects/{projectId}/dashboards/{dashboardId}/panels")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"sql\",\n \"title\": \"<string>\",\n \"sql\": \"<string>\",\n \"chart\": {\n \"x\": \"<string>\",\n \"y\": [\n \"<string>\"\n ],\n \"series\": \"<string>\",\n \"unit\": \"<string>\",\n \"threshold\": 123\n },\n \"layout\": {\n \"x\": 5,\n \"y\": 500,\n \"w\": 6,\n \"h\": 6\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apsio.io/v1/projects/{projectId}/dashboards/{dashboardId}/panels")
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 \"kind\": \"sql\",\n \"title\": \"<string>\",\n \"sql\": \"<string>\",\n \"chart\": {\n \"x\": \"<string>\",\n \"y\": [\n \"<string>\"\n ],\n \"series\": \"<string>\",\n \"unit\": \"<string>\",\n \"threshold\": 123\n },\n \"layout\": {\n \"x\": 5,\n \"y\": 500,\n \"w\": 6,\n \"h\": 6\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"dashboard_id": "<string>",
"kind": "sql",
"title": "<string>",
"sql": "<string>",
"preset": "<string>",
"params": {},
"chart": {},
"layout": {},
"updated_by": "<string>",
"updated_via": "console",
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}API reference
Add a panel (members)
At most 24 a dashboard. Saving runs nothing. Send Content-Type: application/json.
POST
/
projects
/
{projectId}
/
dashboards
/
{dashboardId}
/
panels
Add a panel (members)
curl --request POST \
--url https://api.apsio.io/v1/projects/{projectId}/dashboards/{dashboardId}/panels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "sql",
"title": "<string>",
"sql": "<string>",
"chart": {
"x": "<string>",
"y": [
"<string>"
],
"series": "<string>",
"unit": "<string>",
"threshold": 123
},
"layout": {
"x": 5,
"y": 500,
"w": 6,
"h": 6
}
}
'import requests
url = "https://api.apsio.io/v1/projects/{projectId}/dashboards/{dashboardId}/panels"
payload = {
"kind": "sql",
"title": "<string>",
"sql": "<string>",
"chart": {
"x": "<string>",
"y": ["<string>"],
"series": "<string>",
"unit": "<string>",
"threshold": 123
},
"layout": {
"x": 5,
"y": 500,
"w": 6,
"h": 6
}
}
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({
kind: 'sql',
title: '<string>',
sql: '<string>',
chart: {
x: '<string>',
y: ['<string>'],
series: '<string>',
unit: '<string>',
threshold: 123
},
layout: {x: 5, y: 500, w: 6, h: 6}
})
};
fetch('https://api.apsio.io/v1/projects/{projectId}/dashboards/{dashboardId}/panels', 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.apsio.io/v1/projects/{projectId}/dashboards/{dashboardId}/panels",
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([
'kind' => 'sql',
'title' => '<string>',
'sql' => '<string>',
'chart' => [
'x' => '<string>',
'y' => [
'<string>'
],
'series' => '<string>',
'unit' => '<string>',
'threshold' => 123
],
'layout' => [
'x' => 5,
'y' => 500,
'w' => 6,
'h' => 6
]
]),
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.apsio.io/v1/projects/{projectId}/dashboards/{dashboardId}/panels"
payload := strings.NewReader("{\n \"kind\": \"sql\",\n \"title\": \"<string>\",\n \"sql\": \"<string>\",\n \"chart\": {\n \"x\": \"<string>\",\n \"y\": [\n \"<string>\"\n ],\n \"series\": \"<string>\",\n \"unit\": \"<string>\",\n \"threshold\": 123\n },\n \"layout\": {\n \"x\": 5,\n \"y\": 500,\n \"w\": 6,\n \"h\": 6\n }\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.apsio.io/v1/projects/{projectId}/dashboards/{dashboardId}/panels")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"sql\",\n \"title\": \"<string>\",\n \"sql\": \"<string>\",\n \"chart\": {\n \"x\": \"<string>\",\n \"y\": [\n \"<string>\"\n ],\n \"series\": \"<string>\",\n \"unit\": \"<string>\",\n \"threshold\": 123\n },\n \"layout\": {\n \"x\": 5,\n \"y\": 500,\n \"w\": 6,\n \"h\": 6\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apsio.io/v1/projects/{projectId}/dashboards/{dashboardId}/panels")
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 \"kind\": \"sql\",\n \"title\": \"<string>\",\n \"sql\": \"<string>\",\n \"chart\": {\n \"x\": \"<string>\",\n \"y\": [\n \"<string>\"\n ],\n \"series\": \"<string>\",\n \"unit\": \"<string>\",\n \"threshold\": 123\n },\n \"layout\": {\n \"x\": 5,\n \"y\": 500,\n \"w\": 6,\n \"h\": 6\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"dashboard_id": "<string>",
"kind": "sql",
"title": "<string>",
"sql": "<string>",
"preset": "<string>",
"params": {},
"chart": {},
"layout": {},
"updated_by": "<string>",
"updated_via": "console",
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}Authorizations
bearersession
A project token (apsio_pt_v0...), which reads exactly one project, or an OAuth access token issued for the API, which reads what its user can. Access tokens issued for Apsio's MCP server are accepted only from the MCP server itself.
Path Parameters
Pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$Example:
"0192f3a4-0000-7000-8000-00000000a101"
Pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$Example:
"0192f3a4-0000-7000-8000-00000000d001"
Body
application/json
- Option 1
- Option 2
Available options:
sql Required string length:
1 - 100Read-only SQL, run as POST /query runs it, with {from:DateTime}, {to:DateTime} and {bucket:UInt32} filled from the board's range.
Required string length:
1 - 10000Show child attributes
Show child attributes
Its place on a grid 12 columns wide.
Show child attributes
Show child attributes
Response
Added.
Available options:
sql, preset Untrusted text: render it as text.
Untrusted text, as written.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
console, token, oauth, mcp