Publish dashboard templates
curl --request POST \
--url https://api.sidenet.ai/v1/dashboard-templates/publish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templates": [
{
"key": "<string>",
"title": "Hotel performance",
"spec": {},
"hash": "<string>",
"description": "<string>",
"icon": "chart",
"tags": [
"general_manager"
],
"when": {
"filter": "property",
"tool": "pms_list_property_options",
"args": {},
"value": "id",
"min_options": 2
},
"ord": 123,
"enabled": true
}
],
"collection": "pms",
"keys": [
"<string>"
],
"commit": "1a2b3c4d5e6f"
}
'import requests
url = "https://api.sidenet.ai/v1/dashboard-templates/publish"
payload = {
"templates": [
{
"key": "<string>",
"title": "Hotel performance",
"spec": {},
"hash": "<string>",
"description": "<string>",
"icon": "chart",
"tags": ["general_manager"],
"when": {
"filter": "property",
"tool": "pms_list_property_options",
"args": {},
"value": "id",
"min_options": 2
},
"ord": 123,
"enabled": True
}
],
"collection": "pms",
"keys": ["<string>"],
"commit": "1a2b3c4d5e6f"
}
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({
templates: [
{
key: '<string>',
title: 'Hotel performance',
spec: {},
hash: '<string>',
description: '<string>',
icon: 'chart',
tags: ['general_manager'],
when: {
filter: 'property',
tool: 'pms_list_property_options',
args: {},
value: 'id',
min_options: 2
},
ord: 123,
enabled: true
}
],
collection: 'pms',
keys: ['<string>'],
commit: '1a2b3c4d5e6f'
})
};
fetch('https://api.sidenet.ai/v1/dashboard-templates/publish', 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.sidenet.ai/v1/dashboard-templates/publish",
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([
'templates' => [
[
'key' => '<string>',
'title' => 'Hotel performance',
'spec' => [
],
'hash' => '<string>',
'description' => '<string>',
'icon' => 'chart',
'tags' => [
'general_manager'
],
'when' => [
'filter' => 'property',
'tool' => 'pms_list_property_options',
'args' => [
],
'value' => 'id',
'min_options' => 2
],
'ord' => 123,
'enabled' => true
]
],
'collection' => 'pms',
'keys' => [
'<string>'
],
'commit' => '1a2b3c4d5e6f'
]),
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.sidenet.ai/v1/dashboard-templates/publish"
payload := strings.NewReader("{\n \"templates\": [\n {\n \"key\": \"<string>\",\n \"title\": \"Hotel performance\",\n \"spec\": {},\n \"hash\": \"<string>\",\n \"description\": \"<string>\",\n \"icon\": \"chart\",\n \"tags\": [\n \"general_manager\"\n ],\n \"when\": {\n \"filter\": \"property\",\n \"tool\": \"pms_list_property_options\",\n \"args\": {},\n \"value\": \"id\",\n \"min_options\": 2\n },\n \"ord\": 123,\n \"enabled\": true\n }\n ],\n \"collection\": \"pms\",\n \"keys\": [\n \"<string>\"\n ],\n \"commit\": \"1a2b3c4d5e6f\"\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.sidenet.ai/v1/dashboard-templates/publish")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"templates\": [\n {\n \"key\": \"<string>\",\n \"title\": \"Hotel performance\",\n \"spec\": {},\n \"hash\": \"<string>\",\n \"description\": \"<string>\",\n \"icon\": \"chart\",\n \"tags\": [\n \"general_manager\"\n ],\n \"when\": {\n \"filter\": \"property\",\n \"tool\": \"pms_list_property_options\",\n \"args\": {},\n \"value\": \"id\",\n \"min_options\": 2\n },\n \"ord\": 123,\n \"enabled\": true\n }\n ],\n \"collection\": \"pms\",\n \"keys\": [\n \"<string>\"\n ],\n \"commit\": \"1a2b3c4d5e6f\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sidenet.ai/v1/dashboard-templates/publish")
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 \"templates\": [\n {\n \"key\": \"<string>\",\n \"title\": \"Hotel performance\",\n \"spec\": {},\n \"hash\": \"<string>\",\n \"description\": \"<string>\",\n \"icon\": \"chart\",\n \"tags\": [\n \"general_manager\"\n ],\n \"when\": {\n \"filter\": \"property\",\n \"tool\": \"pms_list_property_options\",\n \"args\": {},\n \"value\": \"id\",\n \"min_options\": 2\n },\n \"ord\": 123,\n \"enabled\": true\n }\n ],\n \"collection\": \"pms\",\n \"keys\": [\n \"<string>\"\n ],\n \"commit\": \"1a2b3c4d5e6f\"\n}"
response = http.request(request)
puts response.read_body{
"collection": "pms",
"updated": [
"performance"
],
"unchanged": [
"portfolio"
],
"removed": [],
"reordered": false
}Dashboard templates
Publish dashboard templates
The bulk publish a repository’s CI runs (with the platform key, it publishes the templates every organization is shared). One collection per publisher: every template is checked first (nothing is written when one fails), those whose hash differs from the stored one are written, every key gets its position in keys (a template’s own ord wins), and the collection’s published templates whose key is not in keys are removed. Send only the changed templates with the full keys list (GET /v1/dashboard-templates/state for the hashes). A key the organization wrote with PUT is taken over; a key of another collection is refused (409).
POST
/
v1
/
dashboard-templates
/
publish
Publish dashboard templates
curl --request POST \
--url https://api.sidenet.ai/v1/dashboard-templates/publish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templates": [
{
"key": "<string>",
"title": "Hotel performance",
"spec": {},
"hash": "<string>",
"description": "<string>",
"icon": "chart",
"tags": [
"general_manager"
],
"when": {
"filter": "property",
"tool": "pms_list_property_options",
"args": {},
"value": "id",
"min_options": 2
},
"ord": 123,
"enabled": true
}
],
"collection": "pms",
"keys": [
"<string>"
],
"commit": "1a2b3c4d5e6f"
}
'import requests
url = "https://api.sidenet.ai/v1/dashboard-templates/publish"
payload = {
"templates": [
{
"key": "<string>",
"title": "Hotel performance",
"spec": {},
"hash": "<string>",
"description": "<string>",
"icon": "chart",
"tags": ["general_manager"],
"when": {
"filter": "property",
"tool": "pms_list_property_options",
"args": {},
"value": "id",
"min_options": 2
},
"ord": 123,
"enabled": True
}
],
"collection": "pms",
"keys": ["<string>"],
"commit": "1a2b3c4d5e6f"
}
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({
templates: [
{
key: '<string>',
title: 'Hotel performance',
spec: {},
hash: '<string>',
description: '<string>',
icon: 'chart',
tags: ['general_manager'],
when: {
filter: 'property',
tool: 'pms_list_property_options',
args: {},
value: 'id',
min_options: 2
},
ord: 123,
enabled: true
}
],
collection: 'pms',
keys: ['<string>'],
commit: '1a2b3c4d5e6f'
})
};
fetch('https://api.sidenet.ai/v1/dashboard-templates/publish', 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.sidenet.ai/v1/dashboard-templates/publish",
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([
'templates' => [
[
'key' => '<string>',
'title' => 'Hotel performance',
'spec' => [
],
'hash' => '<string>',
'description' => '<string>',
'icon' => 'chart',
'tags' => [
'general_manager'
],
'when' => [
'filter' => 'property',
'tool' => 'pms_list_property_options',
'args' => [
],
'value' => 'id',
'min_options' => 2
],
'ord' => 123,
'enabled' => true
]
],
'collection' => 'pms',
'keys' => [
'<string>'
],
'commit' => '1a2b3c4d5e6f'
]),
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.sidenet.ai/v1/dashboard-templates/publish"
payload := strings.NewReader("{\n \"templates\": [\n {\n \"key\": \"<string>\",\n \"title\": \"Hotel performance\",\n \"spec\": {},\n \"hash\": \"<string>\",\n \"description\": \"<string>\",\n \"icon\": \"chart\",\n \"tags\": [\n \"general_manager\"\n ],\n \"when\": {\n \"filter\": \"property\",\n \"tool\": \"pms_list_property_options\",\n \"args\": {},\n \"value\": \"id\",\n \"min_options\": 2\n },\n \"ord\": 123,\n \"enabled\": true\n }\n ],\n \"collection\": \"pms\",\n \"keys\": [\n \"<string>\"\n ],\n \"commit\": \"1a2b3c4d5e6f\"\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.sidenet.ai/v1/dashboard-templates/publish")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"templates\": [\n {\n \"key\": \"<string>\",\n \"title\": \"Hotel performance\",\n \"spec\": {},\n \"hash\": \"<string>\",\n \"description\": \"<string>\",\n \"icon\": \"chart\",\n \"tags\": [\n \"general_manager\"\n ],\n \"when\": {\n \"filter\": \"property\",\n \"tool\": \"pms_list_property_options\",\n \"args\": {},\n \"value\": \"id\",\n \"min_options\": 2\n },\n \"ord\": 123,\n \"enabled\": true\n }\n ],\n \"collection\": \"pms\",\n \"keys\": [\n \"<string>\"\n ],\n \"commit\": \"1a2b3c4d5e6f\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sidenet.ai/v1/dashboard-templates/publish")
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 \"templates\": [\n {\n \"key\": \"<string>\",\n \"title\": \"Hotel performance\",\n \"spec\": {},\n \"hash\": \"<string>\",\n \"description\": \"<string>\",\n \"icon\": \"chart\",\n \"tags\": [\n \"general_manager\"\n ],\n \"when\": {\n \"filter\": \"property\",\n \"tool\": \"pms_list_property_options\",\n \"args\": {},\n \"value\": \"id\",\n \"min_options\": 2\n },\n \"ord\": 123,\n \"enabled\": true\n }\n ],\n \"collection\": \"pms\",\n \"keys\": [\n \"<string>\"\n ],\n \"commit\": \"1a2b3c4d5e6f\"\n}"
response = http.request(request)
puts response.read_body{
"collection": "pms",
"updated": [
"performance"
],
"unchanged": [
"portfolio"
],
"removed": [],
"reordered": false
}Authorizations
Organization API key, generated in studio.sidenet.ai. Backend only — never in a browser.
Body
application/json