GET /v1/ai/workflow/chat/history
Get chat history for a conversation, workflow, or session
GET
/v1/ai/workflow/chat/history
Get chat history for a conversation, workflow, or session
Query Parameters
conversationId
string
optional
query
Conversation ID (stable; preferred, used by V3 chat)
workflowId
string
optional
query
Workflow ID (for edit page)
sessionId
string
optional
query
Session ID (for create page)
limit
integer
optional
query
Maximum number of messages to return (default: 20, max: 100)
before
string
optional
query
RFC3339 keyset cursor; return only messages strictly older than this createdAt (reverse pagination)
beforeId
string
optional
query
Keyset cursor tiebreak; the oldest loaded row's id, paired with before, so a tied createdAt at a page boundary is not skipped
Request Body
application/jsonResponses
200
OK
application/jsoncode
integer
data
object[]
Array of:
agentVersion
string
content
string
conversationId
string
createdAt
string
id
string
imageUrls
string[]
Array of:
linkedRunFinishedAt
string
linkedRunId
string
linkedRunStartedAt
string
linkedRunStatus
string
Enum:
running, waiting, success, partial, failure, cancelledorganizationId
string
role
string
senderUserId
string
sessionId
string
structuredPayload
integer[]
Array of:
tokensUsed
integer
turnId
string
workflowId
string
message
string
requestId
string
400
Bad Request
curl -X GET 'https://api.example.com/v1/ai/workflow/chat/history' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{}'
const response = await fetch('https://api.example.com/v1/ai/workflow/chat/history', { method: 'GET', headers: { "Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json" }, body: JSON.stringify({})});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.get('https://api.example.com/v1/ai/workflow/chat/history', headers=headers, json={})print(response.json())
package mainimport ( "fmt" "io" "net/http" "strings")func main() { body := strings.NewReader(`{}`) req, _ := http.NewRequest("GET", "https://api.example.com/v1/ai/workflow/chat/history", body) req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() result, _ := io.ReadAll(resp.Body) fmt.Println(string(result))}
200
Response
{ "code": 200, "data": [ { "agentVersion": "<string>", "content": "<string>", "conversationId": "<string>", "createdAt": "<string>", "id": "<string>", "imageUrls": [ "<string>" ], "linkedRunFinishedAt": "<string>", "linkedRunId": "<string>", "linkedRunStartedAt": "<string>", "linkedRunStatus": "running", "organizationId": "<string>", "role": "<string>", "senderUserId": "<string>", "sessionId": "<string>", "structuredPayload": [ 123 ], "tokensUsed": 123, "turnId": "<string>", "workflowId": "<string>" } ], "message": "success", "requestId": "<string>"}
API Playground
Try this endpoint
GET
/v1/ai/workflow/chat/history
