Get Message History
curl --request GET \
--url https://api.example.com/api/v1/tasks/{id}/historyimport requests
url = "https://api.example.com/api/v1/tasks/{id}/history"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/tasks/{id}/history', 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://api.example.com/api/v1/tasks/{id}/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/api/v1/tasks/{id}/history"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/tasks/{id}/history")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/tasks/{id}/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyTask API
Get Message History
Get full conversation history for rendering a chat UI
GET
/
api
/
v1
/
tasks
/
{id}
/
history
Get Message History
curl --request GET \
--url https://api.example.com/api/v1/tasks/{id}/historyimport requests
url = "https://api.example.com/api/v1/tasks/{id}/history"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/tasks/{id}/history', 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://api.example.com/api/v1/tasks/{id}/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/api/v1/tasks/{id}/history"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/tasks/{id}/history")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/tasks/{id}/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyGet Task Message History
Retrieve the complete message history for a task. This endpoint is designed for developers who want to render their own chat UI and manage conversation history independently.Request
GET /api/v1/tasks/{id}/history
Authorization: Bearer {api_key}
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique task identifier |
Response
{
"success": true,
"data": {
"taskId": "c37c1d78-4d23-4e53-949a-ddd775f25e01",
"conversationId": "1769442659997-70avfyadp",
"status": "completed",
"messages": [
{
"id": "msg-1",
"role": "user",
"content": "Analyze this CSV file",
"createdAt": "2026-01-26T15:50:54.870Z",
"attachedFiles": [
{ "name": "data.csv", "path": "uploads/data.csv" }
]
},
{
"id": "msg-2",
"role": "assistant",
"content": "I analyzed the CSV file. Here are my findings...",
"createdAt": "2026-01-26T15:50:59.998Z",
"thoughts": [
{ "subject": "Analyzing", "description": "Reading the CSV structure..." }
],
"toolCalls": [
{
"callId": "tc-1",
"toolName": "read_file",
"status": "success",
"args": { "path": "uploads/data.csv" },
"output": "column1,column2\nvalue1,value2"
}
]
}
]
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
taskId | string | The task identifier |
conversationId | string | The conversation identifier |
status | string | Current task status |
messages | array | All messages in chronological order |
Message Object
| Field | Type | Description |
|---|---|---|
id | string | Unique message identifier |
role | string | user or assistant |
content | string | Message text content |
createdAt | string | ISO timestamp when message was created |
attachedFiles | array | undefined | Files attached to this message (user messages only) |
thoughts | array | undefined | Agent’s thinking/reasoning (assistant messages only) |
toolCalls | array | undefined | Tool executions (assistant messages only) |
For user messages with file uploads, the
content field contains only the user’s message text - the file upload prefix is stripped and the files are listed in attachedFiles instead.Attached File Object
| Field | Type | Description |
|---|---|---|
name | string | Original filename (e.g., “data.csv”) |
path | string | Path in workspace (e.g., “uploads/data.csv”) |
Thought Object
| Field | Type | Description |
|---|---|---|
subject | string | Brief subject of the thought |
description | string | Detailed reasoning |
Tool Call Object
| Field | Type | Description |
|---|---|---|
callId | string | Unique tool call identifier |
toolName | string | Name of the tool executed |
status | string | pending, executing, success, error, cancelled |
args | object | Arguments passed to the tool |
output | string | Tool output (when completed) |
description | string | Human-readable description of the action |
Examples
curl -s https://api.sigmic.ai/api/v1/tasks/c37c1d78-4d23-4e53-949a-ddd775f25e01/history \
-H "Authorization: Bearer sigmic_your_key_here"
const taskId = 'c37c1d78-4d23-4e53-949a-ddd775f25e01';
const response = await fetch(
`https://api.sigmic.ai/api/v1/tasks/${taskId}/history`,
{
headers: {
'Authorization': 'Bearer sigmic_your_key_here'
}
}
);
const { data } = await response.json();
// Render messages in your chat UI
data.messages.forEach(msg => {
if (msg.role === 'user') {
renderUserMessage(msg.content, msg.attachedFiles);
} else {
renderAssistantMessage(msg.content, msg.thoughts, msg.toolCalls);
}
});
import requests
task_id = 'c37c1d78-4d23-4e53-949a-ddd775f25e01'
response = requests.get(
f'https://api.sigmic.ai/api/v1/tasks/{task_id}/history',
headers={'Authorization': 'Bearer sigmic_your_key_here'}
)
data = response.json()['data']
# Process messages
for msg in data['messages']:
print(f"[{msg['role']}]: {msg['content']}")
if msg.get('attachedFiles'):
print(f" Files: {[f['name'] for f in msg['attachedFiles']]}")
if msg.get('toolCalls'):
for tc in msg['toolCalls']:
print(f" Tool: {tc['toolName']} -> {tc['status']}")
Use Cases
Building a Custom Chat UI
Use this endpoint to hydrate your chat interface with the full conversation history:async function loadChatHistory(taskId) {
const response = await fetch(`${API_BASE}/api/v1/tasks/${taskId}/history`, {
headers: { 'Authorization': `Bearer ${apiKey}` }
});
const { data } = await response.json();
return data.messages.map(msg => ({
id: msg.id,
sender: msg.role === 'user' ? 'You' : 'AI Assistant',
text: msg.content,
timestamp: new Date(msg.createdAt),
files: msg.attachedFiles || [],
thinking: msg.thoughts || [],
tools: msg.toolCalls || []
}));
}
Displaying File Attachments
function renderMessage(message) {
// Show attached files for user messages
if (message.attachedFiles?.length > 0) {
return (
<div>
<div className="files">
{message.attachedFiles.map(file => (
<span key={file.path}>📎 {file.name}</span>
))}
</div>
<p>{message.content}</p>
</div>
);
}
return <p>{message.content}</p>;
}
Displaying Tool Executions
function renderToolCalls(toolCalls) {
return toolCalls.map(tc => (
<div key={tc.callId} className={`tool-call ${tc.status}`}>
<span className="tool-name">{tc.toolName}</span>
<span className="status">{tc.status}</span>
{tc.output && <pre>{tc.output}</pre>}
</div>
));
}
Errors
| Code | Description |
|---|---|
AUTH_REQUIRED | No authentication provided |
INVALID_API_KEY | Invalid or expired API key |
NOT_FOUND | Task with the specified ID was not found |
NO_CONVERSATION | Task has no conversation history |