Update the name or knowledge base of an existing agent.
PUT https://www.chatzuri.com/api/v1/update-agentagentId — (string, required) The ID of the agent to update.agentName — (string, optional) New display name for the agent.sourceText — (string, optional) Updated knowledge base text.const res = await fetch('https://www.chatzuri.com/api/v1/update-agent', {
method: 'PUT',
headers: {
Authorization: 'Bearer <Your-Secret-Key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
agentId: '<Your-Agent-ID>',
agentName: 'Updated Agent Name',
sourceText: 'Updated knowledge base text...'
})
});
const data = await res.json();
console.log(data); // { success: true }{
"success": true
}How to handle API errors gracefully
If there are any errors during the API request, appropriate HTTP status codes will be returned along with error messages in the response body.
That's it! You should now be able to create a agent using the create API.