Get all messages for a specific chat session

GET /chat/{chatId}/messages

Path parameters

  • chatId string Required

    The CUID of the chat session

Responses

  • 200 application/json

    A list of messages ordered by timestamp

    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 message (CUID)

      • chatId string Required

        CUID of the chat session this message belongs to

      • userId string Required

        CUID of the user associated with this message

      • message string Required

        The content of the message

      • messageType string Required

        The role of the message sender

        Values are system, user, or ai.

      • type string Required

        The type of the message content

        Values are file or message.

      • sequenceNumber integer Required

        Sequential number of the message within the chat

      • timestamp string(date-time) Required

        Timestamp when the message was created

  • 400 application/json

    Bad Request (e.g., missing chatId)

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

    Unauthorized

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

    Chat not found or access denied

    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/{chatId}/messages
curl \
 --request GET 'http://localhost:3000/api/v1/chat/{chatId}/messages' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "success": true,
  "statusCode": 200,
  "message": "string",
  "data": [
    {
      "id": "string",
      "chatId": "string",
      "userId": "string",
      "message": "string",
      "messageType": "system",
      "type": "file",
      "sequenceNumber": 42,
      "timestamp": "2025-05-04T09:42:00Z"
    }
  ]
}
Response examples (400)
{
  "success": false,
  "statusCode": 400,
  "message": "Error description"
}
Response examples (401)
{
  "success": false,
  "statusCode": 400,
  "message": "Error description"
}
Response examples (404)
{
  "success": false,
  "statusCode": 400,
  "message": "Error description"
}
Response examples (500)
{
  "success": false,
  "statusCode": 400,
  "message": "Error description"
}