Upload an avatar image displayed in the agent's chat bubble.
Send as multipart/form-data. Accepted formats: PNG, JPG. Maximum file size: 2 MB.
POST https://www.chatzuri.com/api/v1/upload-agent-profile-pictureconst formData = new FormData();
formData.append('file', fileInput.files[0]); // PNG or JPG, max 2MB
formData.append('agentId', '<Your-Agent-ID>');
const res = await fetch('https://www.chatzuri.com/api/v1/upload-agent-profile-picture', {
method: 'POST',
headers: {
Authorization: 'Bearer <Your-Secret-Key>'
},
body: formData
});
const data = await res.json();
console.log(data.profilePictureUrl);{
"profilePictureUrl": "https://cdn.chatzuri.com/profiles/agent_abc123_avatar.png"
}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.