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

# chat_message table

> This table contains messages in a chat session.

## chat\_message Table (333)

This table contains messages in a chat session.

## Fields

| Name               | Description                                                                  | Type                                                              | Nullable |
| ------------------ | ---------------------------------------------------------------------------- | ----------------------------------------------------------------- | :------: |
| id                 | The primary key (auto-incremented)                                           | PK                                                                |    No    |
| session\_id        | The reference to the associated chat session.                                | FK [chat\_session](./chat-session.mdx)                            |    No    |
| message            | The message.                                                                 | Clob                                                              |    Yes   |
| when\_posted       | When the message was posted (UTC timestamp).                                 | DateTime                                                          |    Yes   |
| special\_type      | Enum indicating if it is a special message, such as an URL redirection, etc. | Enum [ChatMessageSpecialType](./enums/chatmessagespecialtype.mdx) |    Yes   |
| special\_param     | Special parameter for the special\_type.                                     | String(255)                                                       |    Yes   |
| read\_by\_customer | Whether the message has been read by the customer or not.                    | Bool                                                              |    Yes   |
| type               | The type of the message.                                                     | Enum [ChatMessageType](./enums/chatmessagetype.mdx)               |    Yes   |
| author             | The author of the message.                                                   | String(255)                                                       |    Yes   |
| created\_by        | The user agent who wrote the message. -1 if customer                         | FK [ejuser](./ejuser.mdx)                                         |    Yes   |

<img src="https://mintcdn.com/superofficeas/i6M2qZmvMNH7UTeu/media/loc/en/database/tables/chat_message.png?fit=max&auto=format&n=i6M2qZmvMNH7UTeu&q=85&s=21c9fc9b3f37719ba056b495123ae216" alt="chat_message table relationship diagram" width="678" height="59" data-path="media/loc/en/database/tables/chat_message.png" />

## Indexes

| Fields      | Types | Description |
| ----------- | ----- | ----------- |
| session\_id | FK    | Index       |

## Relationships

| Table                           | Description                                              |
| ------------------------------- | -------------------------------------------------------- |
| [chat\_session](./chat-session) | This table contains chat sessions.                       |
| [ejuser](./ejuser)              | This table contains entries for the users of the system. |

## Replication Flags

* None

## Security Flags

* No access control via user's Role.


## Related topics

- [Enum values for ChatMessageType](/en/database/tables/enums/chatmessagetype.md)
- [Enum values for ChatMessageSpecialType](/en/database/tables/enums/chatmessagespecialtype.md)
- [chat_session table](/en/database/tables/chat-session.md)
- [Trigger](/en/automation/trigger/reference/CRMScript.Event.Trigger.md)
- [SuperOffice.WebApi.Data.ChatMessage](/en/api/reference/webapi/SuperOffice.WebApi.Data.ChatMessage.md)
- [Enum ChatMessageType](/en/automation/crmscript/reference/CRMScript.NetServer.ChatMessageType.md)
