Replace text in the dashboard draft
curl --request PATCH \
--url https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/file \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"edits": [
{
"newText": "<string>",
"oldText": "<string>",
"replaceAll": true
}
],
"expectedHash": "<string>"
}
'import requests
url = "https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/file"
payload = {
"edits": [
{
"newText": "<string>",
"oldText": "<string>",
"replaceAll": True
}
],
"expectedHash": "<string>"
}
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({
edits: [{newText: '<string>', oldText: '<string>', replaceAll: true}],
expectedHash: '<string>'
})
};
fetch('https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/file', 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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/file",
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([
'edits' => [
[
'newText' => '<string>',
'oldText' => '<string>',
'replaceAll' => true
]
],
'expectedHash' => '<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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/file"
payload := strings.NewReader("{\n \"edits\": [\n {\n \"newText\": \"<string>\",\n \"oldText\": \"<string>\",\n \"replaceAll\": true\n }\n ],\n \"expectedHash\": \"<string>\"\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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/file")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"edits\": [\n {\n \"newText\": \"<string>\",\n \"oldText\": \"<string>\",\n \"replaceAll\": true\n }\n ],\n \"expectedHash\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/file")
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 \"edits\": [\n {\n \"newText\": \"<string>\",\n \"oldText\": \"<string>\",\n \"replaceAll\": true\n }\n ],\n \"expectedHash\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"content": "<string>",
"hash": "<string>"
}Workbooks
Replace text in the dashboard draft
PATCH
/
api
/
v1
/
deployments
/
{deploymentId}
/
workbooks
/
{workbookId}
/
dashboard
/
file
Replace text in the dashboard draft
curl --request PATCH \
--url https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/file \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"edits": [
{
"newText": "<string>",
"oldText": "<string>",
"replaceAll": true
}
],
"expectedHash": "<string>"
}
'import requests
url = "https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/file"
payload = {
"edits": [
{
"newText": "<string>",
"oldText": "<string>",
"replaceAll": True
}
],
"expectedHash": "<string>"
}
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({
edits: [{newText: '<string>', oldText: '<string>', replaceAll: true}],
expectedHash: '<string>'
})
};
fetch('https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/file', 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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/file",
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([
'edits' => [
[
'newText' => '<string>',
'oldText' => '<string>',
'replaceAll' => true
]
],
'expectedHash' => '<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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/file"
payload := strings.NewReader("{\n \"edits\": [\n {\n \"newText\": \"<string>\",\n \"oldText\": \"<string>\",\n \"replaceAll\": true\n }\n ],\n \"expectedHash\": \"<string>\"\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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/file")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"edits\": [\n {\n \"newText\": \"<string>\",\n \"oldText\": \"<string>\",\n \"replaceAll\": true\n }\n ],\n \"expectedHash\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/file")
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 \"edits\": [\n {\n \"newText\": \"<string>\",\n \"oldText\": \"<string>\",\n \"replaceAll\": true\n }\n ],\n \"expectedHash\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"content": "<string>",
"hash": "<string>"
}Changes part of the classic dashboard draft by exact-text replacement, so a small change sends only that change instead of the whole configuration.
Read
GET /workbooks/{workbookId}/dashboard/file first and copy each oldText from its content, including whitespace. Without replaceAll, oldText must occur exactly once. Edits apply in order; if any one fails, nothing is saved. The result is validated like PUT /workbooks/{workbookId}/dashboard.
Returns the new content and hash. Pass expectedHash to get 409 instead of editing a draft that changed since you read it. Requires manage access to the workbook.Authorizations
Token authentication. Send Authorization: Bearer <YOUR_TOKEN>.
Body
application/json
ReplaceJsonConfigTextInput
Replacements applied in order, each to the result of the previous one. Either all apply or nothing is saved.
Required array length:
1 - 50 elementsShow child attributes
Show child attributes
The hash from your last read. When set, the request fails with 409 if the configuration changed since then.
Pattern:
^[a-f0-9]{64}$Response
200 - application/json
The configuration as canonical JSON text: keys sorted, 2-space indentation, trailing newline. oldText in a replacement must match this text exactly.
SHA-256 of content. Send it back as expectedHash to reject the write if the configuration changed since you read it.