Skip to main content
PATCH
Save agent draft

Authorizations

Authorization
string
header
required

Organization API key, generated in studio.sidenet.ai. Backend only — never in a browser.

Path Parameters

id
string
required
Example:

"6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10"

Body

application/json
instructions
object[]

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.

Example:
model_slug
string

The concrete model to run, e.g. anthropic/claude-sonnet-4-5. Ignored when policy_slug is set.

Example:

"anthropic/claude-sonnet-4-5"

policy_slug
string

A routing policy to run instead of a fixed model, e.g. policy/fastest-sonnet. Overrides model_slug when set.

Example:

"policy/fastest-sonnet"

model_options
object

Model-level options passed through to the router — reasoning effort, native provider options, and the like.

Example:
model_settings
object

Generation settings: temperature, maxTokens, and similar.

Example:
max_steps
integer

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).

Required range: 1 <= x <= 100
Example:

8

workflows
object[]

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.

Example:
agentTools
object[]

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.

Example:
name
string

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.

Example:

"Support agent"

description
string

The agent's description. Agent-level, not versioned — same immediate effect as name. Send null to clear it.

Example:

"Answers billing and account questions"

scorers
object[]
Example:
agents
object[]

Subagents this one may delegate to.

Example:
memory
object
Example:

Response

The saved draft, and the agent record it belongs to

agent
object

The agent after the save — name/description reflect this call, and the version summary says whether the draft now differs from what is published.

draft
object

The whole draft after the merge, not just the fields you sent. rev has been bumped by the DB.