# How chats are assigned

> How a chat reaches the right person in Soosh, and how to choose between sharing chats out automatically and letting agents pick them.

Source: https://docs.soosh.io/concepts/how-chats-are-assigned/

A chat reaches a person in one of two ways. Someone assigns it by hand, or the
bot hands it over and it waits in a queue. A team's queue can share chats out
automatically, or leave them for agents to take with **Take next**.

## Why it exists

When several people answer one WhatsApp number, two things often go wrong: a
customer gets two answers, or none. Assignment makes one person responsible for
each chat. Queues and teams make sure the chat reaches someone who can help,
such as your *Wholesale* team for a bulk order.

## How it works in Soosh

**Assigning by hand.** An owner, admin or manager can give a chat to one
person with **Assign to agent**. It shows in that person's **Mine** tab and
stays theirs until someone changes it. That person has taken the chat over:
the bot and the AI stay quiet in it, and it shows **With agents**, until
someone unassigns it, closes or reopens it, or clicks **Resume bot**. A chat
your own system assigns with an API key is taken over the same way. A chat
that only keeps its agent because of **Assign to same agent** isn't: once its
handover ends, the bot answers again.

**Handing over.** A chat goes to the queue when a keyword reply, a bot flow or
the AI hands it to people, or when a member clicks **Transfer to agent**. If
the bot is off, every new chat goes to the queue. The bot stays quiet in a
handed-over chat, which shows **With agents**, until someone clicks
**Resume bot**. Outside your business
hours, the bot, flows and AI don't queue the chat; the customer gets your out
of hours message instead.

**Queues.** A keyword reply and **Transfer to agent** use the general queue. A
bot flow and the AI use the team you chose, or the general queue. In the
general queue, chats always wait for someone to take them.

**How a team shares chats.** Each team has an **Assignment strategy**:

- **Round robin**: the chat goes to the agent who got one longest ago.
- **Load balanced**: the chat goes to the agent with the fewest handed-over
  chats still open.
- **Manual queue**: nobody gets it automatically. It waits in the team's queue.

Only people added to a team as **Agent** get chats automatically, not its
managers. Soosh skips anyone whose status is **Away**, but it doesn't check
whether they're signed in. If no agent is available, the chat waits in the
team's queue.

**Taking the next chat.** **Take next** in [**Inbox > Chats**](https://app.soosh.io/chat) gives you the
chat that has waited longest, from the queues you can see. Two people can never
take the same chat.

**Going away.** When an agent sets their status to **Away**, their handed-over
chats go back to the queue, and they get no new ones until they're
**Available** again.

**The same agent again.** With **Assign to same agent** on (it is unless you
change it), a customer who already has an assigned agent goes straight back to
them, if they're available. This applies to keyword replies and
**Transfer to agent**.

## Who sees what

- **In the inbox**, the built-in roles (owner, admin, manager and agent) see
  every chat. A custom role that can't view contacts sees only chats assigned
  or handed to that person.
- **On the Queue page**, owners, admins and managers see every queue. They hold
  the queue **Manage** permission. They can take a chat from any queue,
  whatever the pickup setting, and move a waiting chat to someone else.
- **Agents** see the chats handed to them, their teams' queues and the general
  queue. They can only take a chat for themselves, and only when **Allow
  agents to pick from queue** is on. You find it under **Human agents** in
  [**Settings > Bot settings**](https://app.soosh.io/settings/bot).
- **A custom role** works like an agent, unless it has the queue **Manage**
  permission. Taking chats also needs the queue **Take from the queue** permission.

See [Roles and permissions](https://docs.soosh.io/concepts/roles-and-permissions/) for how roles
work.

## Choosing a strategy

**Round robin** is fair and fast: everyone gets the same share. But it ignores
how busy someone is, and can give a chat to someone who left their status on
**Available** and went home.

**Load balanced** evens out the work in hand. It counts a chat as open until
someone clicks **Resume bot**, so it works best when agents do that as they
finish.

**Manual queue** lets agents take a chat when they're ready, so nobody gets one
they can't handle right now. The risk is that chats wait if nobody looks.
Response time rules under **Response times** in [**Settings > Bot settings**](https://app.soosh.io/settings/bot) mark waiting chats
**At risk** or **SLA breached** in the queue.

**No teams at all** is the simplest start for 2 or 3 people. Everything goes to
the general queue and agents take turns with **Take next**.

## Related

- [Assign a chat](https://docs.soosh.io/guides/inbox/assign-a-chat/)
- [Pick up chats from the queue](https://docs.soosh.io/guides/inbox/pick-up-chats-from-the-queue/)
- [Hand chats to agents](https://docs.soosh.io/guides/chatbot/hand-chats-to-agents/)
- [Create a team](https://docs.soosh.io/guides/workspace/create-a-team/)
- [Set business hours and an away message](https://docs.soosh.io/guides/chatbot/set-business-hours-and-an-away-message/)
- [Roles and permissions](https://docs.soosh.io/concepts/roles-and-permissions/)
