Get all chat sessions for the logged-in user

GET /chat

Responses

  • 200 application/json

    A list of chat sessions

    Hide response attributes Show response attributes object
    • success boolean Required
    • statusCode integer Required
    • message string Required
    • data array[object] Required
      Hide data attributes Show data attributes object
      • id string Required

        Unique identifier for the chat session (CUID)

      • userId string Required

        CUID of the user who owns the chat

      • chatName string Required

        Name of the chat session

      • systemMessage string Required

        System message for the chat (e.g., AI personality)

      • createdAt string(date-time) Required

        Timestamp when the chat was created

      • updatedAt string(date-time) Required

        Timestamp when the chat was last updated

      • status string Required

        Status of the chat session

        Values are active or deactivated. Default value is active.

      • type string Required

        Type of the chat session

        Values are text or file. Default value is text.

  • 401 application/json

    Unauthorized (User not authenticated)

    Hide response attributes Show response attributes object
    • success boolean Required
    • statusCode integer Required
    • message string Required
  • 500 application/json

    Internal Server Error

    Hide response attributes Show response attributes object
    • success boolean Required
    • statusCode integer Required
    • message string Required
GET /chat
curl \
 --request GET 'http://localhost:3000/api/v1/chat' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "success": true,
  "statusCode": 200,
  "message": "string",
  "data": [
    {
      "id": "string",
      "userId": "string",
      "chatName": "string",
      "systemMessage": "string",
      "createdAt": "2025-05-04T09:42:00Z",
      "updatedAt": "2025-05-04T09:42:00Z",
      "status": "active",
      "type": "text"
    }
  ]
}
Response examples (401)
{
  "success": false,
  "statusCode": 400,
  "message": "Error description"
}
Response examples (500)
{
  "success": false,
  "statusCode": 400,
  "message": "Error description"
}