Aysali logo

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

  1. •

    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.

  2. •

    Reload

    After saving department changes, reload the admin page so lists and selectors refresh.

  3. •

    Assign agents

    Open Users → Agents, edit an agent, and set Department on their profile. Save and reload if the field was just enabled.

  4. •

    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

SettingEffect
Display in dashboardShows the department list on the chat dashboard and requires the visitor to choose a department before starting a conversation
Display imagesUses each department image instead of the color swatch in the dashboard list
Display in conversation listShows department color indicators in the admin Conversations list
One conversation per departmentVisitor may have only one active conversation per department (not multiple threads in the same department)
LabelReplaces the plural label Departments in admin and tickets UI
Single labelReplaces the singular label Department
Dashboard titleTitle above the dashboard department list (default: Departments)

Department repeater fields

FieldPurpose
NameDisplay name (for example Sales)
ColorAccent color when images are off or in conversation list
ImageOptional icon shown when Display images is on
IDAuto ID — use this in API, JavaScript, and automations

How routing works

  • New conversations can store a department on sb_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

MethodDetails
Admin Conversations UIDepartment dropdown on the active conversation (see Manage agents and admins)
Dashboard pickerEnable Display in dashboard — visitor selects department before chat starts
Chatbot Q&A — Set dataBot payload key department with the department ID (sb_chatbot_payload → sb_update_conversation_department)
Chatbot flows — ActionsFlow action department with the target ID
Automations → MoreAutomation type More with Department set; applies on matching URL/path rules
JavaScript embedOn pages with the widget: var SB_DEFAULT_DEPARTMENT = ID; (replace ID with the numeric department ID)
API / RPCupdate-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.