Overview
The List Chats query allows users to retrieve a list of chat sessions. This is useful for displaying all active or historical chats in the user interface, enabling users to select a chat session to view its messages.
Architecture
Behavior
The List Chats query follows these steps:
- Validates the pagination parameters
- Queries the chat repository to fetch a paginated list of chat sessions.
- Maps the chat sessions to a DTO using the configured auto-mapper.
- Returns the list of chat sessions with a 200 OK status code.
GET /api/v1/chats
Parameters
- Name (query) (optional) - The name of the chat session to filter by.
- UserId (query) (optional) - The unique identifier (GUID) of the user to filter chats by.
- IncludeMessages (query) (optional) - A boolean flag to include messages in the response. Defaults to
false
.
Request Body
This query does not require a request body.
Response
200 OK
400 Bad Request
Schema does not contain any properties.
type string
title string
status integer <int32>
detail string
instance string
errors object