Skip to main content
PATCH
/
api
/
sub_agents
/
{sub_agent_id}
Update Sub-Agent
curl --request PATCH \
  --url https://app.maadify.com/api/sub_agents/{sub_agent_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "sub_agent_name": "<string>",
  "description": "<string>",
  "system_prompt": "<string>",
  "system_prompt_template": {
    "name": "<string>",
    "content": "<string>",
    "version": "0.1",
    "is_active": true,
    "metadata": {
      "tags": [
        "<string>"
      ],
      "description": ""
    }
  },
  "llm_model": 123,
  "llm_model_name": "<string>",
  "model_config": {
    "temperature": 0
  },
  "config": {
    "human_input_mode": "NEVER",
    "code_execution_config": false,
    "max_consecutive_auto_reply": 123,
    "visible_senders": [
      123
    ],
    "hidden_senders": [
      123
    ],
    "hide_tool_calls": false,
    "hide_tool_responses": false,
    "memory_config": {
      "enabled": false,
      "store_memories": true,
      "use_memory_tools": true,
      "store_to_scope": "thread",
      "search_scopes": [],
      "inject_memory_context": true,
      "memory_context_limit": 3,
      "allow_compression": true,
      "compression_threshold": 123,
      "context_limit_mode": "messages",
      "max_active_messages": 123,
      "max_context_tokens": 123,
      "max_context_chars": 123
    },
    "json_schema": {}
  }
}
'
import requests

url = "https://app.maadify.com/api/sub_agents/{sub_agent_id}"

payload = {
"sub_agent_name": "<string>",
"description": "<string>",
"system_prompt": "<string>",
"system_prompt_template": {
"name": "<string>",
"content": "<string>",
"version": "0.1",
"is_active": True,
"metadata": {
"tags": ["<string>"],
"description": ""
}
},
"llm_model": 123,
"llm_model_name": "<string>",
"model_config": { "temperature": 0 },
"config": {
"human_input_mode": "NEVER",
"code_execution_config": False,
"max_consecutive_auto_reply": 123,
"visible_senders": [123],
"hidden_senders": [123],
"hide_tool_calls": False,
"hide_tool_responses": False,
"memory_config": {
"enabled": False,
"store_memories": True,
"use_memory_tools": True,
"store_to_scope": "thread",
"search_scopes": [],
"inject_memory_context": True,
"memory_context_limit": 3,
"allow_compression": True,
"compression_threshold": 123,
"context_limit_mode": "messages",
"max_active_messages": 123,
"max_context_tokens": 123,
"max_context_chars": 123
},
"json_schema": {}
}
}
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({
sub_agent_name: '<string>',
description: '<string>',
system_prompt: '<string>',
system_prompt_template: {
name: '<string>',
content: '<string>',
version: '0.1',
is_active: true,
metadata: {tags: ['<string>'], description: ''}
},
llm_model: 123,
llm_model_name: '<string>',
model_config: {temperature: 0},
config: {
human_input_mode: 'NEVER',
code_execution_config: false,
max_consecutive_auto_reply: 123,
visible_senders: [123],
hidden_senders: [123],
hide_tool_calls: false,
hide_tool_responses: false,
memory_config: {
enabled: false,
store_memories: true,
use_memory_tools: true,
store_to_scope: 'thread',
search_scopes: [],
inject_memory_context: true,
memory_context_limit: 3,
allow_compression: true,
compression_threshold: 123,
context_limit_mode: 'messages',
max_active_messages: 123,
max_context_tokens: 123,
max_context_chars: 123
},
json_schema: {}
}
})
};

