Retrieve all teams the authenticated user belongs to.
GET https://www.chatzuri.com/api/v1/get-teamsconst res = await fetch('https://www.chatzuri.com/api/v1/get-teams', {
method: 'GET',
headers: {
Authorization: 'Bearer <Your-Secret-Key>',
'Content-Type': 'application/json'
}
});
const data = await res.json();
console.log(data.teams);{
"teams": [
{
"teamId": "team_abc123",
"name": "Acme Corp",
"url": "acme-corp",
"description": "Customer support team",
"membersCount": 4,
"agentsCount": 2,
"createdAt": "2024-01-10T08:00: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.