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

# cloud_chat_messages

> The text of every message in the workspace, in send order, with its channel status and whether it was private. The largest table in the export. For the conversation it belongs to, join [`cloud_chat_conversations`](/data-export/catalog/cloud-chat/cloud_chat_conversations); for only the messages a ClaudIA agent took part in, use [`claudia_messages`](/data-export/catalog/claudia/claudia_messages).

The text of every message in the workspace, in send order, with its channel status and whether it was private. The largest table in the export. For the conversation it belongs to, join [`cloud_chat_conversations`](/data-export/catalog/cloud-chat/cloud_chat_conversations); for only the messages a ClaudIA agent took part in, use [`claudia_messages`](/data-export/catalog/claudia/claudia_messages).

<Columns cols={3}>
  <Card title="One row is">
    one message
  </Card>

  <Card title="Delivery">
    Daily delta on `etl_updated_at`
  </Card>

  <Card title="Columns">
    27
  </Card>
</Columns>

## Where it lands

```text theme={null}
s3://<YOUR_BUCKET>/v1/datamart_cloudchat_saas/cloud_chat_messages/etl_date=<DATE>/
```

Each partition holds only the rows the datamart ingested that day, so union every
`etl_date=` partition to reconstruct the table. One of them is
`etl_date=__initial__`, the first load, holding everything that preceded the
earliest daily partition. Check for `_SUCCESS` before reading a partition, as
described in [bucket layout](/data-export/bucket-layout#how-to-tell-if-a-partition-is-ready).

## Columns

<ResponseField name="messages_sk" type="bigint">
  Internal warehouse key. Not stable between deliveries — join on `messages_id`.
</ResponseField>

<ResponseField name="cc_conversations_sk" type="bigint">
  Internal warehouse key for the conversation. Use `conversation_id`.
</ResponseField>

<ResponseField name="cc_inboxes_sk" type="bigint">
  Internal warehouse key for the inbox. Use `inbox_id`.
</ResponseField>

<ResponseField name="cc_account_sk" type="bigint">
  Internal warehouse key for the account. Use `account_id`.
</ResponseField>

<ResponseField name="customer_id" type="varchar(36)">
  Identifier of the workspace the message belongs to.
</ResponseField>

<ResponseField name="messages_id" type="integer">
  **Join key.** Unique id of the message within its instance.
</ResponseField>

<ResponseField name="instance" type="varchar(50)">
  Instance the workspace is served from. Named `instance` here, and `instance_id` on the other tables.
</ResponseField>

<ResponseField name="account_id" type="integer">
  Account the message belongs to.
</ResponseField>

<ResponseField name="inbox_id" type="integer">
  Inbox the conversation arrived in.
</ResponseField>

<ResponseField name="conversation_id" type="integer">
  **Join key.** Conversation the message belongs to. Joins to [`cloud_chat_conversations`](/data-export/catalog/cloud-chat/cloud_chat_conversations).
</ResponseField>

<ResponseField name="source_id" type="varchar(255)">
  Id the message carries on the channel it came from. `NULL` when the channel sends none.
</ResponseField>

<ResponseField name="sender_id" type="bigint">
  Id of whoever sent it. An agent id when `sender_type` is `User`, a contact id when it is `Contact`.
</ResponseField>

<ResponseField name="sender_type" type="varchar(50)">
  Which side sent the message: `Contact` for your customer, `User` for an agent. `NULL` on the automated entries the workspace writes itself.
</ResponseField>

<ResponseField name="message_type_id" type="integer">
  Numeric form of `message_type`.
</ResponseField>

<ResponseField name="message_type" type="varchar(16)">
  `incoming`, `outgoing`, `activity` or `template`. `activity` rows are the workspace's own notes, not something a person typed.
</ResponseField>

<ResponseField name="status_id" type="integer">
  Numeric form of `message_status`.
</ResponseField>

<ResponseField name="message_status" type="varchar(16)">
  Delivery state on the channel: `sent`, `delivered`, `read` or `failed`. It is the state on the day the row was delivered to you and is not restated later.
</ResponseField>

<ResponseField name="content_type_id" type="integer">
  What kind of content the message carries, such as plain text or an interactive reply.
</ResponseField>

<ResponseField name="macro_id" type="bigint">
  Macro that produced the message, when an agent sent it from one.
</ResponseField>

<ResponseField name="private_flag" type="boolean">
  `true` for an internal note, visible to agents only. Your customer never saw these.
</ResponseField>

<ResponseField name="content" type="varchar(50000)">
  The message as it was sent. Free text written by your customer or your agent, so treat it as personal data.
</ResponseField>

<ResponseField name="processed_message_content" type="varchar(65000)">
  The same message after the workspace expands templates and variables. `NULL` when there was nothing to expand.
</ResponseField>

<ResponseField name="created_at" type="timestamp">
  When the message was sent.
</ResponseField>

<ResponseField name="updated_at" type="timestamp">
  When the message record was last modified, for example when the channel confirmed delivery.
</ResponseField>

<ResponseField name="tenant_id" type="varchar(256)">
  Id of the tenant. `NULL` for rows with no tenant mapping.
</ResponseField>

<ResponseField name="etl_updated_at" type="timestamp">
  When the datamart first wrote this row. It decides the partition the message lands in and does not change afterwards, so a later edit to the message is not delivered again.
</ResponseField>

<ResponseField name="etl_date" type="varchar">
  Partition column. The day whose rows this file holds, in `YYYY-MM-DD`. Not a date type, because the initial load carries the literal `__initial__` instead of a day.
</ResponseField>