fetch('https://app.maadify.com/api/sub_agents/{sub_agent_id}', 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://app.maadify.com/api/sub_agents/{sub_agent_id}",
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([
'sub_agent_name' => '<string>',
'description' => '<string>',
'system_prompt' => '<string>',
'system_prompt_template' => [
'name' => '<string>',
'content' => '<string>',
'version' => '0.1',
'is_active' => true,
'metadata' => [
'tags' => [
'<string>'
],
'description' => ''
]
],
'llm_model' => 123,
'llm_model_name' => '<string>',
'model_config' => [
'temperature' => 0
],
'config' => [
'human_input_mode' => 'NEVER',
'code_execution_config' => false,
'max_consecutive_auto_reply' => 123,
'visible_senders' => [
123
],
'hidden_senders' => [
123
],
'hide_tool_calls' => false,
'hide_tool_responses' => false,
'memory_config' => [
'enabled' => false,
'store_memories' => true,
'use_memory_tools' => true,
'store_to_scope' => 'thread',
'search_scopes' => [

],
'inject_memory_context' => true,
'memory_context_limit' => 3,
'allow_compression' => true,
'compression_threshold' => 123,
'context_limit_mode' => 'messages',
'max_active_messages' => 123,
'max_context_tokens' => 123,
'max_context_chars' => 123
],
'json_schema' => [

]
]
]),
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://app.maadify.com/api/sub_agents/{sub_agent_id}"

payload := strings.NewReader("{\n \"sub_agent_name\": \"<string>\",\n \"description\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"system_prompt_template\": {\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"version\": \"0.1\",\n \"is_active\": true,\n \"metadata\": {\n \"tags\": [\n \"<string>\"\n ],\n \"description\": \"\"\n }\n },\n \"llm_model\": 123,\n \"llm_model_name\": \"<string>\",\n \"model_config\": {\n \"temperature\": 0\n },\n \"config\": {\n \"human_input_mode\": \"NEVER\",\n \"code_execution_config\": false,\n \"max_consecutive_auto_reply\": 123,\n \"visible_senders\": [\n 123\n ],\n \"hidden_senders\": [\n 123\n ],\n \"hide_tool_calls\": false,\n \"hide_tool_responses\": false,\n \"memory_config\": {\n \"enabled\": false,\n \"store_memories\": true,\n \"use_memory_tools\": true,\n \"store_to_scope\": \"thread\",\n \"search_scopes\": [],\n \"inject_memory_context\": true,\n \"memory_context_limit\": 3,\n \"allow_compression\": true,\n \"compression_threshold\": 123,\n \"context_limit_mode\": \"messages\",\n \"max_active_messages\": 123,\n \"max_context_tokens\": 123,\n \"max_context_chars\": 123\n },\n \"json_schema\": {}\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://app.maadify.com/api/sub_agents/{sub_agent_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sub_agent_name\": \"<string>\",\n \"description\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"system_prompt_template\": {\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"version\": \"0.1\",\n \"is_active\": true,\n \"metadata\": {\n \"tags\": [\n \"<string>\"\n ],\n \"description\": \"\"\n }\n },\n \"llm_model\": 123,\n \"llm_model_name\": \"<string>\",\n \"model_config\": {\n \"temperature\": 0\n },\n \"config\": {\n \"human_input_mode\": \"NEVER\",\n \"code_execution_config\": false,\n \"max_consecutive_auto_reply\": 123,\n \"visible_senders\": [\n 123\n ],\n \"hidden_senders\": [\n 123\n ],\n \"hide_tool_calls\": false,\n \"hide_tool_responses\": false,\n \"memory_config\": {\n \"enabled\": false,\n \"store_memories\": true,\n \"use_memory_tools\": true,\n \"store_to_scope\": \"thread\",\n \"search_scopes\": [],\n \"inject_memory_context\": true,\n \"memory_context_limit\": 3,\n \"allow_compression\": true,\n \"compression_threshold\": 123,\n \"context_limit_mode\": \"messages\",\n \"max_active_messages\": 123,\n \"max_context_tokens\": 123,\n \"max_context_chars\": 123\n },\n \"json_schema\": {}\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app.maadify.com/api/sub_agents/{sub_agent_id}")

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 \"sub_agent_name\": \"<string>\",\n \"description\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"system_prompt_template\": {\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"version\": \"0.1\",\n \"is_active\": true,\n \"metadata\": {\n \"tags\": [\n \"<string>\"\n ],\n \"description\": \"\"\n }\n },\n \"llm_model\": 123,\n \"llm_model_name\": \"<string>\",\n \"model_config\": {\n \"temperature\": 0\n },\n \"config\": {\n \"human_input_mode\": \"NEVER\",\n \"code_execution_config\": false,\n \"max_consecutive_auto_reply\": 123,\n \"visible_senders\": [\n 123\n ],\n \"hidden_senders\": [\n 123\n ],\n \"hide_tool_calls\": false,\n \"hide_tool_responses\": false,\n \"memory_config\": {\n \"enabled\": false,\n \"store_memories\": true,\n \"use_memory_tools\": true,\n \"store_to_scope\": \"thread\",\n \"search_scopes\": [],\n \"inject_memory_context\": true,\n \"memory_context_limit\": 3,\n \"allow_compression\": true,\n \"compression_threshold\": 123,\n \"context_limit_mode\": \"messages\",\n \"max_active_messages\": 123,\n \"max_context_tokens\": 123,\n \"max_context_chars\": 123\n },\n \"json_schema\": {}\n }\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "data": {
    "items": [
      {
        "id": 123,
        "sub_agent_name_key": "<string>",
        "sub_agent_name": "<string>",
        "agent_type": "<string>",
        "tenant": "<string>",
        "tenants": {},
        "description": "<string>",
        "system_prompt": "<string>",
        "llm_model": 123,
        "model_config": {
          "temperature": 0
        },
        "config": {
          "human_input_mode": "NEVER",
          "code_execution_config": false,
          "max_consecutive_auto_reply": 123,
          "visible_senders": [
            123
          ],
          "hidden_senders": [
            123
          ],
          "hide_tool_calls": false,
          "hide_tool_responses": false,
          "memory_config": {
            "enabled": false,
            "store_memories": true,
            "use_memory_tools": true,
            "store_to_scope": "thread",
            "search_scopes": [],
            "inject_memory_context": true,
            "memory_context_limit": 3,
            "allow_compression": true,
            "compression_threshold": 123,
            "context_limit_mode": "messages",
            "max_active_messages": 123,
            "max_context_tokens": 123,
            "max_context_chars": 123
          },
          "json_schema": {}
        },
        "prompt_templates": {
          "id": "<string>",
          "tenant_id": "<string>",
          "name": "<string>",
          "version": "<string>",
          "is_active": true,
          "content": "<string>",
          "metadata": {},
          "latest_version": true,
          "created_at": "<string>",
          "updated_at": "<string>"
        },
        "agent_groups": [
          {
            "parent_agent_type": "<string>",
            "parent_agent_type_key": "<string>",
            "agent_key": "<string>",
            "agent_name": "<string>",
            "full_display_name": "<string>",
            "tenant": "<string>"
          }
        ],
        "sub_agent_tools": [
          {
            "id": 123,
            "agent_tool_id": 123,
            "option": "<string>",
            "tenant": "<string>",
            "system_agent_tool": 123,
            "setting_id": 123,
            "default_tool_owner_config": {},
            "tool_name": "<string>",
            "tool_name_display": "<string>",
            "tool_description": "<string>",
            "tool_type": "<string>",
            "custom_name": "<string>",
            "custom_description": "<string>",
            "connector_name": "<string>",
            "connector_name_display": "<string>",
            "connector_image": "<string>",
            "custom_connection_name": "<string>",
            "custom_connection_description": "<string>",
            "index_setting_id": 123,
            "is_orphaned": true,
            "created_at": "<string>"
          }
        ],
        "created_at": "<string>"
      }
    ]
  },
  "error_type": "<string>",
  "error_message": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

sub_agent_id
integer
required

Body

application/json
sub_agent_name
string | null

Updated display name for the sub-agent. The API derives the stored key from this value when provided.

Minimum string length: 1
agent_type
enum<string> | null

Updated sub-agent type.

Available options:
assistant,
user_proxy
description
string | null

Updated description that explains the sub-agent's intent.

system_prompt
string | null

Updated prompt template ID used as the sub-agent system prompt.

system_prompt_template
SystemPromptCreateRequest · object | null

System prompt template to create when system_prompt ID is not provided.

llm_model
integer | null

Updated LLM model ID. If omitted, provide llm_model_name to resolve the model by name.

llm_model_name
string | null

LLM model name to resolve when llm_model ID is not provided.

model_config
SubAgentModelConfigRequest · object | null

Updated assistant-only LLM settings for this sub-agent.

config
SubAgentConfigRequest · object

Updated sub-agent behavior, visibility, memory, and structured output settings.

Response

Successful Response

success
boolean
required

Whether the request was successful.

data
SubAgentMutationData · object
required

Sub-agent mutation results.

error_type
string | null

Type of error if the request failed.

error_message
string | null

Error message or informational message.