---
title: "Get the visitor's conversation (public)"
method: GET
path: "/public/conversations/{id}"
tags: ["Chat widget"]
---

# Get the visitor's conversation (public)

`GET /public/conversations/{id}`

## Request

- Base URL: `https://api.hypamoon.com/api/v1`
- URL: `https://api.hypamoon.com/api/v1/public/conversations/{id}`
- Auth: API key in query parameter `token`

Called by the chat widget to restore the conversation after a page load. Needs the public chat token in ?token=, the Origin header and X-Conversation-Token. Returns only the messages and the state: no metadata, customer details or summary. A conversation from another token, or one started with your API key, is never reachable here.

## Path parameters

- `id` string, uuid, required

## Headers

- `X-Conversation-Token` string, required

## Response `200`

The conversation with its messages.

- PublicConversationDetail: The visitor's own conversation with its messages.
  - `conversation` PublicConversation, required: A conversation as the widget sees it: only what concerns the visitor. No metadata, customer details or summary; your backend reads those with GET /conversations/{id}.
    - `id` string, uuid, required: The id of the conversation.
    - `channel` 'widget', required: Always widget: started through a public chat token.
    - `status` 'open' | 'closed', required: open: takes messages. closed: takes no more messages.
    - `language` string, required: The language the assistant opened in.
    - `turns` integer, required: Visitor messages answered so far.
    - `max_turns` integer, required: After this many turns the conversation closes (close_reason turn_limit).
    - `created_at` string, date-time, required: When the conversation started.
    - `last_message_at` string, date-time, nullable, required: When the last message was sent.
    - `closed_at` string, date-time, nullable, required: When the conversation closed.
    - `close_reason` 'closed' | 'inactive' | 'turn_limit' | 'null', nullable, required: Why it closed: inactive after 30 minutes without a message, or turn_limit.
    - `test` boolean, required: true for a conversation through a test token (hm_pubtest_).
  - `messages` ChatMessage[], required: All messages, oldest first, starting with the greeting.
    - `id` string, uuid, required: The id of the message.
    - `role` 'customer' | 'assistant', required: Who wrote it: the customer, or the assistant (also the fixed greeting).
    - `text` string, required: The text.
    - `created_at` string, date-time, required: When the message was stored.

## Other responses

- `401`: Unauthorized: invalid_chat_token, chat_token_revoked, invalid_conversation_token.
- `403`: Forbidden: origin_not_allowed.
- `404`: Not Found: not_found.
- `429`: Too Many Requests: rate_limited.
- `500`: Internal Server Error: internal_error.
- `503`: Service Unavailable: chat_unavailable.

---

[API](https://skmtc.dev/hypamoon/apis/hypamoon-api.md) · [All operations](https://skmtc.dev/hypamoon/apis/hypamoon-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hypamoon/apis/hypamoon-api/revisions/9f0b90004c06?raw)
