# IRPCConversationOperations.GetChatTurns

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Vault API](https://developer.m-files.com/APIs/gRPC-API/vault/index.md) > [Conversations](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCConversationOperations/index.md)

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

Badges: `Vault API / standard` `write` `session`

Gets the chat turns of one of the caller's conversations, newest first, up to 100 per call.

- **Service:** [Conversations](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCConversationOperations/index.md) `MFiles.IRPCConversationOperations`
- **gRPC method:** `/MFiles.IRPCConversationOperations/GetChatTurns`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/get-chat-turns`
- **Request:** [`GetChatTurnsRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCConversationOperations/GetChatTurns/index.md#request)
- **Response:** [`GetChatTurnsResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCConversationOperations/GetChatTurns/index.md#response)
- **Book and level:** Vault API, standard
- **Kind:** write
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- The conversation must belong to the caller; otherwise the call fails with "Access is
  denied.". See the service overview for paging.

<a id="request"></a>

## Request: GetChatTurnsRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `conversation_id` | `uint32` | The ID of the conversation. |
| `sort_key` | `uint32` | 0 for the first page; for the next page, the smallest `sort_key` of the previous page. |

<a id="response"></a>

## Response: GetChatTurnsResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `chat_turns[]` | repeated [`ChatTurn`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ChatTurn/index.md) | Up to 100 chat turns in descending `sort_key` order. |
| `chat_turns[].id` | `uint32` | The ID of the chat turn, assigned by the server. |
| `chat_turns[].conv_id` | `uint32` | The ID of the conversation the turn belongs to. |
| `chat_turns[].chat_turn` | `string` | 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. |
| `chat_turns[].sort_key` | `uint32` | Orders the turns; newer turns have larger values. Used for paging. |
| `chat_turns[].created` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | When the turn was added (UTC). |
| `chat_turns[].modified` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | When the turn was added or last replaced (UTC). |
| `more_results` | `bool` | True if older chat turns remain. |
