> ## 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.

# Analytics Warehouse

> Query your Treble data in near real time with SQL — full history, richer detail, and a stable naming contract.

# Analytics Warehouse

The Analytics Warehouse is the new generation of Treble's data platform. It gives you direct SQL access to your operational data with **near-real-time freshness**, **full history**, and several datasets that were never available before — including the complete message trace of every conversation and the node-by-node journey of every flow.

<Note>
  The Analytics Warehouse replaces the previous Data Warehouse (`client_analytics`), which is now **deprecated**. Both remain available during the migration period. If you are migrating existing queries, start with the [Migration Guide](/en/docs/data-warehouse-v2/migration-guide).
</Note>

## What's new

|                           | Previous warehouse | Analytics Warehouse                |
| ------------------------- | ------------------ | ---------------------------------- |
| **Freshness**             | Up to 3 hours      | **\~15 minutes**                   |
| **History**               | Last 3 months      | **Full history**                   |
| **Conversation messages** | Not available      | Full trace, message by message     |
| **Flow journey**          | Not available      | Step by step, AI steps included    |
| **Session variables**     | Not available      | Available                          |
| **Ads attribution**       | Not available      | Click-to-WhatsApp ad → session     |
| **Incremental sync**      | Not supported      | `synced_at` watermark on every row |

## Connection

Once access is enabled, you will receive credentials to connect:

| Parameter    | Value                                |
| ------------ | ------------------------------------ |
| **Host**     | Provided by Treble                   |
| **Port**     | `8443` (HTTPS) / `9440` (Native TLS) |
| **Database** | `treble_client_analytics`            |
| **User**     | Provided by Treble                   |
| **Password** | Provided by Treble                   |

You can use any ClickHouse-compatible client: DBeaver, DataGrip, `clickhouse-client`, or connect directly from Metabase, Looker, Power BI, Google Sheets, or another BI tool.

<Note>
  Access is available for companies that request onboarding. Contact your Account Manager or support to start the process.
</Note>

## The data contract

Three promises define how the warehouse behaves. Understanding them will save you time:

1. **Data is near real time.** New sessions, messages, and campaign sends appear within minutes of happening.
2. **Today is provisional; history is final.** Operational data keeps changing while it is in flight — a campaign send that is "in process" at 10:00 may be "delivered" at 11:00, in Treble and in your warehouse alike. Figures for any given day **consolidate fully within 48 hours**, and the warehouse self-corrects continuously (every 30 minutes) during that window. Historical data beyond that window is immutable.
3. **Every row tells you when it landed.** All tables expose a `synced_at` column: the moment the row (or its latest correction) was written. This powers reliable [incremental synchronization](/en/docs/data-warehouse-v2/incremental-sync) into your own systems.

## Naming glossary

The warehouse uses one consistent vocabulary across every table:

| Term                    | Meaning                                                                       |
| ----------------------- | ----------------------------------------------------------------------------- |
| `poll_id` / `poll_name` | A conversational flow (what you build in the Treble flow editor).             |
| `session_id`            | One execution of a flow by one user — a conversation.                         |
| `direction`             | `INBOUND` if the user started the conversation, `OUTBOUND` if a campaign did. |
| `agent_conversation_id` | A conversation handled in the agent workspace (Sales).                        |
| `treble_id`             | The contact's phone identity: country code + cellphone.                       |
| `synced_at`             | When this row was last written or corrected in the warehouse.                 |

## Security and limits

* **Row-level security:** your credentials can only ever see your company's rows — enforced by the database on every table, on every query.
* **Read-only:** your user cannot modify, create, or delete anything.
* **Protection limits:** queries have a 30-second execution cap and row/memory limits that keep the platform stable for everyone. See [Query Optimization](/en/docs/data-warehouse-v2/query-optimization) for how to stay well inside them.

## Available tables

### Conversation Flows

Everything that happens inside your automated flows.

| Table                                                                                       | Grain                       | What it holds                                                      |
| ------------------------------------------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------ |
| [`fact_treble_sessions`](/en/docs/data-warehouse-v2/fact-treble-sessions)                   | 1 row per conversation flow | Every flow execution, inbound and outbound                         |
| [`fact_treble_session_messages`](/en/docs/data-warehouse-v2/fact-treble-session-messages)   | 1 row per message           | The full conversation trace                                        |
| [`fact_treble_session_nodes`](/en/docs/data-warehouse-v2/fact-treble-session-nodes)         | 1 row per interactive step  | The journey through the flow — questions, AI steps, WhatsApp Flows |
| [`fact_treble_session_variables`](/en/docs/data-warehouse-v2/fact-treble-session-variables) | 1 row per variable          | Variables captured during each flow                                |

### Campaigns

Outbound sends and how users engage with them.

| Table                                                                   | Grain                      | What it holds                                         |
| ----------------------------------------------------------------------- | -------------------------- | ----------------------------------------------------- |
| [`fact_campaign_sends`](/en/docs/data-warehouse-v2/fact-campaign-sends) | 1 row per send             | Every outbound campaign message, full delivery detail |
| [`fact_campaign_daily`](/en/docs/data-warehouse-v2/fact-campaign-daily) | 1 row per campaign per day | Daily delivery rollup                                 |
| [`fact_hsm_responses`](/en/docs/data-warehouse-v2/fact-hsm-responses)   | 1 row per response         | Answers given to HSM templates                        |

### Agent Workspace

Human-agent operations: conversations, messages, transfers, availability, productivity.

| Table                                                                                               | Grain                        | What it holds                                |
| --------------------------------------------------------------------------------------------------- | ---------------------------- | -------------------------------------------- |
| [`fact_agent_conversations`](/en/docs/data-warehouse-v2/fact-agent-conversations)                   | 1 row per agent conversation | Conversations handled in the agent workspace |
| [`fact_agent_conversation_messages`](/en/docs/data-warehouse-v2/fact-agent-conversation-messages)   | 1 row per message            | Messages within agent conversations          |
| [`fact_agent_conversation_transfers`](/en/docs/data-warehouse-v2/fact-agent-conversation-transfers) | 1 row per transfer           | Transfers between agents                     |
| [`fact_agent_status_changes`](/en/docs/data-warehouse-v2/fact-agent-status-changes)                 | 1 row per change             | Agent availability history                   |
| [`fact_agent_daily`](/en/docs/data-warehouse-v2/fact-agent-daily)                                   | 1 row per agent per day      | Daily agent productivity                     |

### Conversions & Attribution

Where conversations come from and what they achieve.

| Table                                                                               | Grain                           | What it holds                                |
| ----------------------------------------------------------------------------------- | ------------------------------- | -------------------------------------------- |
| [`fact_target_events`](/en/docs/data-warehouse-v2/fact-target-events)               | 1 row per event                 | Conversion/target events fired in flows      |
| [`fact_ad_sessions`](/en/docs/data-warehouse-v2/fact-ad-sessions)                   | 1 row per ad-attributed session | Click-to-WhatsApp ad attribution             |
| [`fact_whatsapp_link_events`](/en/docs/data-warehouse-v2/fact-whatsapp-link-events) | 1 row per event                 | WhatsApp link clicks and conversation starts |

### Dimensions — catalogs for enrichment

Agents, tags, teams, HSM templates, agent-tag assignments, polls, WhatsApp channels, and flow nodes (including AI agent configuration). See [Dimensions](/en/docs/data-warehouse-v2/dimensions).
