> ## Documentation Index
> Fetch the complete documentation index at: https://help.treble.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# fact_agent_conversations

> Conversations handled by human agents in the agent workspace.

# fact\_agent\_conversations

Each row is one conversation handled in the agent workspace (Sales): who took it, how it was assigned, how long the customer waited, how it ended, and how the customer rated it. It replaces the legacy `fact_conversations` — now with **full history** (the legacy table kept a rolling 3 months) and richer assignment/transfer detail.

## What questions does it answer?

* How many conversations does each agent/team handle, and how do they resolve?
* What is the first-response time and how does it vary by team or hour?
* Which conversations were transferred, and how many times?
* What CSAT do agents get?
* How did the conversation arrive — from which flow, inbound or outbound?

## Columns

| Column                      | Type       | Description                                                                                                                                                                                                              |
| --------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `agent_conversation_id`     | Int32      | Unique identifier of the conversation                                                                                                                                                                                    |
| `company_id`                | Int32      | Your company (filtered automatically)                                                                                                                                                                                    |
| `session_id`                | Int64      | The conversation flow that handed over to an agent (join `fact_treble_sessions`); `0` if none                                                                                                                            |
| `contact_id`                | Int32      | Treble contact; `0` if none                                                                                                                                                                                              |
| `created_at`                | DateTime64 | When the conversation entered the workspace                                                                                                                                                                              |
| `finished_at`               | DateTime64 | When it was resolved; `NULL` if still open                                                                                                                                                                               |
| `assigned_at`               | DateTime64 | When an agent was assigned; `NULL` if never assigned                                                                                                                                                                     |
| `status`                    | String     | Current status: `unassigned` (waiting in queue), `assigned` (with an agent), `finished`                                                                                                                                  |
| `finish_type`               | String     | How it ended: `MANUAL` (closed by the agent) or `AUTO` (closed automatically); empty while open                                                                                                                          |
| `rating`                    | Int32      | Customer satisfaction rating 1–5; `0` if not rated                                                                                                                                                                       |
| `is_redirected`             | Bool       | `true` if the conversation was transferred at least once                                                                                                                                                                 |
| `agent_id`                  | Int32      | Agent currently/last responsible; `0` if unassigned                                                                                                                                                                      |
| `agent_name`                | String     | That agent's name                                                                                                                                                                                                        |
| `tag_id`                    | Int32      | Tag (queue/group) the conversation belongs to                                                                                                                                                                            |
| `tag_name`                  | String     | Tag name                                                                                                                                                                                                                 |
| `team_id`                   | Int32      | Team owning the tag                                                                                                                                                                                                      |
| `team_name`                 | String     | Team name                                                                                                                                                                                                                |
| `channel_id`                | Int32      | WhatsApp line                                                                                                                                                                                                            |
| `direction`                 | String     | `INBOUND` or `OUTBOUND` origin of the underlying flow; empty if there is no linked flow                                                                                                                                  |
| `poll_id`                   | Int32      | Flow that originated the conversation; `0` if none                                                                                                                                                                       |
| `poll_name`                 | String     | Flow name                                                                                                                                                                                                                |
| `transfer_count`            | UInt32     | Number of transfers                                                                                                                                                                                                      |
| `first_agent_message_at`    | DateTime64 | First message sent by an agent; `NULL` if none yet                                                                                                                                                                       |
| `first_response_sec`        | Int64      | Seconds from the conversation's creation to the first agent message; `NULL` if no agent message yet                                                                                                                      |
| `helpdesk_contact_id`       | String     | Contact id in your CRM, when integrated                                                                                                                                                                                  |
| `contact_wa_id`             | String     | Contact's WhatsApp id                                                                                                                                                                                                    |
| `transfer_waiting_time`     | Int32      | Configured limit (minutes) to wait for the contact's CRM owner agent before assigning to the pool. Special values: `-1` = assign to owner immediately, `-2` = wait until the owner is online. `NULL` when not configured |
| `last_customer_interaction` | DateTime64 | Last message from the customer                                                                                                                                                                                           |
| `assign_type`               | String     | How the agent got it: `AUTO` (assigned by the platform) or `MANUAL`                                                                                                                                                      |
| `assignment_strategy`       | String     | Per-flow assignment strategy: `lowest_first`, `specific`, `owner`, or `random`; empty when the company-level default applies                                                                                             |
| `language`                  | String     | Conversation language: `ES`, `PT`, `EN`, `FR`, `DE`, `IT`                                                                                                                                                                |
| `channel`                   | String     | Channel type (currently `WHATSAPP`)                                                                                                                                                                                      |
| `synced_at`                 | DateTime64 | When this row was last written/corrected                                                                                                                                                                                 |

## Example queries

### Volume and resolution per team, last 30 days

```sql theme={null}
SELECT
    team_name,
    count()                                        AS conversations,
    countIf(status = 'finished')                   AS finished,
    round(avg(first_response_sec) / 60, 1)         AS avg_first_response_min,
    round(avgIf(rating, rating != 0), 2)           AS csat
FROM fact_agent_conversations
WHERE created_at >= today() - 30
GROUP BY team_name
ORDER BY conversations DESC
```

### Conversations transferred more than once

```sql theme={null}
SELECT agent_conversation_id, agent_name, transfer_count, created_at
FROM fact_agent_conversations
WHERE created_at >= today() - 7
  AND transfer_count > 1
ORDER BY transfer_count DESC
```

<Note>
  To see the full bot conversation that preceded the handover, join `session_id` against [`fact_treble_sessions`](/en/docs/data-warehouse-v2/fact-treble-sessions) and [`fact_treble_session_messages`](/en/docs/data-warehouse-v2/fact-treble-session-messages).
</Note>
