Get Chat by ID

GET /api/v1/chats/{chatID}

Retrieves details for a specific chat session, optionally including messages.

Path parameters

  • chatID integer Required

    Chat ID

Query parameters

  • include_messages boolean

    Include messages in the response

    Default value is false.

Responses

  • 200 application/json

    Chat details

    Hide response attributes Show response attributes object
    • created_at string Required
    • id integer Required
    • messages array[object] Required
      Hide messages attributes Show messages attributes object
      • chat_id integer Required
      • content string Required
      • created_at string Required
      • id integer Required
      • metadata string Required

        Store MessageMetadata as JSON string

      • role string Required
    • metadata object Required

      Use the structured type

      Hide metadata attributes Show metadata attributes object
      • avg_response_time number Required

        In seconds

      • country_code string Required

        ISO-3166 country code (e.g., "NL")

      • ip_address string Required
      • is_escalated boolean Required
      • is_forwarded_to_hr boolean Required
      • language_code string Required

        ISO-639 language code (e.g., "tr")

      • question_category string Required
      • sentiment string Required
      • session_id string Required
      • token_count integer Required

        Total tokens for the chat session

      • user_rating integer Required

        Optional user rating

    • organization_id integer Required
    • tags array[string] Required

      Parsed tags

    • title string Required
    • updated_at string Required
    • user_id integer Required

      Nullable for anonymous chats

  • 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}
curl \
 --request GET 'http://api.example.com/api/v1/chats/{chatID}' \
 --header "Authorization: $API_KEY"
Response examples (200)
{
  "created_at": "string",
  "id": 42,
  "messages": [
    {
      "chat_id": 42,
      "content": "string",
      "created_at": "string",
      "id": 42,
      "metadata": "string",
      "role": "string"
    }
  ],
  "metadata": {
    "avg_response_time": 42.0,
    "country_code": "string",
    "ip_address": "string",
    "is_escalated": true,
    "is_forwarded_to_hr": true,
    "language_code": "string",
    "question_category": "string",
    "sentiment": "string",
    "session_id": "string",
    "token_count": 42,
    "transcript_link": "string",
    "user_rating": 42
  },
  "organization_id": 42,
  "tags": [
    "string"
  ],
  "title": "string",
  "updated_at": "string",
  "user_id": 42
}
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"
}