Create a new AI agent under your team via the API.
Make a POST request to create an agent. The agent will be associated with your team and returned with a unique ID.
POST https://www.chatzuri.com/api/v1/create-agentAuthorization: Bearer <Your-Secret-Key> — Your team API key.Content-Type: application/jsonagentName — (string, required) The display name of the agent.sourceText — (string, optional) Knowledge base text for the agent.const res = await fetch('https://www.chatzuri.com/api/v1/create-agent', {
method: 'POST',
headers: {
Authorization: `Bearer <Your-Secret-Key>`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
agentName: 'Support Agent',
sourceText: 'We are a software company...'
})
});
const data = await res.json();
console.log(data); // { agentId: 'agent_abc123' }{
"agentId": "agent_abc123"
}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.