Get Message History
Task API
Get Message History
Get full conversation history for rendering a chat UI
GET
Get Message History
Get 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
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique task identifier |
Response
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
Use Cases
Building a Custom Chat UI
Use this endpoint to hydrate your chat interface with the full conversation history:Displaying File Attachments
Displaying Tool Executions
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 |