Update agent (partial)
curl --request PATCH \
--url https://api.zudu.ai/api/agents/{agentId} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--header 'X-API-SECRET: <api-key>' \
--data '
{
"agent_name": "My Updated Agent"
}
'import requests
url = "https://api.zudu.ai/api/agents/{agentId}"
payload = { "agent_name": "My Updated Agent" }
headers = {
"X-API-KEY": "<api-key>",
"X-API-SECRET": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-API-KEY': '<api-key>',
'X-API-SECRET': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({agent_name: 'My Updated Agent'})
};
fetch('https://api.zudu.ai/api/agents/{agentId}', 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.zudu.ai/api/agents/{agentId}",
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([
'agent_name' => 'My Updated Agent'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>",
"X-API-SECRET: <api-key>"
],
]);
$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.zudu.ai/api/agents/{agentId}"
payload := strings.NewReader("{\n \"agent_name\": \"My Updated Agent\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("X-API-SECRET", "<api-key>")
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.zudu.ai/api/agents/{agentId}")
.header("X-API-KEY", "<api-key>")
.header("X-API-SECRET", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_name\": \"My Updated Agent\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zudu.ai/api/agents/{agentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["X-API-SECRET"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_name\": \"My Updated Agent\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Agent updated successfully",
"status": "success",
"error": null,
"data": {
"agent_id": "agent_f3302e6b-4ab0-4d5b-8b4c-f85c88ba4df2",
"organization_id": "org_xyz789",
"created_at": "2025-01-15T10:30:00",
"updated_at": "2025-01-15T12:45:00",
"agent_name": "Updated Agent Name",
"begin_message": "Updated greeting message",
"begin_message_variables": [
"name",
"company"
],
"begin_message_delay_ms": 1000,
"test_variables": {
"name": "John",
"company": "Acme Inc"
},
"webhook_url": "https://example.com/webhook",
"post_call_webhook_id": "webhook_123",
"end_call_after_silence_ms": 30000,
"max_call_duration_ms": 600000,
"take_turn_after_silence_seconds": 6,
"timezone": "America/New_York",
"knowledge_base_ids": [
"kb_123",
"kb_456"
],
"mcp_server_ids": [
"mcp_123"
],
"rag_config": {
"chunks_to_retrieve": 10,
"similarity_threshold": 0.7
},
"llm_config": {
"system_message": "You are helpful.",
"temperature": 0.7,
"max_tokens": 1000,
"tools": [],
"system_message_variables": []
},
"stt_config": {
"language": "en",
"language_name": "English",
"use_realtime": true
},
"tts_config": {
"voice_id": "21m00Tcm4TlvDq8ikWAM",
"voice_speed": 1,
"language": "en",
"language_name": "English",
"provider": "elevenlabs",
"model": "eleven_multilingual_v2"
},
"post_call_analysis_data": [],
"post_call_analysis_model": null,
"post_call_evaluation_criteria": [],
"widget_config": null,
"additional_languages": [],
"access_info": {}
}
}{
"message": "Validation error",
"status": "error",
"error": "Agent name must be a non-empty string",
"data": null
}{
"message": "Agent not found",
"status": "error",
"error": "Agent with ID 'agent_f3302e6b-4ab0-4d5b-8b4c-f85c88ba4df2' does not exist in organization 'org_xyz789'",
"data": null
}{
"message": "Failed to update agent",
"status": "error",
"error": "Database connection failed",
"data": null
}Agents
Update agent by ID
Updates an agent by ID (current behavior).
PATCH
/
api
/
agents
/
{agentId}
Update agent (partial)
curl --request PATCH \
--url https://api.zudu.ai/api/agents/{agentId} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--header 'X-API-SECRET: <api-key>' \
--data '
{
"agent_name": "My Updated Agent"
}
'import requests
url = "https://api.zudu.ai/api/agents/{agentId}"
payload = { "agent_name": "My Updated Agent" }
headers = {
"X-API-KEY": "<api-key>",
"X-API-SECRET": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-API-KEY': '<api-key>',
'X-API-SECRET': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({agent_name: 'My Updated Agent'})
};
fetch('https://api.zudu.ai/api/agents/{agentId}', 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.zudu.ai/api/agents/{agentId}",
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([
'agent_name' => 'My Updated Agent'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>",
"X-API-SECRET: <api-key>"
],
]);
$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.zudu.ai/api/agents/{agentId}"
payload := strings.NewReader("{\n \"agent_name\": \"My Updated Agent\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("X-API-SECRET", "<api-key>")
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.zudu.ai/api/agents/{agentId}")
.header("X-API-KEY", "<api-key>")
.header("X-API-SECRET", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_name\": \"My Updated Agent\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zudu.ai/api/agents/{agentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["X-API-SECRET"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_name\": \"My Updated Agent\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Agent updated successfully",
"status": "success",
"error": null,
"data": {
"agent_id": "agent_f3302e6b-4ab0-4d5b-8b4c-f85c88ba4df2",
"organization_id": "org_xyz789",
"created_at": "2025-01-15T10:30:00",
"updated_at": "2025-01-15T12:45:00",
"agent_name": "Updated Agent Name",
"begin_message": "Updated greeting message",
"begin_message_variables": [
"name",
"company"
],
"begin_message_delay_ms": 1000,
"test_variables": {
"name": "John",
"company": "Acme Inc"
},
"webhook_url": "https://example.com/webhook",
"post_call_webhook_id": "webhook_123",
"end_call_after_silence_ms": 30000,
"max_call_duration_ms": 600000,
"take_turn_after_silence_seconds": 6,
"timezone": "America/New_York",
"knowledge_base_ids": [
"kb_123",
"kb_456"
],
"mcp_server_ids": [
"mcp_123"
],
"rag_config": {
"chunks_to_retrieve": 10,
"similarity_threshold": 0.7
},
"llm_config": {
"system_message": "You are helpful.",
"temperature": 0.7,
"max_tokens": 1000,
"tools": [],
"system_message_variables": []
},
"stt_config": {
"language": "en",
"language_name": "English",
"use_realtime": true
},
"tts_config": {
"voice_id": "21m00Tcm4TlvDq8ikWAM",
"voice_speed": 1,
"language": "en",
"language_name": "English",
"provider": "elevenlabs",
"model": "eleven_multilingual_v2"
},
"post_call_analysis_data": [],
"post_call_analysis_model": null,
"post_call_evaluation_criteria": [],
"widget_config": null,
"additional_languages": [],
"access_info": {}
}
}{
"message": "Validation error",
"status": "error",
"error": "Agent name must be a non-empty string",
"data": null
}{
"message": "Agent not found",
"status": "error",
"error": "Agent with ID 'agent_f3302e6b-4ab0-4d5b-8b4c-f85c88ba4df2' does not exist in organization 'org_xyz789'",
"data": null
}{
"message": "Failed to update agent",
"status": "error",
"error": "Database connection failed",
"data": null
}Notes
- Update an existing agent with partial updates
- Only provided fields will be updated
- PATCH requests cannot have empty update data
- Auto-selection triggers for language_name changes
- Returns frontend-safe representation
Authorizations
API Key for MCP server and external service authentication
API Secret for MCP server and external service authentication
Path Parameters
Body
application/json
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I