---
title: "Get chat history"
description: "Get chat history.\n\nEach returned message carries a ``created_at`` derived from the LangGraph\ncheckpoint that first contained it — clients use this for stable display\ntimestamps instead of stamping fetch time. Falls back to ``None`` when the\noriginating checkpoint cannot be resolved (very rare; treat as unknown on\nthe client and render a fallback there)."
---

> Documentation Index
> Fetch the complete documentation index at: https://truememory-docs.mvstg.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: AI Gateway API › History & Feedback

`POST /history`

Get chat history.

Each returned message carries a ``created_at`` derived from the LangGraph
checkpoint that first contained it — clients use this for stable display
timestamps instead of stamping fetch time. Falls back to ``None`` when the
originating checkpoint cannot be resolved (very rare; treat as unknown on
the client and render a fallback there).

## Authentication

- `HTTPBearer`, http, header `Authorization`

## Header parameters

- `x-app-id` (`history.header.x-app-id`; any of, optional) — Application ID for scoping threads
  - any of: `string`, `null`
- `X-On-Behalf-Of` (`history.header.X-On-Behalf-Of`; any of, optional)
  - any of: `string`, `null`
- `X-External-User-Id` (`history.header.X-External-User-Id`; any of, optional)
  - any of: `string`, `null`
- `X-App-Id` (`history.header.X-App-Id`; any of, optional)
  - any of: `string`, `null`

## Request body

_Required._

- `thread_id` (`history.thread_id`; string, required) — Thread ID to persist and continue a multi-turn conversation.

## Example request

```json
{
  "thread_id": "847c6285-8fc9-4560-a83f-4e6285809254"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://truememory-api.mvstg.com/history \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "thread_id": "847c6285-8fc9-4560-a83f-4e6285809254"
}
'
```

### TypeScript

```typescript
const url = 'https://truememory-api.mvstg.com/history';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({thread_id: '847c6285-8fc9-4560-a83f-4e6285809254'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://truememory-api.mvstg.com/history"

payload = { "thread_id": "847c6285-8fc9-4560-a83f-4e6285809254" }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Successful Response

#### Example

```json
{
  "messages": [
    {
      "type": "human",
      "content": "Hello, world!",
      "tool_calls": [],
      "tool_call_id": "call_Jja7J89XsjrOLA5r!MEOW!SL",
      "run_id": "847c6285-8fc9-4560-a83f-4e6285809254",
      "response_metadata": {},
      "custom_data": {},
      "metadata": {
        "property1": "string",
        "property2": "string"
      },
      "created_at": "2026-05-06T12:34:56.789Z"
    }
  ]
}
```

- `messages` (`history.response.200.messages`; array<object>, required)
  - `type` (`history.response.200.messages.type`; string, required) — Role of the message.
    - one of `"human"`, `"ai"`, `"system"`, `"tool"`, `"custom"`
  - `content` (`history.response.200.messages.content`; string, required) — Content of the message.
  - `tool_calls` (`history.response.200.messages.tool_calls`; array<object>, optional) — Tool calls in the message.
    - default `[]`
    - `id` (`history.response.200.messages.tool_calls.id`; string, required)
    - `type` (`history.response.200.messages.tool_calls.type`; string, required)
    - `function` (`history.response.200.messages.tool_calls.function`; object, required) — Function call details (OpenAI chat completions format).
      - `name` (`history.response.200.messages.tool_calls.function.name`; string, required)
      - `arguments` (`history.response.200.messages.tool_calls.function.arguments`; string, required)
  - `tool_call_id` (`history.response.200.messages.tool_call_id`; any of, optional) — Tool call that this message is responding to.
    - any of: `string`, `null`
  - `run_id` (`history.response.200.messages.run_id`; any of, optional) — Run ID of the message.
    - any of: `string`, `null`
  - `response_metadata` (`history.response.200.messages.response_metadata`; object, optional) — Response metadata. For example: response headers, logprobs, token counts.
    - default `{}`
  - `custom_data` (`history.response.200.messages.custom_data`; object, optional) — Custom message data.
    - default `{}`
  - `metadata` (`history.response.200.messages.metadata`; any of, optional) — Up to 16 key-value pairs attached to the message. Keys max 64 chars, values max 512 chars.
    - any of: `map<string>`, `null`
  - `created_at` (`history.response.200.messages.created_at`; any of, optional) — UTC timestamp of when the message was first persisted to the thread, derived from the LangGraph checkpoint that first contained this message. Null for messages whose origin checkpoint is not available.
    - any of: `string`, `null`

### 422

Validation Error

#### Example

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
```

- `detail` (`history.response.422.detail`; array<object>, optional)
  - `loc` (`history.response.422.detail.loc`; array<any of>, required)
    - any of: `string`, `integer`
  - `msg` (`history.response.422.detail.msg`; string, required)
  - `type` (`history.response.422.detail.type`; string, required)
  - `input` (`history.response.422.detail.input`; unknown, optional)
  - `ctx` (`history.response.422.detail.ctx`; object, optional)


Source: https://truememory-docs.mvstg.com/api/history/create/index.md
