Get Chat History
curl --request GET \
--url https://app.splox.io/api/v1/chat-history/{chatId}/paginated \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.splox.io/api/v1/chat-history/{chatId}/paginated"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.splox.io/api/v1/chat-history/{chatId}/paginated', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.splox.io/api/v1/chat-history/{chatId}/paginated",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.splox.io/api/v1/chat-history/{chatId}/paginated"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.splox.io/api/v1/chat-history/{chatId}/paginated")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.splox.io/api/v1/chat-history/{chatId}/paginated")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "user",
"content": [
{
"type": "text",
"text": "<string>",
"toolCallId": "<string>",
"toolName": "<string>",
"args": {},
"result": "<unknown>",
"reasoning": "<string>"
}
],
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": {
"type": "<string>",
"reason": "<string>"
},
"metadata": {},
"files": [
{
"url": "<string>",
"content_type": "<string>",
"file_name": "<string>",
"file_size": 123,
"metadata": {}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]Chats
Get Chat History
Retrieves paginated chat message history. Returns a bare JSON array of messages, newest first.
GET
/
chat-history
/
{chatId}
/
paginated
Get Chat History
curl --request GET \
--url https://app.splox.io/api/v1/chat-history/{chatId}/paginated \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.splox.io/api/v1/chat-history/{chatId}/paginated"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.splox.io/api/v1/chat-history/{chatId}/paginated', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.splox.io/api/v1/chat-history/{chatId}/paginated",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.splox.io/api/v1/chat-history/{chatId}/paginated"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.splox.io/api/v1/chat-history/{chatId}/paginated")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.splox.io/api/v1/chat-history/{chatId}/paginated")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "user",
"content": [
{
"type": "text",
"text": "<string>",
"toolCallId": "<string>",
"toolName": "<string>",
"args": {},
"result": "<unknown>",
"reasoning": "<string>"
}
],
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": {
"type": "<string>",
"reason": "<string>"
},
"metadata": {},
"files": [
{
"url": "<string>",
"content_type": "<string>",
"file_name": "<string>",
"file_size": 123,
"metadata": {}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]Retrieves paginated chat message history for a chat session. Messages are returned newest-first.
Usage
curl "https://app.splox.io/api/v1/chat-history/0199f200-a11b-7c8d-4444-888890abcdef/paginated?limit=20" \
-H "Authorization: Bearer YOUR_TOKEN"
from splox import SploxClient
client = SploxClient(api_key="YOUR_API_KEY")
result = client.chats.get_history("CHAT_ID", limit=20)
for msg in result.messages:
text = msg.content[0].text if msg.content else ""
print(f"[{msg.role}] {text}")
# Paginate backward
if result.has_more:
oldest = result.messages[-1].created_at
older = client.chats.get_history("CHAT_ID", limit=20, before=oldest)
import Splox from "splox";
const client = new Splox("YOUR_API_KEY");
const result = await client.chats.getHistory("CHAT_ID", { limit: 20 });
for (const msg of result.messages) {
const text = msg.content?.[0]?.text ?? "";
console.log(`[${msg.role}] ${text}`);
}
// Paginate backward
if (result.has_more) {
const oldest = result.messages.at(-1)!.created_at!;
const older = await client.chats.getHistory("CHAT_ID", { limit: 20, before: oldest });
}
client := splox.NewClient("YOUR_API_KEY")
result, err := client.Chats.GetHistory(ctx, "CHAT_ID", &splox.ChatHistoryParams{
Limit: 20,
})
for _, msg := range result.Messages {
text := ""
if len(msg.Content) > 0 {
text = msg.Content[0].Text
}
fmt.Printf("[%s] %s\n", msg.Role, text)
}
Path Parameters
| Parameter | Type | Description |
|---|---|---|
chatId | string (uuid) | Chat ID |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 50 | Messages per page (1–200) |
before | string (RFC3339) | — | Timestamp cursor for backward pagination. Omit to get the latest messages. |
Response
Returns a bare JSON array of message objects:[
{
"id": "019c3221-29dc-7735-a4e3-b42ebb1a0cf1",
"chat_id": "0199f200-a11b-7c8d-4444-888890abcdef",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello! How can I help you today?"
}
],
"files": [],
"created_at": "2025-10-22T10:01:00Z",
"updated_at": "2025-10-22T10:01:00Z"
},
{
"id": "019c3221-29dc-7735-a4e3-b42ebb1a0cf2",
"chat_id": "0199f200-a11b-7c8d-4444-888890abcdef",
"role": "user",
"content": [
{
"type": "text",
"text": "Summarize the latest report"
}
],
"created_at": "2025-10-22T10:00:00Z",
"updated_at": "2025-10-22T10:00:00Z"
}
]
Message Roles
| Role | Description |
|---|---|
user | Message from the user |
assistant | Response from the AI agent |
system | System-level message |
tool | Tool execution result |
Content Types
| Type | Description |
|---|---|
text | Plain text content |
tool-call | A tool invocation with toolName and args |
tool-result | Result from a tool execution |
source | Source reference with url and title |
Pagination
Use thecreated_at timestamp of the oldest message in the current page as the before cursor for the next page:
# First page (latest messages)
curl ".../chat-history/{chatId}/paginated?limit=20"
# Next page (older messages)
curl ".../chat-history/{chatId}/paginated?limit=20&before=2025-10-22T10:00:00Z"
Notes
Authentication required. The authenticated user must own the chat session.
Authorizations
API token generated from your Splox account settings. Create tokens at https://app.splox.io/account?tab=settings
Path Parameters
Chat ID
Query Parameters
Messages per page (default: 50, max: 200)
Required range:
x <= 200RFC3339 timestamp cursor for backward pagination. Omit to get latest messages.
Response
200 - application/json
Chat messages retrieved successfully (bare JSON array)
Available options:
user, assistant, system, tool Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I

