---
title: "Get Message History"
method: GET
path: "/api/livechat/public/{widget_key}/messages"
tags: ["livechat", "livechat"]
---

# Get Message History

`GET /api/livechat/public/{widget_key}/messages`

## Request

- Base URL: `https://api.dialogbrain.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dialogbrain.com/api/livechat/public/{widget_key}/messages`
- Auth: none declared

Get message history for returning visitors.

When show_visitor_history is OFF, only serves messages if 'after' timestamp
is provided (proving this is a continuing tab session, not a fresh open).

## Path parameters

- `widget_key` string, required

## Query parameters

- `limit` integer
- `before_id` string, nullable
- `after` string, nullable

## Headers

- `X-Session-Token` string, nullable

## Response `200`

Successful Response

- HistoryResponse: Message history response.
  - `messages` object[], required
  - `has_more` boolean, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway.md) · [All operations](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/revisions/d84e7dc9977d?raw)
