Admin
Departments route conversations to the right team (Sales, Support, Billing, and so on). Assign agents to departments, filter the inbox, and let visitors pick a department before they chat.
Configure under Settings → General in the Aysali Bot admin panel.
Quick start
- •
Create departments
Go to Settings → General → Departments. Click Add new item, enter Name, Color, optional Image, and save. Each row gets an auto-generated department ID.
- •
Reload
After saving department changes, reload the admin page so lists and selectors refresh.
- •
Assign agents
Open Users → Agents, edit an agent, and set Department on their profile. Save and reload if the field was just enabled.
- •
Use in Conversations
In Conversations, use the department control on a thread to assign or change department (requires Update conversation department privilege for agents).
Departments settings
Settings → General → Departments settings
| Setting | Effect |
|---|---|
| Display in dashboard | Shows the department list on the chat dashboard and requires the visitor to choose a department before starting a conversation |
| Display images | Uses each department image instead of the color swatch in the dashboard list |
| Display in conversation list | Shows department color indicators in the admin Conversations list |
| One conversation per department | Visitor may have only one active conversation per department (not multiple threads in the same department) |
| Label | Replaces the plural label Departments in admin and tickets UI |
| Single label | Replaces the singular label Department |
| Dashboard title | Title above the dashboard department list (default: Departments) |
Department repeater fields
| Field | Purpose |
|---|---|
| Name | Display name (for example Sales) |
| Color | Accent color when images are off or in conversation list |
| Image | Optional icon shown when Display images is on |
| ID | Auto ID — use this in API, JavaScript, and automations |
How routing works
- New conversations can store a
departmentonsb_conversations. - Push and email notifications for the first message route to offline agents in that department (and agents with no department). See Push notifications and Email notifications.
- When a conversation is assigned to a new department with a notification message, agents in that department are alerted via
sb_send_agents_notifications(in-app / email depending on your notification setup). - Routing and queue can pick agents filtered by department (
sb_routing_find_best_agent).
Assign a department to a conversation
| Method | Details |
|---|---|
| Admin Conversations UI | Department dropdown on the active conversation (see Manage agents and admins) |
| Dashboard picker | Enable Display in dashboard — visitor selects department before chat starts |
| Chatbot Q&A — Set data | Bot payload key department with the department ID (sb_chatbot_payload → sb_update_conversation_department) |
| Chatbot flows — Actions | Flow action department with the target ID |
| Automations → More | Automation type More with Department set; applies on matching URL/path rules |
| JavaScript embed | On pages with the widget: var SB_DEFAULT_DEPARTMENT = ID; (replace ID with the numeric department ID) |
| API / RPC | update-conversation-department with conversation_id and department (see bot OpenAPI schema) |
JavaScript example
<script>
var SB_DEFAULT_DEPARTMENT = 2;
</script>
<!-- Aysali Bot embed snippet -->
Set this before the chat init script on pages where every visitor should land in that department.
API example
{
"function": "update-conversation-department",
"conversation_id": 1057,
"department": 2
}
Requires an authenticated admin/agent request (token). Clearing department: use empty value or -1 per your API client conventions.
Agent department field
When editing an agent under Users → Agents:
- Empty department — access to all departments (typical for admins and team leads).
- Set department — inbox, user list, and related queries are scoped to that department only.
Supervisors and agent privileges still apply on top of department scoping.