Permanently delete an agent and all its associated data.
Warning: This action is irreversible. Deleting an agent will permanently remove it and all its conversations, leads, and settings.
DELETE https://www.chatzuri.com/api/v1/delete-agentagentId — (string, required) The ID of the agent to delete.const res = await fetch('https://www.chatzuri.com/api/v1/delete-agent', {
method: 'DELETE',
headers: {
Authorization: 'Bearer <Your-Secret-Key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
agentId: '<Your-Agent-ID>'
})
});
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.