> This page is for Alfa (Preview).

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.alfa.boosted.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.alfa.boosted.ai/_mcp/server.

# Get Message History

GET https://sandbox.api.boosted.ai/v2/analytics/messages

Retrieves thread message analytics data as a streamed JSONL file. The response includes message history with input, output, and metadata for each message.

* If the start date is not provided, returns all messages on and before the end date (UTC 23:59:59).
* If the end date is not provided, returns all messages on and after the start date (UTC 00:00:00).
* If both dates are not provided, returns all messages.

The file is streamed as JSONL (JSON Lines) format with filename message\_history\_\{current\_timestamp}.jsonl

See the [message history](/alfa-preview/analytics/message-history) documentation for more details.

Reference: https://docs.alfa.boosted.ai/alfa-preview/analytics-api/reference/get-message-history-messages-get

## Authentication

- `Authorization` header (required) — Enter your JWT Token here in the format: Bearer \{token}, where the token is a Service Account Token

## Request

### Query parameters

- `start_date` (date, optional, nullable) — Start date (UTC 00:00:00 inclusive).
- `end_date` (date, optional, nullable) — End date (UTC 23:59:59 inclusive).

## Response

### 200

JSONL stream of message history. Each line is a JSON object with Input, Response, Message ID, Message Time, Thread ID, and User ID fields. Important: The 200 Response example displays sample JSON for a single line, but is not indicative of a valid JSONL file. A valid JSONL file contains multiple JSON objects separated by newlines.

- `list of V2AnalyticsMessagesGetResponsesContentApplicationXNdjsonSchemaItems`

## Errors

### 401 Unauthorized Error

Unauthenticated user.

- `detail` (string, required) — Error message describing what went wrong.

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### V2AnalyticsMessagesGetResponsesContentApplicationXNdjsonSchemaItems

- `Input` (string, required) — The user's input message.
- `Response` (string, required) — The assistant's response message.
- `Message ID` (string, required) — Unique identifier for the message.
- `Message Time` (string, required) — ISO 8601 timestamp of the message.
- `Thread ID` (string, required) — Unique identifier for the thread.
- `User ID` (string, required) — Unique identifier for the user.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItems

- string
- integer

## Examples

**Response**

```json
[
  {
    "Input": "string",
    "Response": "string",
    "Message ID": "uuid",
    "Message Time": "2026-01-01T00:00:00.000000+00:00",
    "Thread ID": "uuid",
    "User ID": "uuid"
  }
]
```

**SDK Code**

```python
import requests

url = "https://sandbox.api.boosted.ai/v2/analytics/messages"

headers = {"Authorization": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://sandbox.api.boosted.ai/v2/analytics/messages';
const options = {method: 'GET', headers: {Authorization: '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox.api.boosted.ai/v2/analytics/messages"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://sandbox.api.boosted.ai/v2/analytics/messages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://sandbox.api.boosted.ai/v2/analytics/messages")
  .header("Authorization", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://sandbox.api.boosted.ai/v2/analytics/messages', [
  'headers' => [
    'Authorization' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://sandbox.api.boosted.ai/v2/analytics/messages");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.api.boosted.ai/v2/analytics/messages")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```