# Available Views

Your tenant has access to the following SQL views. Replace `{TenantName}` with your organization's name (e.g., `Acme`, `Contoso`).

## Core Views

| View                                   | Description                                                    |
| -------------------------------------- | -------------------------------------------------------------- |
| `v_Conversation_{TenantName}`          | All conversations with status, channels, tags, and SLA metrics |
| `v_ConversationTimeline_{TenantName}`  | Messages and events within conversations                       |
| `v_Contact_{TenantName}`               | Customer contact information                                   |
| `v_ContactAddress_{TenantName}`        | Contact addresses (email, phone, social)                       |
| `v_Agent_{TenantName}`                 | Agent information (status, role, profile)                      |
| `v_AgentProfile_{TenantName}`          | Agent profile data (firstName, lastName, email)                |
| `v_Team_{TenantName}`                  | Team and queue information                                     |
| `v_Tag_{TenantName}`                   | Conversation tags with hierarchy support                       |
| `v_CustomFieldDefinition_{TenantName}` | Custom field definitions and metadata                          |

## Metric Views

| View                                      | Description                                                           |
| ----------------------------------------- | --------------------------------------------------------------------- |
| `v_ActiveConversationsDaily_{TenantName}` | Daily active conversation count by channel and team                   |
| `v_AggDailyConversations_{TenantName}`    | Pre-computed daily conversation metrics (counts, SLA, response times) |
| `v_AggDailyTags_{TenantName}`             | Pre-computed daily conversation counts per tag                        |
| `v_AggDailyAgents_{TenantName}`           | Pre-computed daily agent performance metrics                          |

## Voice Call Views

These views are only populated if your organization uses voice calling.

| View                                        | Description                         |
| ------------------------------------------- | ----------------------------------- |
| `v_VoiceCalls_{TenantName}`                 | Individual call records with timing |
| `v_VoiceCalls_ByQueue_Daily_{TenantName}`   | Daily metrics by queue              |
| `v_VoiceCalls_ByQueue_AllTime_{TenantName}` | All-time metrics by queue           |

## Dynamic Custom Fields

Views automatically include your custom fields as proper columns, prefixed with `custom_`.

### Example

If you have custom fields `serial_number` and `warranty_type` defined:

```sql
SELECT
  id,
  statusName,
  custom_serial_number,
  custom_warranty_type
FROM v_Conversation_{TenantName}
WHERE custom_serial_number IS NOT NULL;
```

### Custom Field Columns

| Scope        | View                          | Available As                 |
| ------------ | ----------------------------- | ---------------------------- |
| Conversation | `v_Conversation_{TenantName}` | `custom_{field_key}` columns |
| Contact      | `v_Contact_{TenantName}`      | `custom_{field_key}` columns |

Custom field columns are automatically generated based on your `v_CustomFieldDefinition_{TenantName}` table. Column names are sanitized (special characters become underscores).

### Field Types

| Custom Field Type | SQL Column Type | JSON Path    |
| ----------------- | --------------- | ------------ |
| Text              | varchar         | stringValue  |
| Integer           | int             | integerValue |
| Number            | float           | numberValue  |
| Boolean           | bit             | boolValue    |
| SingleSelect      | varchar         | stringValue  |
| MultiSelect       | varchar         | stringValue  |

### Data Freshness

Core view data (conversations, contacts, timelines, etc.) is synchronized **hourly**. New data typically appears within 1 hour.

Custom field columns are refreshed **daily** at 2:00 AM UTC. If you add new custom field definitions, the columns will appear in views the next day.

## View Details

* [Conversations](/atender-labs-docs/analytics/views/conversations.md) - Conversation and timeline views
* [Contacts](/atender-labs-docs/analytics/views/contacts.md) - Contact information
* [Agents, Teams & Tags](/atender-labs-docs/analytics/views/agents-teams-tags.md) - Agent, team, and tag views
* [Voice Calls](/atender-labs-docs/analytics/views/voice-calls.md) - Voice call analytics
* [Metrics](/atender-labs-docs/analytics/views/active-conversations.md) - Aggregated metric views


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://atender-labs.gitbook.io/atender-labs-docs/analytics/views.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
