Get Chat Messages

GET /api/v1/chats/{chatID}/messages

Retrieves all messages associated with a specific chat session.

Path parameters

  • chatID integer Required

    Chat ID

Responses

  • 200 application/json

    List of messages with parsed metadata

    Hide response attributes Show response attributes object
    • chat_id integer Required
    • content string Required
    • created_at string Required
    • id integer Required
    • metadata object Required

      Use structured type

      Hide metadata attributes Show metadata attributes object
      • response_time number Required

        In milliseconds

      • token_count integer Required
    • role string Required
  • 400 application/json

    Invalid chat ID

    Hide response attribute Show response attribute object
    • * string Additional properties
  • 401 application/json

    Unauthorized (JWT invalid/missing or Org ID not found)

    Hide response attribute Show response attribute object
    • * string Additional properties
  • 403 application/json

    Permission denied (Chat doesn't belong to user's org)

    Hide response attribute Show response attribute object
    • * string Additional properties
  • 404 application/json

    Chat not found

    Hide response attribute Show response attribute object
    • * string Additional properties
  • 500 application/json

    Failed to get chat or messages

    Hide response attribute Show response attribute object
    • * string Additional properties
GET /api/v1/chats/{chatID}/messages
curl \
 --request GET 'http://api.example.com/api/v1/chats/{chatID}/messages' \
 --header "Authorization: $API_KEY"
Response examples (200)
[
  {
    "chat_id": 42,
    "content": "string",
    "created_at": "string",
    "id": 42,
    "metadata": {
      "response_time": 42.0,
      "token_count": 42
    },
    "role": "string"
  }
]
Response examples (400)
{
  "additionalProperty1": "string",
  "additionalProperty2": "string"
}
Response examples (401)
{
  "additionalProperty1": "string",
  "additionalProperty2": "string"
}
Response examples (403)
{
  "additionalProperty1": "string",
  "additionalProperty2": "string"
}
Response examples (404)
{
  "additionalProperty1": "string",
  "additionalProperty2": "string"
}
Response examples (500)
{
  "additionalProperty1": "string",
  "additionalProperty2": "string"
}