cURL
curl --request GET \ --url https://api.xpander.ai/v1/tasks/{task_id}/thread \ --header 'x-api-key: <api-key>'
{ "detail": [ { "loc": [ "<string>" ], "msg": "<string>", "type": "<string>", "input": "<unknown>", "ctx": {} } ] }
Get task conversation thread with user and assistant messages
id
Show Message Object
user
assistant
curl -X GET -H "x-api-key: <your-api-key>" \ "https://api.xpander.ai/v1/tasks/<task-id>/thread"
[ { "id": "<task-id>_user_1", "role": "user", "content": "Reply with exactly FIRST", "created_at": 1774226722 }, { "id": "<task-id>_agent_1", "role": "assistant", "content": "FIRST", "created_at": 1774226726 }, { "id": "<task-id>_user_2", "role": "user", "content": "Reply with exactly SECOND", "created_at": 1774226726 }, { "id": "<task-id>_agent_2", "role": "assistant", "content": "SECOND", "created_at": 1774226730 } ]
curl -s -H "x-api-key: <your-api-key>" \ "https://api.xpander.ai/v1/tasks/<task-id>/thread" | \ jq '.[] | "\(.role): \(.content)"'
curl -s -H "x-api-key: <your-api-key>" \ "https://api.xpander.ai/v1/tasks/<task-id>/thread" | \ jq 'length'
curl -s -H "x-api-key: <your-api-key>" \ "https://api.xpander.ai/v1/tasks/<task-id>/thread" | \ jq '[.[] | select(.role == "assistant")][-1].content'
API Key for authentication
Successful Response
Was this page helpful?
Contact support