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

# Storing custom data

> Choose where to store additional customer, chat, thread, event, and ticket data based on its scope, lifetime, and visibility.

Text provides several ways to store custom data. They are not interchangeable fields on one conversation object. Each type belongs to a different resource and follows that resource's lifecycle.

Choose a storage type by determining what the data describes, how long it must remain available, and who should be able to read it.

When Text copies a value from one resource to another, the copy is independent. Updating or deleting either value does not update or delete the other.

## Custom data types

| Data type | Stored on | How long it remains available | Methods and references |
| - | - | - | - |
| Customer properties | A customer identity | Until the value or customer identity is removed | [Set customer properties values](https://www.text.com/docs/api/customer-data-platform/customer-properties/set-customer-properties-values.md) and [Get customer](https://www.text.com/docs/api/customer-data-platform/customers/get-customer.md) |
| Customer custom fields | A customer identity, grouped by the client ID that set them | Until the customer identity is removed | Read with [Get customer](https://www.text.com/docs/api/customer-data-platform/customers/get-customer.md#response-custom-fields-one-of-0). The Customer Data Platform API cannot modify them. |
| Session fields | The customer's current chat session | During the session and in the archived thread afterward | [Set customer session fields](https://www.text.com/docs/api/customer-chat/v3.6/customers/set-customer-session-fields.md), [Set session variables](https://www.text.com/docs/api/chat-widget-js-api/methods.md#set-session-variables), [Get chat](https://www.text.com/docs/api/agent-chat/v3.6/chats/get-chat.md), and [List archives](https://www.text.com/docs/api/agent-chat/v3.6/chats/list-archives.md) |
| Chat properties | One chat | Until the value or chat is removed | [Update chat properties](https://www.text.com/docs/api/agent-chat/v3.6/properties/update-chat-properties.md) |
| Thread properties | One thread | Until the value or thread is removed | [Update thread properties](https://www.text.com/docs/api/agent-chat/v3.6/properties/update-thread-properties.md) |
| Event properties | One event | Until the value or event is removed | [Update event properties](https://www.text.com/docs/api/agent-chat/v3.6/properties/update-event-properties.md) |
| Ticket custom fields | One ticket | Until the value or ticket is removed | [Update ticket](https://www.text.com/docs/api/ticketing/tickets/update-ticket.md) and [Custom fields](https://www.text.com/docs/api/ticketing/custom-fields/list-custom-fields.md) |
| Form answers | One form event in a thread | As long as the event remains in the thread | [Get chat](https://www.text.com/docs/api/agent-chat/v3.6/chats/get-chat.md) and [Get thread transcript](https://www.text.com/docs/api/agent-chat/v3.6/chats/get-thread-transcript.md) |

## Customer properties

Customer properties store persistent profile data. They belong to customer identities and can contribute to a merged customer view. Use them when the value should follow the customer beyond one chat or ticket.

A chat response can include a projection of customer properties, but the Customer Data Platform owns the customer profile. Use [Get customer](https://www.text.com/docs/api/customer-data-platform/customers/get-customer.md) for one identity or [Get merged customer](https://www.text.com/docs/api/customer-data-platform/customers/get-merged-customer.md) for data combined across its identity cluster.

Do not use customer properties for state that belongs only to a chat session. A customer can have several chats and several identities.

### Customer custom fields

The `custom_fields` object contains untyped customer data grouped by the Client ID of the client that set it. The Customer Data Platform API can retrieve these fields but cannot modify them. Unlike customer properties, custom fields do not have predefined types and cannot be used to filter customers.

## Session fields

Session fields provide context about a customer and their current interaction. They accompany the customer during the current chat session and remain available with the thread after it is archived.

> [!WARNING]
>
> `set_session_variables` replaces the session variables collection. Use
> `update_session_variables` when you intend to change selected keys without
> replacing the remaining values.

## Chat, thread, and event properties

Properties store custom values on a chat, thread, or event. First, [register the property](https://www.text.com/docs/api/configuration/v3.6/properties/register-property.md) with the Configuration API. Then, use the corresponding Agent Chat API or Customer Chat API method to set its value on a specific resource.

Choose the narrowest scope that describes the value:

* Use a chat property when the value applies to the complete chat across its threads.
* Use a thread property when the value applies to one conversation session.
* Use an event property when the value describes one message or activity.

Properties do not inherit between scopes. Property definitions also control access. Private properties are available only to tokens associated with the owner Client ID. Publish a property if tokens associated with other Client IDs need to read or write it.

Review [Properties overview](https://www.text.com/docs/api/events-and-properties/properties-overview.md) before publishing a property.

## Ticket custom fields

Ticket custom fields store structured values on a ticket.

When Text creates a ticket from a chat, it can copy the chat's session fields into corresponding ticket custom fields.

Use the Ticketing API when you need the ticket's value. Follow the ticket source back to the chat when you need the original conversation context.

## Form answers

Pre-chat, post-chat, and survey forms are events within a thread. Their answers describe that form submission. A form field can also map an answer to a customer property, but the form event and customer property remain separate records with different scopes.

Read the form event when you need the submitted answers in that session. Read the customer profile when you need the persistent value associated with the customer.

See [Finding data in Text APIs](https://www.text.com/docs/key-concepts/data-across-text-apis.md) for how to follow references between resources.


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