> ## Documentation Index
> Fetch the complete documentation index at: https://www.text.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Finding data in Text APIs

> Find which API owns the customer, chat, ticket, or report data you need and how related resources connect.

Text has a distributed data model. Related information can belong to separate resources, and each API exposes the part of that model needed for its domain.

For example, a ticket can contain the requester's details and a reference to the record from which it originated, a chat can include the customer who participated in it, and the Customer Data Platform can combine properties from that customer's other identities. These responses describe the same interaction from different domains.

## Data domains

The following domains show where you manage or retrieve each type of data. They are not isolated: a response can include data or IDs from other domains.

| Domain | Primary resources | API reference |
| - | - | - |
| Accounts and organizations | Text accounts, organization memberships, account settings, and token context | [Global Accounts API](https://www.text.com/docs/api/global-accounts.md) |
| Chat configuration | Agents and bots inside specific organizations, chatting teams, routing settings, and property definitions | [Configuration API](https://www.text.com/docs/api/configuration/) |
| Customer authentication | Customer access tokens and token transfers | [Customer Accounts API](https://www.text.com/docs/api/customer-accounts.md) |
| Customer profiles | Customer identities, identity clusters, persistent customer properties, and associated chat and ticket IDs | [Customer Data Platform API](https://www.text.com/docs/api/customer-data-platform.md) |
| Conversations | Chats, threads, events, participants, session fields, and conversation properties | [Agent Chat API](https://www.text.com/docs/api/agent-chat/v3.6.md) and [Customer Chat API](https://www.text.com/docs/api/customer-chat/v3.6.md) |
| Tickets | Tickets, ticket events, requesters, assignments, ticketing teams, and custom fields | [Ticketing API](https://www.text.com/docs/api/ticketing.md) |
| Notifications | RTM pushes and webhook events for changes to chats and configuration resources | [Agent Chat RTM API](https://www.text.com/docs/api/agent-chat/v3.6/rtm.md), [Customer Chat RTM API](https://www.text.com/docs/api/customer-chat/v3.6/rtm.md), and [Webhooks API](https://www.text.com/docs/api/webhooks/v3.6.md) |
| Analytics | Aggregated conversation metrics | [Reports API](https://www.text.com/docs/api/reports/v3.6.md) |

## Three ways APIs expose related data

Data from one domain can appear in another in three ways: as included data, as an ID that points to another resource, or as values stored for a specific record or moment.

### An API includes related data

Some responses include fields from a related resource. For example, the Agent Chat API returns a customer participant as part of a chat. The participant can include profile information from the Customer Data Platform.

Use the included fields when they provide enough information for the resource you are working with. To retrieve or update the related resource itself, use the API that manages it.

### An API points to another resource

Some responses provide an ID instead of the related resource. For example, an RTM push or webhook can provide a `chat_id` or `thread_id` without including the complete chat or thread. Use that ID with the Agent Chat API or Customer Chat API to retrieve the related resource.

### An API preserves data for its own context

An object can preserve information that applies to a particular time or only to that object.

For example:

* A ticket requester contains the name and email stored with that ticket.
* Session fields describe the context of a chat session.
* A form event contains the answers submitted in that event.
* An archived conversation can contain customer data that differs from the customer's Customer Data Platform profile.

These values do not form one synchronized customer profile. When the same type of value appears on different resources, use the version stored with the resource whose context you need.

## How resources connect

Resources from different domains often connect through IDs. Start with the IDs in the response you already have, then use the API that manages the related resource.

### From a chat

A `chat_id` identifies the chat that connects participants and threads. A `thread_id` identifies one conversation session. The customer `id` on the chat identifies the customer who participated in it.

Use the chat ID to retrieve the chat, the thread ID to retrieve one transcript, and the customer ID to retrieve the customer's profile:

```text theme={null}
chat_id → chat → thread_id → thread transcript
                └ customer_id → customer profile
```

### From a ticket

A ticket source can connect the ticket to the record from which it originated:

```text theme={null}
ticket_id → ticket → source.referenceID → source record
```

When `source.type` is `integration`, `source.referenceType` names the type of source record, `source.referenceID` identifies that record, and `source.referenceURL` links to it. The requester's name and email remain data stored with the ticket. Ticket responses do not include a Customer Data Platform customer ID.

### From a customer

A `customer_id` points to a customer record in the Customer Data Platform. See [Customer identities](https://www.text.com/docs/key-concepts/customer-identities.md) to choose between retrieving that record, data combined across associated identities, or chat and ticket IDs connected to the customer.

### From a notification

An RTM push or webhook can contain a complete object, selected fields, or identifiers for the affected resource. If the payload does not contain the data you need, use its identifiers to retrieve the resource from the API listed in the data domains table.

## Choose the right type of read

Use the resource or delivery method that matches the data you need.

| If you're looking for | Use |
| - | - |
| State of a specific chat, customer, or ticket | The API for that resource |
| Chat summaries available to an agent | [`list_chats`](https://www.text.com/docs/api/agent-chat/v3.6/chats/list-chats) |
| Chats and threads from the archive | [`list_archives`](https://www.text.com/docs/api/agent-chat/v3.6/chats/list-archives) |
| Transcript for one conversation session | [`get_thread_transcript`](https://www.text.com/docs/api/agent-chat/v3.6/chats/get-thread-transcript) |
| Chat events delivered over an active connection | The [Agent Chat RTM API](https://www.text.com/docs/api/agent-chat/v3.6/rtm.md) or [Customer Chat RTM API](https://www.text.com/docs/api/customer-chat/v3.6/rtm.md) |
| Chat events sent to your backend | The [Webhooks API](https://www.text.com/docs/api/webhooks/v3.6.md) |
| Aggregated conversation metrics | The [Reports API](https://www.text.com/docs/api/reports/v3.6.md) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.