Retrieve all agents associated with your team.
GET https://www.chatzuri.com/api/v1/get-agentsAuthorization: Bearer <Your-Secret-Key> — Your team API key.const res = await fetch('https://www.chatzuri.com/api/v1/get-agents', {
method: 'GET',
headers: {
Authorization: 'Bearer <Your-Secret-Key>',
'Content-Type': 'application/json'
}
});
const data = await res.json();
console.log(data.agents); // array of agents{
"agents": [
{
"agentId": "agent_abc123",
"agentName": "Support Agent",
"createdAt": "2024-01-15T10:00:00Z"
},
{
"agentId": "agent_xyz456",
"agentName": "Sales Agent",
"createdAt": "2024-01-20T09:30:00Z"
}
]
}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.