Configure your agent's appearance, behaviour, and lead collection settings.
PUT https://www.chatzuri.com/api/v1/update-agent-settings| Field | Type | Description |
|---|---|---|
| welcomeMessage | string | The first message shown to visitors |
| primaryColor | string | Hex color for the chat widget (e.g. #10b981) |
| chatIcon | string | URL of the chat widget icon image |
| collectLeads | boolean | Whether to collect visitor contact info |
| leadFields | string[] | Fields to collect: name, email, phone |
const res = await fetch('https://www.chatzuri.com/api/v1/update-agent-settings', {
method: 'PUT',
headers: {
Authorization: 'Bearer <Your-Secret-Key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
agentId: '<Your-Agent-ID>',
settings: {
welcomeMessage: 'Hello! How can I help you today?',
primaryColor: '#10b981',
chatIcon: 'https://example.com/icon.png',
collectLeads: true,
leadFields: ['name', 'email', 'phone']
}
})
});
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.