curl --request PATCH \
--url https://api.sidenet.ai/v1/agents/{id}/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"instructions": [
{
"type": "prompt_block_ref",
"id": "d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394"
},
{
"type": "text",
"content": "Answer in {{locale || 'English'}}."
}
],
"model_slug": "anthropic/claude-sonnet-4-5",
"policy_slug": "policy/fastest-sonnet",
"model_options": {
"reasoningEffort": "medium"
},
"model_settings": {
"temperature": 0.2
},
"max_steps": 8,
"tool_search": {
"threshold": 40,
"providers": [
"8d3b1a75-6c02-4e59-b84f-27a9d5e10c63"
],
"always_loaded": [
"BackyouApi_request_hotel_classics"
]
},
"guardrails": [
{
"kind": "prompt_injection",
"mode": "block"
},
{
"kind": "pii",
"mode": "warn",
"options": {
"strategy": "redact",
"detection_types": [
"email",
"phone",
"credit-card"
]
}
},
{
"kind": "moderation",
"mode": "block",
"options": {
"categories": [
"hate",
"harassment",
"violence"
],
"threshold": 0.7
}
}
],
"workflows": [
{
"workflow_id": "4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641"
}
],
"skills": [
{
"skill_id": "9a4e2c71-5b08-4f3d-a6c2-1e7d8b0f4c23"
}
],
"agentTools": [
{
"tool_id": "c07f2b95-8d41-4e63-a029-5f7b1c8d3e40",
"provider_id": "8d3b1a75-6c02-4e59-b84f-27a9d5e10c63"
}
],
"name": "Support agent",
"description": "Answers billing and account questions",
"scorers": [
{
"name": "faithfulness",
"scorerType": "faithfulness",
"model": "openai/gpt-4o-mini",
"sampling_rate": 0.2,
"filter": {
"op": "and",
"args": [
{
"op": "eq",
"left": {
"path": "requestContext.environment"
},
"right": {
"literal": "production"
}
},
{
"op": "in",
"value": {
"path": "requestContext.groupId"
},
"set": [
"grp_vip",
"grp_enterprise"
]
}
]
}
}
],
"agents": [
{
"agentId": "6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10"
}
],
"memory": {
"options": {
"lastMessages": 20,
"workingMemory": {
"enabled": true,
"scope": "resource"
},
"observationalMemory": {
"enabled": true,
"observation": {
"manageWorkingMemory": true,
"bufferOnIdle": true,
"threadTitle": true
}
}
}
}
}
EOFimport requests
url = "https://api.sidenet.ai/v1/agents/{id}/draft"
payload = {
"instructions": [
{
"type": "prompt_block_ref",
"id": "d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394"
},
{
"type": "text",
"content": "Answer in {{locale || 'English'}}."
}
],
"model_slug": "anthropic/claude-sonnet-4-5",
"policy_slug": "policy/fastest-sonnet",
"model_options": { "reasoningEffort": "medium" },
"model_settings": { "temperature": 0.2 },
"max_steps": 8,
"tool_search": {
"threshold": 40,
"providers": ["8d3b1a75-6c02-4e59-b84f-27a9d5e10c63"],
"always_loaded": ["BackyouApi_request_hotel_classics"]
},
"guardrails": [
{
"kind": "prompt_injection",
"mode": "block"
},
{
"kind": "pii",
"mode": "warn",
"options": {
"strategy": "redact",
"detection_types": ["email", "phone", "credit-card"]
}
},
{
"kind": "moderation",
"mode": "block",
"options": {
"categories": ["hate", "harassment", "violence"],
"threshold": 0.7
}
}
],
"workflows": [{ "workflow_id": "4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641" }],
"skills": [{ "skill_id": "9a4e2c71-5b08-4f3d-a6c2-1e7d8b0f4c23" }],
"agentTools": [
{
"tool_id": "c07f2b95-8d41-4e63-a029-5f7b1c8d3e40",
"provider_id": "8d3b1a75-6c02-4e59-b84f-27a9d5e10c63"
}
],
"name": "Support agent",
"description": "Answers billing and account questions",
"scorers": [
{
"name": "faithfulness",
"scorerType": "faithfulness",
"model": "openai/gpt-4o-mini",
"sampling_rate": 0.2,
"filter": {
"op": "and",
"args": [
{
"op": "eq",
"left": { "path": "requestContext.environment" },
"right": { "literal": "production" }
},
{
"op": "in",
"value": { "path": "requestContext.groupId" },
"set": ["grp_vip", "grp_enterprise"]
}
]
}
}
],
"agents": [{ "agentId": "6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10" }],
"memory": { "options": {
"lastMessages": 20,
"workingMemory": {
"enabled": True,
"scope": "resource"
},
"observationalMemory": {
"enabled": True,
"observation": {
"manageWorkingMemory": True,
"bufferOnIdle": True,
"threadTitle": True
}
}
} }
}
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({
instructions: [
{type: 'prompt_block_ref', id: 'd41a8f6b-9c27-4b13-a5e8-2f60c1d7b394'},
{type: 'text', content: 'Answer in {{locale || \'English\'}}.'}
],
model_slug: 'anthropic/claude-sonnet-4-5',
policy_slug: 'policy/fastest-sonnet',
model_options: {reasoningEffort: 'medium'},
model_settings: {temperature: 0.2},
max_steps: 8,
tool_search: {
threshold: 40,
providers: ['8d3b1a75-6c02-4e59-b84f-27a9d5e10c63'],
always_loaded: ['BackyouApi_request_hotel_classics']
},
guardrails: [
{kind: 'prompt_injection', mode: 'block'},
{
kind: 'pii',
mode: 'warn',
options: {strategy: 'redact', detection_types: ['email', 'phone', 'credit-card']}
},
{
kind: 'moderation',
mode: 'block',
options: {categories: ['hate', 'harassment', 'violence'], threshold: 0.7}
}
],
workflows: [{workflow_id: '4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641'}],
skills: [{skill_id: '9a4e2c71-5b08-4f3d-a6c2-1e7d8b0f4c23'}],
agentTools: [
{
tool_id: 'c07f2b95-8d41-4e63-a029-5f7b1c8d3e40',
provider_id: '8d3b1a75-6c02-4e59-b84f-27a9d5e10c63'
}
],
name: 'Support agent',
description: 'Answers billing and account questions',
scorers: [
{
name: 'faithfulness',
scorerType: 'faithfulness',
model: 'openai/gpt-4o-mini',
sampling_rate: 0.2,
filter: {
op: 'and',
args: [
{
op: 'eq',
left: {path: 'requestContext.environment'},
right: {literal: 'production'}
},
{
op: 'in',
value: {path: 'requestContext.groupId'},
set: ['grp_vip', 'grp_enterprise']
}
]
}
}
],
agents: [{agentId: '6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10'}],
memory: {
options: {
lastMessages: 20,
workingMemory: {enabled: true, scope: 'resource'},
observationalMemory: {
enabled: true,
observation: {manageWorkingMemory: true, bufferOnIdle: true, threadTitle: true}
}
}
}
})
};
fetch('https://api.sidenet.ai/v1/agents/{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/agents/{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([
'instructions' => [
[
'type' => 'prompt_block_ref',
'id' => 'd41a8f6b-9c27-4b13-a5e8-2f60c1d7b394'
],
[
'type' => 'text',
'content' => 'Answer in {{locale || \'English\'}}.'
]
],
'model_slug' => 'anthropic/claude-sonnet-4-5',
'policy_slug' => 'policy/fastest-sonnet',
'model_options' => [
'reasoningEffort' => 'medium'
],
'model_settings' => [
'temperature' => 0.2
],
'max_steps' => 8,
'tool_search' => [
'threshold' => 40,
'providers' => [
'8d3b1a75-6c02-4e59-b84f-27a9d5e10c63'
],
'always_loaded' => [
'BackyouApi_request_hotel_classics'
]
],
'guardrails' => [
[
'kind' => 'prompt_injection',
'mode' => 'block'
],
[
'kind' => 'pii',
'mode' => 'warn',
'options' => [
'strategy' => 'redact',
'detection_types' => [
'email',
'phone',
'credit-card'
]
]
],
[
'kind' => 'moderation',
'mode' => 'block',
'options' => [
'categories' => [
'hate',
'harassment',
'violence'
],
'threshold' => 0.7
]
]
],
'workflows' => [
[
'workflow_id' => '4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641'
]
],
'skills' => [
[
'skill_id' => '9a4e2c71-5b08-4f3d-a6c2-1e7d8b0f4c23'
]
],
'agentTools' => [
[
'tool_id' => 'c07f2b95-8d41-4e63-a029-5f7b1c8d3e40',
'provider_id' => '8d3b1a75-6c02-4e59-b84f-27a9d5e10c63'
]
],
'name' => 'Support agent',
'description' => 'Answers billing and account questions',
'scorers' => [
[
'name' => 'faithfulness',
'scorerType' => 'faithfulness',
'model' => 'openai/gpt-4o-mini',
'sampling_rate' => 0.2,
'filter' => [
'op' => 'and',
'args' => [
[
'op' => 'eq',
'left' => [
'path' => 'requestContext.environment'
],
'right' => [
'literal' => 'production'
]
],
[
'op' => 'in',
'value' => [
'path' => 'requestContext.groupId'
],
'set' => [
'grp_vip',
'grp_enterprise'
]
]
]
]
]
],
'agents' => [
[
'agentId' => '6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10'
]
],
'memory' => [
'options' => [
'lastMessages' => 20,
'workingMemory' => [
'enabled' => true,
'scope' => 'resource'
],
'observationalMemory' => [
'enabled' => true,
'observation' => [
'manageWorkingMemory' => true,
'bufferOnIdle' => true,
'threadTitle' => true
]
]
]
]
]),
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/agents/{id}/draft"
payload := strings.NewReader("{\n \"instructions\": [\n {\n \"type\": \"prompt_block_ref\",\n \"id\": \"d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394\"\n },\n {\n \"type\": \"text\",\n \"content\": \"Answer in {{locale || 'English'}}.\"\n }\n ],\n \"model_slug\": \"anthropic/claude-sonnet-4-5\",\n \"policy_slug\": \"policy/fastest-sonnet\",\n \"model_options\": {\n \"reasoningEffort\": \"medium\"\n },\n \"model_settings\": {\n \"temperature\": 0.2\n },\n \"max_steps\": 8,\n \"tool_search\": {\n \"threshold\": 40,\n \"providers\": [\n \"8d3b1a75-6c02-4e59-b84f-27a9d5e10c63\"\n ],\n \"always_loaded\": [\n \"BackyouApi_request_hotel_classics\"\n ]\n },\n \"guardrails\": [\n {\n \"kind\": \"prompt_injection\",\n \"mode\": \"block\"\n },\n {\n \"kind\": \"pii\",\n \"mode\": \"warn\",\n \"options\": {\n \"strategy\": \"redact\",\n \"detection_types\": [\n \"email\",\n \"phone\",\n \"credit-card\"\n ]\n }\n },\n {\n \"kind\": \"moderation\",\n \"mode\": \"block\",\n \"options\": {\n \"categories\": [\n \"hate\",\n \"harassment\",\n \"violence\"\n ],\n \"threshold\": 0.7\n }\n }\n ],\n \"workflows\": [\n {\n \"workflow_id\": \"4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641\"\n }\n ],\n \"skills\": [\n {\n \"skill_id\": \"9a4e2c71-5b08-4f3d-a6c2-1e7d8b0f4c23\"\n }\n ],\n \"agentTools\": [\n {\n \"tool_id\": \"c07f2b95-8d41-4e63-a029-5f7b1c8d3e40\",\n \"provider_id\": \"8d3b1a75-6c02-4e59-b84f-27a9d5e10c63\"\n }\n ],\n \"name\": \"Support agent\",\n \"description\": \"Answers billing and account questions\",\n \"scorers\": [\n {\n \"name\": \"faithfulness\",\n \"scorerType\": \"faithfulness\",\n \"model\": \"openai/gpt-4o-mini\",\n \"sampling_rate\": 0.2,\n \"filter\": {\n \"op\": \"and\",\n \"args\": [\n {\n \"op\": \"eq\",\n \"left\": {\n \"path\": \"requestContext.environment\"\n },\n \"right\": {\n \"literal\": \"production\"\n }\n },\n {\n \"op\": \"in\",\n \"value\": {\n \"path\": \"requestContext.groupId\"\n },\n \"set\": [\n \"grp_vip\",\n \"grp_enterprise\"\n ]\n }\n ]\n }\n }\n ],\n \"agents\": [\n {\n \"agentId\": \"6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10\"\n }\n ],\n \"memory\": {\n \"options\": {\n \"lastMessages\": 20,\n \"workingMemory\": {\n \"enabled\": true,\n \"scope\": \"resource\"\n },\n \"observationalMemory\": {\n \"enabled\": true,\n \"observation\": {\n \"manageWorkingMemory\": true,\n \"bufferOnIdle\": true,\n \"threadTitle\": true\n }\n }\n }\n }\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/agents/{id}/draft")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instructions\": [\n {\n \"type\": \"prompt_block_ref\",\n \"id\": \"d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394\"\n },\n {\n \"type\": \"text\",\n \"content\": \"Answer in {{locale || 'English'}}.\"\n }\n ],\n \"model_slug\": \"anthropic/claude-sonnet-4-5\",\n \"policy_slug\": \"policy/fastest-sonnet\",\n \"model_options\": {\n \"reasoningEffort\": \"medium\"\n },\n \"model_settings\": {\n \"temperature\": 0.2\n },\n \"max_steps\": 8,\n \"tool_search\": {\n \"threshold\": 40,\n \"providers\": [\n \"8d3b1a75-6c02-4e59-b84f-27a9d5e10c63\"\n ],\n \"always_loaded\": [\n \"BackyouApi_request_hotel_classics\"\n ]\n },\n \"guardrails\": [\n {\n \"kind\": \"prompt_injection\",\n \"mode\": \"block\"\n },\n {\n \"kind\": \"pii\",\n \"mode\": \"warn\",\n \"options\": {\n \"strategy\": \"redact\",\n \"detection_types\": [\n \"email\",\n \"phone\",\n \"credit-card\"\n ]\n }\n },\n {\n \"kind\": \"moderation\",\n \"mode\": \"block\",\n \"options\": {\n \"categories\": [\n \"hate\",\n \"harassment\",\n \"violence\"\n ],\n \"threshold\": 0.7\n }\n }\n ],\n \"workflows\": [\n {\n \"workflow_id\": \"4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641\"\n }\n ],\n \"skills\": [\n {\n \"skill_id\": \"9a4e2c71-5b08-4f3d-a6c2-1e7d8b0f4c23\"\n }\n ],\n \"agentTools\": [\n {\n \"tool_id\": \"c07f2b95-8d41-4e63-a029-5f7b1c8d3e40\",\n \"provider_id\": \"8d3b1a75-6c02-4e59-b84f-27a9d5e10c63\"\n }\n ],\n \"name\": \"Support agent\",\n \"description\": \"Answers billing and account questions\",\n \"scorers\": [\n {\n \"name\": \"faithfulness\",\n \"scorerType\": \"faithfulness\",\n \"model\": \"openai/gpt-4o-mini\",\n \"sampling_rate\": 0.2,\n \"filter\": {\n \"op\": \"and\",\n \"args\": [\n {\n \"op\": \"eq\",\n \"left\": {\n \"path\": \"requestContext.environment\"\n },\n \"right\": {\n \"literal\": \"production\"\n }\n },\n {\n \"op\": \"in\",\n \"value\": {\n \"path\": \"requestContext.groupId\"\n },\n \"set\": [\n \"grp_vip\",\n \"grp_enterprise\"\n ]\n }\n ]\n }\n }\n ],\n \"agents\": [\n {\n \"agentId\": \"6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10\"\n }\n ],\n \"memory\": {\n \"options\": {\n \"lastMessages\": 20,\n \"workingMemory\": {\n \"enabled\": true,\n \"scope\": \"resource\"\n },\n \"observationalMemory\": {\n \"enabled\": true,\n \"observation\": {\n \"manageWorkingMemory\": true,\n \"bufferOnIdle\": true,\n \"threadTitle\": true\n }\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sidenet.ai/v1/agents/{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 \"instructions\": [\n {\n \"type\": \"prompt_block_ref\",\n \"id\": \"d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394\"\n },\n {\n \"type\": \"text\",\n \"content\": \"Answer in {{locale || 'English'}}.\"\n }\n ],\n \"model_slug\": \"anthropic/claude-sonnet-4-5\",\n \"policy_slug\": \"policy/fastest-sonnet\",\n \"model_options\": {\n \"reasoningEffort\": \"medium\"\n },\n \"model_settings\": {\n \"temperature\": 0.2\n },\n \"max_steps\": 8,\n \"tool_search\": {\n \"threshold\": 40,\n \"providers\": [\n \"8d3b1a75-6c02-4e59-b84f-27a9d5e10c63\"\n ],\n \"always_loaded\": [\n \"BackyouApi_request_hotel_classics\"\n ]\n },\n \"guardrails\": [\n {\n \"kind\": \"prompt_injection\",\n \"mode\": \"block\"\n },\n {\n \"kind\": \"pii\",\n \"mode\": \"warn\",\n \"options\": {\n \"strategy\": \"redact\",\n \"detection_types\": [\n \"email\",\n \"phone\",\n \"credit-card\"\n ]\n }\n },\n {\n \"kind\": \"moderation\",\n \"mode\": \"block\",\n \"options\": {\n \"categories\": [\n \"hate\",\n \"harassment\",\n \"violence\"\n ],\n \"threshold\": 0.7\n }\n }\n ],\n \"workflows\": [\n {\n \"workflow_id\": \"4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641\"\n }\n ],\n \"skills\": [\n {\n \"skill_id\": \"9a4e2c71-5b08-4f3d-a6c2-1e7d8b0f4c23\"\n }\n ],\n \"agentTools\": [\n {\n \"tool_id\": \"c07f2b95-8d41-4e63-a029-5f7b1c8d3e40\",\n \"provider_id\": \"8d3b1a75-6c02-4e59-b84f-27a9d5e10c63\"\n }\n ],\n \"name\": \"Support agent\",\n \"description\": \"Answers billing and account questions\",\n \"scorers\": [\n {\n \"name\": \"faithfulness\",\n \"scorerType\": \"faithfulness\",\n \"model\": \"openai/gpt-4o-mini\",\n \"sampling_rate\": 0.2,\n \"filter\": {\n \"op\": \"and\",\n \"args\": [\n {\n \"op\": \"eq\",\n \"left\": {\n \"path\": \"requestContext.environment\"\n },\n \"right\": {\n \"literal\": \"production\"\n }\n },\n {\n \"op\": \"in\",\n \"value\": {\n \"path\": \"requestContext.groupId\"\n },\n \"set\": [\n \"grp_vip\",\n \"grp_enterprise\"\n ]\n }\n ]\n }\n }\n ],\n \"agents\": [\n {\n \"agentId\": \"6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10\"\n }\n ],\n \"memory\": {\n \"options\": {\n \"lastMessages\": 20,\n \"workingMemory\": {\n \"enabled\": true,\n \"scope\": \"resource\"\n },\n \"observationalMemory\": {\n \"enabled\": true,\n \"observation\": {\n \"manageWorkingMemory\": true,\n \"bufferOnIdle\": true,\n \"threadTitle\": true\n }\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"active_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"activeVersionNumber": 123,
"latestPublishedVersionNumber": 123,
"draftDirty": true
},
"draft": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_number": 123,
"rev": 123,
"instructions": [
{}
],
"model_slug": "<string>",
"policy_slug": "<string>",
"model_options": {},
"model_settings": {},
"max_steps": 123,
"tool_search": {},
"guardrails": [
{}
],
"agentTools": [
{}
],
"workflows": [
{}
],
"skills": [
{}
],
"agents": [
{}
],
"scorers": [
{}
],
"memory": {
"options": {
"lastMessages": 20,
"workingMemory": {
"enabled": true,
"scope": "resource"
},
"observationalMemory": {
"enabled": true,
"observation": {
"manageWorkingMemory": true,
"bufferOnIdle": true,
"threadTitle": true
}
}
}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Save agent draft
Partial save of the draft agent config (instructions, model fields, agentTools, tool_search, guardrails, workflows, memory, scorers, subagents, etc). Only the fields you send are written. Subagents are [{ agentId }]. The model fields are model_slug, policy_slug, model_options and model_settings; the older requesty_model_slug, requesty_policy_slug and requesty_options spellings are still accepted and mapped onto them (the canonical name wins if you send both). prompt, model_name, model_provider and model_openrouter_slug no longer exist and are ignored — the system prompt is instructions. name and description are the agent’s own, not the draft’s: they are saved here for convenience but apply immediately to every version, published ones included, and need no publish. The response carries the updated agent alongside the draft.
curl --request PATCH \
--url https://api.sidenet.ai/v1/agents/{id}/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"instructions": [
{
"type": "prompt_block_ref",
"id": "d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394"
},
{
"type": "text",
"content": "Answer in {{locale || 'English'}}."
}
],
"model_slug": "anthropic/claude-sonnet-4-5",
"policy_slug": "policy/fastest-sonnet",
"model_options": {
"reasoningEffort": "medium"
},
"model_settings": {
"temperature": 0.2
},
"max_steps": 8,
"tool_search": {
"threshold": 40,
"providers": [
"8d3b1a75-6c02-4e59-b84f-27a9d5e10c63"
],
"always_loaded": [
"BackyouApi_request_hotel_classics"
]
},
"guardrails": [
{
"kind": "prompt_injection",
"mode": "block"
},
{
"kind": "pii",
"mode": "warn",
"options": {
"strategy": "redact",
"detection_types": [
"email",
"phone",
"credit-card"
]
}
},
{
"kind": "moderation",
"mode": "block",
"options": {
"categories": [
"hate",
"harassment",
"violence"
],
"threshold": 0.7
}
}
],
"workflows": [
{
"workflow_id": "4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641"
}
],
"skills": [
{
"skill_id": "9a4e2c71-5b08-4f3d-a6c2-1e7d8b0f4c23"
}
],
"agentTools": [
{
"tool_id": "c07f2b95-8d41-4e63-a029-5f7b1c8d3e40",
"provider_id": "8d3b1a75-6c02-4e59-b84f-27a9d5e10c63"
}
],
"name": "Support agent",
"description": "Answers billing and account questions",
"scorers": [
{
"name": "faithfulness",
"scorerType": "faithfulness",
"model": "openai/gpt-4o-mini",
"sampling_rate": 0.2,
"filter": {
"op": "and",
"args": [
{
"op": "eq",
"left": {
"path": "requestContext.environment"
},
"right": {
"literal": "production"
}
},
{
"op": "in",
"value": {
"path": "requestContext.groupId"
},
"set": [
"grp_vip",
"grp_enterprise"
]
}
]
}
}
],
"agents": [
{
"agentId": "6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10"
}
],
"memory": {
"options": {
"lastMessages": 20,
"workingMemory": {
"enabled": true,
"scope": "resource"
},
"observationalMemory": {
"enabled": true,
"observation": {
"manageWorkingMemory": true,
"bufferOnIdle": true,
"threadTitle": true
}
}
}
}
}
EOFimport requests
url = "https://api.sidenet.ai/v1/agents/{id}/draft"
payload = {
"instructions": [
{
"type": "prompt_block_ref",
"id": "d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394"
},
{
"type": "text",
"content": "Answer in {{locale || 'English'}}."
}
],
"model_slug": "anthropic/claude-sonnet-4-5",
"policy_slug": "policy/fastest-sonnet",
"model_options": { "reasoningEffort": "medium" },
"model_settings": { "temperature": 0.2 },
"max_steps": 8,
"tool_search": {
"threshold": 40,
"providers": ["8d3b1a75-6c02-4e59-b84f-27a9d5e10c63"],
"always_loaded": ["BackyouApi_request_hotel_classics"]
},
"guardrails": [
{
"kind": "prompt_injection",
"mode": "block"
},
{
"kind": "pii",
"mode": "warn",
"options": {
"strategy": "redact",
"detection_types": ["email", "phone", "credit-card"]
}
},
{
"kind": "moderation",
"mode": "block",
"options": {
"categories": ["hate", "harassment", "violence"],
"threshold": 0.7
}
}
],
"workflows": [{ "workflow_id": "4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641" }],
"skills": [{ "skill_id": "9a4e2c71-5b08-4f3d-a6c2-1e7d8b0f4c23" }],
"agentTools": [
{
"tool_id": "c07f2b95-8d41-4e63-a029-5f7b1c8d3e40",
"provider_id": "8d3b1a75-6c02-4e59-b84f-27a9d5e10c63"
}
],
"name": "Support agent",
"description": "Answers billing and account questions",
"scorers": [
{
"name": "faithfulness",
"scorerType": "faithfulness",
"model": "openai/gpt-4o-mini",
"sampling_rate": 0.2,
"filter": {
"op": "and",
"args": [
{
"op": "eq",
"left": { "path": "requestContext.environment" },
"right": { "literal": "production" }
},
{
"op": "in",
"value": { "path": "requestContext.groupId" },
"set": ["grp_vip", "grp_enterprise"]
}
]
}
}
],
"agents": [{ "agentId": "6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10" }],
"memory": { "options": {
"lastMessages": 20,
"workingMemory": {
"enabled": True,
"scope": "resource"
},
"observationalMemory": {
"enabled": True,
"observation": {
"manageWorkingMemory": True,
"bufferOnIdle": True,
"threadTitle": True
}
}
} }
}
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({
instructions: [
{type: 'prompt_block_ref', id: 'd41a8f6b-9c27-4b13-a5e8-2f60c1d7b394'},
{type: 'text', content: 'Answer in {{locale || \'English\'}}.'}
],
model_slug: 'anthropic/claude-sonnet-4-5',
policy_slug: 'policy/fastest-sonnet',
model_options: {reasoningEffort: 'medium'},
model_settings: {temperature: 0.2},
max_steps: 8,
tool_search: {
threshold: 40,
providers: ['8d3b1a75-6c02-4e59-b84f-27a9d5e10c63'],
always_loaded: ['BackyouApi_request_hotel_classics']
},
guardrails: [
{kind: 'prompt_injection', mode: 'block'},
{
kind: 'pii',
mode: 'warn',
options: {strategy: 'redact', detection_types: ['email', 'phone', 'credit-card']}
},
{
kind: 'moderation',
mode: 'block',
options: {categories: ['hate', 'harassment', 'violence'], threshold: 0.7}
}
],
workflows: [{workflow_id: '4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641'}],
skills: [{skill_id: '9a4e2c71-5b08-4f3d-a6c2-1e7d8b0f4c23'}],
agentTools: [
{
tool_id: 'c07f2b95-8d41-4e63-a029-5f7b1c8d3e40',
provider_id: '8d3b1a75-6c02-4e59-b84f-27a9d5e10c63'
}
],
name: 'Support agent',
description: 'Answers billing and account questions',
scorers: [
{
name: 'faithfulness',
scorerType: 'faithfulness',
model: 'openai/gpt-4o-mini',
sampling_rate: 0.2,
filter: {
op: 'and',
args: [
{
op: 'eq',
left: {path: 'requestContext.environment'},
right: {literal: 'production'}
},
{
op: 'in',
value: {path: 'requestContext.groupId'},
set: ['grp_vip', 'grp_enterprise']
}
]
}
}
],
agents: [{agentId: '6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10'}],
memory: {
options: {
lastMessages: 20,
workingMemory: {enabled: true, scope: 'resource'},
observationalMemory: {
enabled: true,
observation: {manageWorkingMemory: true, bufferOnIdle: true, threadTitle: true}
}
}
}
})
};
fetch('https://api.sidenet.ai/v1/agents/{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/agents/{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([
'instructions' => [
[
'type' => 'prompt_block_ref',
'id' => 'd41a8f6b-9c27-4b13-a5e8-2f60c1d7b394'
],
[
'type' => 'text',
'content' => 'Answer in {{locale || \'English\'}}.'
]
],
'model_slug' => 'anthropic/claude-sonnet-4-5',
'policy_slug' => 'policy/fastest-sonnet',
'model_options' => [
'reasoningEffort' => 'medium'
],
'model_settings' => [
'temperature' => 0.2
],
'max_steps' => 8,
'tool_search' => [
'threshold' => 40,
'providers' => [
'8d3b1a75-6c02-4e59-b84f-27a9d5e10c63'
],
'always_loaded' => [
'BackyouApi_request_hotel_classics'
]
],
'guardrails' => [
[
'kind' => 'prompt_injection',
'mode' => 'block'
],
[
'kind' => 'pii',
'mode' => 'warn',
'options' => [
'strategy' => 'redact',
'detection_types' => [
'email',
'phone',
'credit-card'
]
]
],
[
'kind' => 'moderation',
'mode' => 'block',
'options' => [
'categories' => [
'hate',
'harassment',
'violence'
],
'threshold' => 0.7
]
]
],
'workflows' => [
[
'workflow_id' => '4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641'
]
],
'skills' => [
[
'skill_id' => '9a4e2c71-5b08-4f3d-a6c2-1e7d8b0f4c23'
]
],
'agentTools' => [
[
'tool_id' => 'c07f2b95-8d41-4e63-a029-5f7b1c8d3e40',
'provider_id' => '8d3b1a75-6c02-4e59-b84f-27a9d5e10c63'
]
],
'name' => 'Support agent',
'description' => 'Answers billing and account questions',
'scorers' => [
[
'name' => 'faithfulness',
'scorerType' => 'faithfulness',
'model' => 'openai/gpt-4o-mini',
'sampling_rate' => 0.2,
'filter' => [
'op' => 'and',
'args' => [
[
'op' => 'eq',
'left' => [
'path' => 'requestContext.environment'
],
'right' => [
'literal' => 'production'
]
],
[
'op' => 'in',
'value' => [
'path' => 'requestContext.groupId'
],
'set' => [
'grp_vip',
'grp_enterprise'
]
]
]
]
]
],
'agents' => [
[
'agentId' => '6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10'
]
],
'memory' => [
'options' => [
'lastMessages' => 20,
'workingMemory' => [
'enabled' => true,
'scope' => 'resource'
],
'observationalMemory' => [
'enabled' => true,
'observation' => [
'manageWorkingMemory' => true,
'bufferOnIdle' => true,
'threadTitle' => true
]
]
]
]
]),
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/agents/{id}/draft"
payload := strings.NewReader("{\n \"instructions\": [\n {\n \"type\": \"prompt_block_ref\",\n \"id\": \"d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394\"\n },\n {\n \"type\": \"text\",\n \"content\": \"Answer in {{locale || 'English'}}.\"\n }\n ],\n \"model_slug\": \"anthropic/claude-sonnet-4-5\",\n \"policy_slug\": \"policy/fastest-sonnet\",\n \"model_options\": {\n \"reasoningEffort\": \"medium\"\n },\n \"model_settings\": {\n \"temperature\": 0.2\n },\n \"max_steps\": 8,\n \"tool_search\": {\n \"threshold\": 40,\n \"providers\": [\n \"8d3b1a75-6c02-4e59-b84f-27a9d5e10c63\"\n ],\n \"always_loaded\": [\n \"BackyouApi_request_hotel_classics\"\n ]\n },\n \"guardrails\": [\n {\n \"kind\": \"prompt_injection\",\n \"mode\": \"block\"\n },\n {\n \"kind\": \"pii\",\n \"mode\": \"warn\",\n \"options\": {\n \"strategy\": \"redact\",\n \"detection_types\": [\n \"email\",\n \"phone\",\n \"credit-card\"\n ]\n }\n },\n {\n \"kind\": \"moderation\",\n \"mode\": \"block\",\n \"options\": {\n \"categories\": [\n \"hate\",\n \"harassment\",\n \"violence\"\n ],\n \"threshold\": 0.7\n }\n }\n ],\n \"workflows\": [\n {\n \"workflow_id\": \"4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641\"\n }\n ],\n \"skills\": [\n {\n \"skill_id\": \"9a4e2c71-5b08-4f3d-a6c2-1e7d8b0f4c23\"\n }\n ],\n \"agentTools\": [\n {\n \"tool_id\": \"c07f2b95-8d41-4e63-a029-5f7b1c8d3e40\",\n \"provider_id\": \"8d3b1a75-6c02-4e59-b84f-27a9d5e10c63\"\n }\n ],\n \"name\": \"Support agent\",\n \"description\": \"Answers billing and account questions\",\n \"scorers\": [\n {\n \"name\": \"faithfulness\",\n \"scorerType\": \"faithfulness\",\n \"model\": \"openai/gpt-4o-mini\",\n \"sampling_rate\": 0.2,\n \"filter\": {\n \"op\": \"and\",\n \"args\": [\n {\n \"op\": \"eq\",\n \"left\": {\n \"path\": \"requestContext.environment\"\n },\n \"right\": {\n \"literal\": \"production\"\n }\n },\n {\n \"op\": \"in\",\n \"value\": {\n \"path\": \"requestContext.groupId\"\n },\n \"set\": [\n \"grp_vip\",\n \"grp_enterprise\"\n ]\n }\n ]\n }\n }\n ],\n \"agents\": [\n {\n \"agentId\": \"6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10\"\n }\n ],\n \"memory\": {\n \"options\": {\n \"lastMessages\": 20,\n \"workingMemory\": {\n \"enabled\": true,\n \"scope\": \"resource\"\n },\n \"observationalMemory\": {\n \"enabled\": true,\n \"observation\": {\n \"manageWorkingMemory\": true,\n \"bufferOnIdle\": true,\n \"threadTitle\": true\n }\n }\n }\n }\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/agents/{id}/draft")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instructions\": [\n {\n \"type\": \"prompt_block_ref\",\n \"id\": \"d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394\"\n },\n {\n \"type\": \"text\",\n \"content\": \"Answer in {{locale || 'English'}}.\"\n }\n ],\n \"model_slug\": \"anthropic/claude-sonnet-4-5\",\n \"policy_slug\": \"policy/fastest-sonnet\",\n \"model_options\": {\n \"reasoningEffort\": \"medium\"\n },\n \"model_settings\": {\n \"temperature\": 0.2\n },\n \"max_steps\": 8,\n \"tool_search\": {\n \"threshold\": 40,\n \"providers\": [\n \"8d3b1a75-6c02-4e59-b84f-27a9d5e10c63\"\n ],\n \"always_loaded\": [\n \"BackyouApi_request_hotel_classics\"\n ]\n },\n \"guardrails\": [\n {\n \"kind\": \"prompt_injection\",\n \"mode\": \"block\"\n },\n {\n \"kind\": \"pii\",\n \"mode\": \"warn\",\n \"options\": {\n \"strategy\": \"redact\",\n \"detection_types\": [\n \"email\",\n \"phone\",\n \"credit-card\"\n ]\n }\n },\n {\n \"kind\": \"moderation\",\n \"mode\": \"block\",\n \"options\": {\n \"categories\": [\n \"hate\",\n \"harassment\",\n \"violence\"\n ],\n \"threshold\": 0.7\n }\n }\n ],\n \"workflows\": [\n {\n \"workflow_id\": \"4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641\"\n }\n ],\n \"skills\": [\n {\n \"skill_id\": \"9a4e2c71-5b08-4f3d-a6c2-1e7d8b0f4c23\"\n }\n ],\n \"agentTools\": [\n {\n \"tool_id\": \"c07f2b95-8d41-4e63-a029-5f7b1c8d3e40\",\n \"provider_id\": \"8d3b1a75-6c02-4e59-b84f-27a9d5e10c63\"\n }\n ],\n \"name\": \"Support agent\",\n \"description\": \"Answers billing and account questions\",\n \"scorers\": [\n {\n \"name\": \"faithfulness\",\n \"scorerType\": \"faithfulness\",\n \"model\": \"openai/gpt-4o-mini\",\n \"sampling_rate\": 0.2,\n \"filter\": {\n \"op\": \"and\",\n \"args\": [\n {\n \"op\": \"eq\",\n \"left\": {\n \"path\": \"requestContext.environment\"\n },\n \"right\": {\n \"literal\": \"production\"\n }\n },\n {\n \"op\": \"in\",\n \"value\": {\n \"path\": \"requestContext.groupId\"\n },\n \"set\": [\n \"grp_vip\",\n \"grp_enterprise\"\n ]\n }\n ]\n }\n }\n ],\n \"agents\": [\n {\n \"agentId\": \"6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10\"\n }\n ],\n \"memory\": {\n \"options\": {\n \"lastMessages\": 20,\n \"workingMemory\": {\n \"enabled\": true,\n \"scope\": \"resource\"\n },\n \"observationalMemory\": {\n \"enabled\": true,\n \"observation\": {\n \"manageWorkingMemory\": true,\n \"bufferOnIdle\": true,\n \"threadTitle\": true\n }\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sidenet.ai/v1/agents/{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 \"instructions\": [\n {\n \"type\": \"prompt_block_ref\",\n \"id\": \"d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394\"\n },\n {\n \"type\": \"text\",\n \"content\": \"Answer in {{locale || 'English'}}.\"\n }\n ],\n \"model_slug\": \"anthropic/claude-sonnet-4-5\",\n \"policy_slug\": \"policy/fastest-sonnet\",\n \"model_options\": {\n \"reasoningEffort\": \"medium\"\n },\n \"model_settings\": {\n \"temperature\": 0.2\n },\n \"max_steps\": 8,\n \"tool_search\": {\n \"threshold\": 40,\n \"providers\": [\n \"8d3b1a75-6c02-4e59-b84f-27a9d5e10c63\"\n ],\n \"always_loaded\": [\n \"BackyouApi_request_hotel_classics\"\n ]\n },\n \"guardrails\": [\n {\n \"kind\": \"prompt_injection\",\n \"mode\": \"block\"\n },\n {\n \"kind\": \"pii\",\n \"mode\": \"warn\",\n \"options\": {\n \"strategy\": \"redact\",\n \"detection_types\": [\n \"email\",\n \"phone\",\n \"credit-card\"\n ]\n }\n },\n {\n \"kind\": \"moderation\",\n \"mode\": \"block\",\n \"options\": {\n \"categories\": [\n \"hate\",\n \"harassment\",\n \"violence\"\n ],\n \"threshold\": 0.7\n }\n }\n ],\n \"workflows\": [\n {\n \"workflow_id\": \"4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641\"\n }\n ],\n \"skills\": [\n {\n \"skill_id\": \"9a4e2c71-5b08-4f3d-a6c2-1e7d8b0f4c23\"\n }\n ],\n \"agentTools\": [\n {\n \"tool_id\": \"c07f2b95-8d41-4e63-a029-5f7b1c8d3e40\",\n \"provider_id\": \"8d3b1a75-6c02-4e59-b84f-27a9d5e10c63\"\n }\n ],\n \"name\": \"Support agent\",\n \"description\": \"Answers billing and account questions\",\n \"scorers\": [\n {\n \"name\": \"faithfulness\",\n \"scorerType\": \"faithfulness\",\n \"model\": \"openai/gpt-4o-mini\",\n \"sampling_rate\": 0.2,\n \"filter\": {\n \"op\": \"and\",\n \"args\": [\n {\n \"op\": \"eq\",\n \"left\": {\n \"path\": \"requestContext.environment\"\n },\n \"right\": {\n \"literal\": \"production\"\n }\n },\n {\n \"op\": \"in\",\n \"value\": {\n \"path\": \"requestContext.groupId\"\n },\n \"set\": [\n \"grp_vip\",\n \"grp_enterprise\"\n ]\n }\n ]\n }\n }\n ],\n \"agents\": [\n {\n \"agentId\": \"6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10\"\n }\n ],\n \"memory\": {\n \"options\": {\n \"lastMessages\": 20,\n \"workingMemory\": {\n \"enabled\": true,\n \"scope\": \"resource\"\n },\n \"observationalMemory\": {\n \"enabled\": true,\n \"observation\": {\n \"manageWorkingMemory\": true,\n \"bufferOnIdle\": true,\n \"threadTitle\": true\n }\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"active_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"activeVersionNumber": 123,
"latestPublishedVersionNumber": 123,
"draftDirty": true
},
"draft": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_number": 123,
"rev": 123,
"instructions": [
{}
],
"model_slug": "<string>",
"policy_slug": "<string>",
"model_options": {},
"model_settings": {},
"max_steps": 123,
"tool_search": {},
"guardrails": [
{}
],
"agentTools": [
{}
],
"workflows": [
{}
],
"skills": [
{}
],
"agents": [
{}
],
"scorers": [
{}
],
"memory": {
"options": {
"lastMessages": 20,
"workingMemory": {
"enabled": true,
"scope": "resource"
},
"observationalMemory": {
"enabled": true,
"observation": {
"manageWorkingMemory": true,
"bufferOnIdle": true,
"threadTitle": true
}
}
}
},
"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
"6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10"
Body
The agent's system prompt, as an ordered list of blocks. Each entry is one of: { type: "text", content } — inline text; { type: "prompt_block", content, rules? } — inline text with an optional display condition; { type: "prompt_block_ref", id } — a reference to a /v1/prompt-blocks block in the same organization. Content may contain {{variable}}, {{a.b}} and {{variable || 'default'}} placeholders, resolved per request from the chat body's variables plus the now.* builtins; an unsupplied placeholder is left visible. rules is a { operator: "AND"|"OR", conditions: [...] } group (max 3 levels) — the block is included only when it evaluates true. On the draft a ref floats to the block's active version; publishing PINS it, so a published agent version keeps its exact prompt until you republish (see /v1/prompt-blocks/:id/rollout). Pins are server-owned — do not send versionId.
[
{
"type": "prompt_block_ref",
"id": "d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394"
},
{
"type": "text",
"content": "Answer in {{locale || 'English'}}."
}
]
The concrete model to run, e.g. anthropic/claude-sonnet-4-5. Ignored when policy_slug is set.
"anthropic/claude-sonnet-4-5"
A routing policy to run instead of a fixed model, e.g. policy/fastest-sonnet. Overrides model_slug when set.
"policy/fastest-sonnet"
Model-level options passed through to the router — reasoning effort, native provider options, and the like.
{ "reasoningEffort": "medium" }
Generation settings: temperature, maxTokens, and similar.
{ "temperature": 0.2 }
Max LLM round-trips per run for the agentic tool loop. The final step is forced tool-free so runs always end with a text answer. null = platform default (20).
1 <= x <= 1008
Tool search for agents with a large roster (a big API import, a wide MCP server, several connected-app toolkits). ON BY DEFAULT: with more than threshold tools attached to the agent (default 40, connected-app tools included; platform tools such as the workflow builder are not counted), only an always-loaded set stays in the prompt and the rest is reached through two meta-tools: search_tools (keywords → matching tool names and descriptions) and load_tool (exact names → callable for the rest of the conversation). One search surface per agent: API, MCP and connected-app tools share it. providers scopes it to a list of provider ids (API / MCP tools) and connected-app toolkit slugs — only their tools are searchable, everything else stays in the prompt; omit it to search the whole roster. The always-loaded set is the rendering components, the large-response retrieval tools, the workflow builder, every tool with require_approval, the connection tools, discovery: false entries, and whatever always_loaded names (tool names or ids). top_k is the number of search results (1–20, default 8). show_catalog: true also lists every searchable tool's name and a short description in the prompt, trading tokens for one fewer round-trip — worth it for a few dozen tools, not for hundreds. Under the threshold, or with enabled: false, your own API and MCP tools all go into the prompt and connected-app toolkits keep their automatic pooling above ~15 direct tools (see agentTools). Send null to go back to the platform default.
Show child attributes
Show child attributes
{
"threshold": 40,
"providers": ["8d3b1a75-6c02-4e59-b84f-27a9d5e10c63"],
"always_loaded": ["BackyouApi_request_hotel_classics"]
}
Guardrails: safety checks that run on every turn of this agent, one entry per kind (see the guardrails guide). kind: pii (personal data in messages: emails, phone numbers, cards, ids…), moderation (hate, harassment, violence, sexual content, self-harm), prompt_injection (jailbreaks and attempts to override the instructions), system_prompt_scrub (the agent quoting its own instructions back), language (messages outside the target languages) and unicode (control characters and odd whitespace in the user message). mode says what happens when a guardrail fires: warn (default) records the violation and lets the turn continue; block ends the turn with an error the chat shows. All kinds but unicode ask a small judge model; that spend bills the organization's "LLM Judges" group, never a customer group, and a judge-backed guardrail is skipped (with a warning in the rebuild report) when the organization has no judge key. In block mode a judge that fails also stops the turn (fail-closed); in warn mode it lets the message through. enabled: false keeps an entry but turns it off. options tunes the kind — every key optional, unknown keys are rejected: threshold (0–1 confidence to fire; the defaults are 0.6 for pii, 0.5 for moderation, 0.7 for prompt_injection and language), model (a judge model slug, default a small fast one), instructions (custom judge instructions, up to 4000 characters), strategy (an action other than warn/block when the guardrail fires: redact or filter for pii and system_prompt_scrub, rewrite or filter for prompt_injection, filter for moderation, translate or detect for language — mode then only decides what a judge failure does), stage (input, output or both; pii and moderation only, default input), detection_types (pii, prompt_injection), redaction_method (pii: mask, hash, remove, placeholder; system_prompt_scrub: mask, placeholder, remove), categories (moderation), target_languages and min_text_length (language), custom_patterns and placeholder_text (system_prompt_scrub), strip_control_chars, collapse_whitespace, preserve_emojis and trim (unicode, all default true). Send null to remove every guardrail.
12Show child attributes
Show child attributes
[
{
"kind": "prompt_injection",
"mode": "block"
},
{
"kind": "pii",
"mode": "warn",
"options": {
"strategy": "redact",
"detection_types": ["email", "phone", "credit-card"]
}
},
{
"kind": "moderation",
"mode": "block",
"options": {
"categories": ["hate", "harassment", "violence"],
"threshold": 0.7
}
}
]
Workflows the agent can run, as { workflow_id, config? } entries. workflow_id is the /v1/workflows id and must belong to the same organization. The workflow's ACTIVE version is always what runs, so activating a new version reaches the agent on its next turn with no republish. The agent-facing tool name and its description come from the workflow itself — the model calls it as workflow-<workflow name>. The whole workflow runs inside one tool call, and its step progress is streamed to the client as data-tool-workflow / data-tool-workflow-step parts by /v1/chat.
Show child attributes
Show child attributes
[
{
"workflow_id": "4c2f9e18-7a63-4d05-b1e8-93a7c0f2d641"
}
]
Skills the agent can load, as { skill_id } entries. skill_id is the /v1/skills id and must belong to the same organization. A skill is a named block of instructions the agent loads on demand — it calls its skill tool with the name when the skill's description says to — instead of carrying the text in every prompt. The agent always gets the skill's ACTIVE version, so publishing a new one reaches the agent on its next turn with no republish; a skill that is not published yet is skipped and reported in the rebuild summary. Send null to remove every skill.
Show child attributes
Show child attributes
[
{
"skill_id": "9a4e2c71-5b08-4f3d-a6c2-1e7d8b0f4c23"
}
]
Tools assigned to the agent. Each entry is { tool_id, provider_id?, config?, composio_connected_account_id?, discovery?, loop_responses?, require_approval? }. discovery (integration tools only) controls where the tool schema lives at runtime: true puts it behind the agent's search_tools/load_tool discovery tools, false pins it into the prompt, and unset lets the platform decide — small toolkits stay in the prompt, large ones (beyond ~15 total tools) become discoverable so the prompt is not flooded with schemas. require_approval: true pauses every call to that tool for human approval: the chat stream emits a data-tool-call-approval chunk instead of executing (carrying a model-written reason sentence for the approval card), and the client continues the run by POSTing /v1/chat with the approval field. Set loop_responses: true on a tool to let one call cover a whole result set: it gains _fields (project only the fields needed), _all_pages (fetch and merge every page) and _for_each (call once per value of a parameter and merge the rows), and the agent is given the large-response retrieval tools automatically. Because those re-issue the request, enable it only on tools whose endpoint is safe to call repeatedly.
[
{
"tool_id": "c07f2b95-8d41-4e63-a029-5f7b1c8d3e40",
"provider_id": "8d3b1a75-6c02-4e59-b84f-27a9d5e10c63"
}
]
The agent's name. Agent-level, not versioned — it takes effect immediately, with no publish, and is what other agents see when this one is a subagent.
"Support agent"
The agent's description. Agent-level, not versioned — same immediate effect as name. Send null to clear it.
"Answers billing and account questions"
Scorers for this version. Each entry: name (unique key), scorerType (catalogue id), model (judge slug, LLM scorers only), sampling_rate (0-1, share of eligible runs scored, default 1), options, and an optional filter — a predicate over the run, evaluated before sampling, over requestContext.* (groupId, environment, copilotId, source, userId…), entity.*, threadId, resourceId. Operators: eq/ne/lt/lte/gt/gte (left/right as { path } or { literal }), in/notIn (value, set), exists/notExists (path), truthy/falsy (value), and/or (args), not (arg). An invalid filter answers 400.
[
{
"name": "faithfulness",
"scorerType": "faithfulness",
"model": "openai/gpt-4o-mini",
"sampling_rate": 0.2,
"filter": {
"op": "and",
"args": [
{
"op": "eq",
"left": { "path": "requestContext.environment" },
"right": { "literal": "production" }
},
{
"op": "in",
"value": { "path": "requestContext.groupId" },
"set": ["grp_vip", "grp_enterprise"]
}
]
}
}
]
Subagents this one may delegate to.
Show child attributes
Show child attributes
[
{
"agentId": "6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10"
}
]
Memory settings of this version, as { options } — see the memory guide. options: lastMessages (recent messages read back, default 10), generateTitle (first title from the first message; true, false or { model, instructions }), semanticRecall (true, false or { topK, messageRange, scope }), workingMemory (true, false or { enabled, scope, template | schema, agentManaged } — scope: "resource", the default, is one record per user shared by every conversation and automation run), observationalMemory (true, false or { model, activateAfterIdle, retrieval, observation: { messageTokens, bufferTokens, bufferActivation, blockAfter, bufferOnIdle, manageWorkingMemory, threadTitle, instruction, activateAfterIdle }, reflection: { observationTokens, bufferActivation, blockAfter, activateAfterIdle, instruction } }; its scope is thread only). Unknown keys and out-of-range values answer 400 naming the path. Null = platform defaults. Model slugs bill the organization's key.
Show child attributes
Show child attributes
{
"options": {
"lastMessages": 20,
"workingMemory": { "enabled": true, "scope": "resource" },
"observationalMemory": {
"enabled": true,
"observation": {
"manageWorkingMemory": true,
"bufferOnIdle": true,
"threadTitle": true
}
}
}
}
Response
The saved draft, and the agent record it belongs to
The agent after the save — name/description reflect this call, and the version summary says whether the draft now differs from what is published.
Show child attributes
Show child attributes
The whole draft after the merge, not just the fields you sent. rev has been bumped by the DB.
Show child attributes
Show child attributes