# ChatTurn

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Reference](https://developer.m-files.com/APIs/gRPC-API/Reference/index.md) > [Messages](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ChatTurn/

One stored turn of a conversation.

- **Full name:** `MFiles.ChatTurn`
- **Proto file:** [`mfiles/structs.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/structs.proto)

<a id="fields"></a>

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-id"></a>`id` | `uint32` | 1 | The ID of the chat turn, assigned by the server. |
| <a id="f-conv_id"></a>`conv_id` | `uint32` | 2 | The ID of the conversation the turn belongs to. |
| <a id="f-chat_turn"></a>`chat_turn` | `string` | 3 | The content of the turn as text. The server stores it as given and does not parse it; the format is up to the caller. |
| <a id="f-sort_key"></a>`sort_key` | `uint32` | 4 | Orders the turns; newer turns have larger values. Used for paging. |
| <a id="f-created"></a>`created` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | 5 | When the turn was added (UTC). |
| <a id="f-modified"></a>`modified` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | 6 | When the turn was added or last replaced (UTC). |

<a id="used-by-methods"></a>

## Used by methods

- [IRPCConversationOperations.AddOrUpdateChatTurn](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCConversationOperations/AddOrUpdateChatTurn/index.md): Adds a chat turn to one of the caller's conversations, or replaces the content of an existing chat turn.
- [IRPCConversationOperations.GetChatTurns](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCConversationOperations/GetChatTurns/index.md): Gets the chat turns of one of the caller's conversations, newest first, up to 100 per call.

<a id="used-in-fields"></a>

## Used in fields

- [`GetChatTurnsResponse.chat_turns`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCConversationOperations/GetChatTurns/index.md#response): Up to 100 chat turns in descending `sort_key` order.
- [`AddOrUpdateChatTurnRequest.chat_turn`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCConversationOperations/AddOrUpdateChatTurn/index.md#request): The chat turn. Set `conv_id` and `chat_turn` (the content); set `id` to replace an existing turn.
- [`AddOrUpdateChatTurnResponse.updated_chat_turn`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCConversationOperations/AddOrUpdateChatTurn/index.md#response): The chat turn as stored, with its ID and `sort_key`.
