curl --request PATCH \
--url https://api.sidenet.ai/v1/prompt-blocks/{id}/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"content": "You are a support agent for {{company}}. Answer in {{locale || 'English'}}.",
"rules": {
"operator": "AND",
"conditions": [
{
"field": "plan",
"operator": "equals",
"value": "enterprise"
}
]
},
"name": "Brand voice",
"description": "Tone and phrasing every agent shares"
}
EOFimport requests
url = "https://api.sidenet.ai/v1/prompt-blocks/{id}/draft"
payload = {
"content": "You are a support agent for {{company}}. Answer in {{locale || 'English'}}.",
"rules": {
"operator": "AND",
"conditions": [
{
"field": "plan",
"operator": "equals",
"value": "enterprise"
}
]
},
"name": "Brand voice",
"description": "Tone and phrasing every agent shares"
}
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({
content: 'You are a support agent for {{company}}. Answer in {{locale || \'English\'}}.',
rules: {
operator: 'AND',
conditions: [{field: 'plan', operator: 'equals', value: 'enterprise'}]
},
name: 'Brand voice',
description: 'Tone and phrasing every agent shares'
})
};
fetch('https://api.sidenet.ai/v1/prompt-blocks/{id}/draft', 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/prompt-blocks/{id}/draft",
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([
'content' => 'You are a support agent for {{company}}. Answer in {{locale || \'English\'}}.',
'rules' => [
'operator' => 'AND',
'conditions' => [
[
'field' => 'plan',
'operator' => 'equals',
'value' => 'enterprise'
]
]
],
'name' => 'Brand voice',
'description' => 'Tone and phrasing every agent shares'
]),
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/prompt-blocks/{id}/draft"
payload := strings.NewReader("{\n \"content\": \"You are a support agent for {{company}}. Answer in {{locale || 'English'}}.\",\n \"rules\": {\n \"operator\": \"AND\",\n \"conditions\": [\n {\n \"field\": \"plan\",\n \"operator\": \"equals\",\n \"value\": \"enterprise\"\n }\n ]\n },\n \"name\": \"Brand voice\",\n \"description\": \"Tone and phrasing every agent shares\"\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.sidenet.ai/v1/prompt-blocks/{id}/draft")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"You are a support agent for {{company}}. Answer in {{locale || 'English'}}.\",\n \"rules\": {\n \"operator\": \"AND\",\n \"conditions\": [\n {\n \"field\": \"plan\",\n \"operator\": \"equals\",\n \"value\": \"enterprise\"\n }\n ]\n },\n \"name\": \"Brand voice\",\n \"description\": \"Tone and phrasing every agent shares\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sidenet.ai/v1/prompt-blocks/{id}/draft")
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 \"content\": \"You are a support agent for {{company}}. Answer in {{locale || 'English'}}.\",\n \"rules\": {\n \"operator\": \"AND\",\n \"conditions\": [\n {\n \"field\": \"plan\",\n \"operator\": \"equals\",\n \"value\": \"enterprise\"\n }\n ]\n },\n \"name\": \"Brand voice\",\n \"description\": \"Tone and phrasing every agent shares\"\n}"
response = http.request(request)
puts response.read_body{
"draft": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"block_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_number": 123,
"rev": 123,
"content": "<string>",
"rules": {},
"change_message": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Save block draft
Partial save of the block draft (content, rules) plus the block-level name / description. Editing a draft does not affect any published agent version — those are pinned until they are republished.
curl --request PATCH \
--url https://api.sidenet.ai/v1/prompt-blocks/{id}/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"content": "You are a support agent for {{company}}. Answer in {{locale || 'English'}}.",
"rules": {
"operator": "AND",
"conditions": [
{
"field": "plan",
"operator": "equals",
"value": "enterprise"
}
]
},
"name": "Brand voice",
"description": "Tone and phrasing every agent shares"
}
EOFimport requests
url = "https://api.sidenet.ai/v1/prompt-blocks/{id}/draft"
payload = {
"content": "You are a support agent for {{company}}. Answer in {{locale || 'English'}}.",
"rules": {
"operator": "AND",
"conditions": [
{
"field": "plan",
"operator": "equals",
"value": "enterprise"
}
]
},
"name": "Brand voice",
"description": "Tone and phrasing every agent shares"
}
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({
content: 'You are a support agent for {{company}}. Answer in {{locale || \'English\'}}.',
rules: {
operator: 'AND',
conditions: [{field: 'plan', operator: 'equals', value: 'enterprise'}]
},
name: 'Brand voice',
description: 'Tone and phrasing every agent shares'
})
};
fetch('https://api.sidenet.ai/v1/prompt-blocks/{id}/draft', 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/prompt-blocks/{id}/draft",
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([
'content' => 'You are a support agent for {{company}}. Answer in {{locale || \'English\'}}.',
'rules' => [
'operator' => 'AND',
'conditions' => [
[
'field' => 'plan',
'operator' => 'equals',
'value' => 'enterprise'
]
]
],
'name' => 'Brand voice',
'description' => 'Tone and phrasing every agent shares'
]),
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/prompt-blocks/{id}/draft"
payload := strings.NewReader("{\n \"content\": \"You are a support agent for {{company}}. Answer in {{locale || 'English'}}.\",\n \"rules\": {\n \"operator\": \"AND\",\n \"conditions\": [\n {\n \"field\": \"plan\",\n \"operator\": \"equals\",\n \"value\": \"enterprise\"\n }\n ]\n },\n \"name\": \"Brand voice\",\n \"description\": \"Tone and phrasing every agent shares\"\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.sidenet.ai/v1/prompt-blocks/{id}/draft")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"You are a support agent for {{company}}. Answer in {{locale || 'English'}}.\",\n \"rules\": {\n \"operator\": \"AND\",\n \"conditions\": [\n {\n \"field\": \"plan\",\n \"operator\": \"equals\",\n \"value\": \"enterprise\"\n }\n ]\n },\n \"name\": \"Brand voice\",\n \"description\": \"Tone and phrasing every agent shares\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sidenet.ai/v1/prompt-blocks/{id}/draft")
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 \"content\": \"You are a support agent for {{company}}. Answer in {{locale || 'English'}}.\",\n \"rules\": {\n \"operator\": \"AND\",\n \"conditions\": [\n {\n \"field\": \"plan\",\n \"operator\": \"equals\",\n \"value\": \"enterprise\"\n }\n ]\n },\n \"name\": \"Brand voice\",\n \"description\": \"Tone and phrasing every agent shares\"\n}"
response = http.request(request)
puts response.read_body{
"draft": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"block_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_number": 123,
"rev": 123,
"content": "<string>",
"rules": {},
"change_message": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Organization API key, generated in studio.sidenet.ai. Backend only — never in a browser.
Path Parameters
"d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394"
Body
Template text. {{name}}, {{a.b}} and {{name || 'default'}} are resolved per request from the chat body's variables plus the now.* builtins; an unsupplied placeholder is left visible.
"You are a support agent for {{company}}. Answer in {{locale || 'English'}}."
Display condition: { operator: "AND"|"OR", conditions: [...] }, nested up to 3 levels. Each condition is { field, operator, value? }. Null/absent means the block is always included.
{
"operator": "AND",
"conditions": [
{
"field": "plan",
"operator": "equals",
"value": "enterprise"
}
]
}
"Brand voice"
"Tone and phrasing every agent shares"
Response
The saved draft
The whole draft after the merge. Agents pinned to a published version are unaffected until you publish and roll out.
Show child attributes
Show child attributes