curl --request GET \ --url https://api.xpander.ai/v1/tasks/{task_id}/thread \ --header 'x-api-key: <api-key>'
Copy
Ask AI
[ { "role": "user", "content": "How do I reset my password?" }, { "role": "assistant", "content": "To reset your password, visit the login page and click 'Forgot Password'. You'll receive a reset link via email." }]
REST API - Tasks
Get Task Thread
Get task conversation thread with user and assistant messages
GET
/
v1
/
tasks
/
{task_id}
/
thread
Get Task'S Thread
Copy
Ask AI
curl --request GET \ --url https://api.xpander.ai/v1/tasks/{task_id}/thread \ --header 'x-api-key: <api-key>'
Copy
Ask AI
[ { "role": "user", "content": "How do I reset my password?" }, { "role": "assistant", "content": "To reset your password, visit the login page and click 'Forgot Password'. You'll receive a reset link via email." }]
Retrieve the conversation thread for a task as a simple array. Returns only the root task’s messages (user requests and agent responses), excluding tool calls and internal routing.
[ { "id": "<msg-id-1>", "role": "user", "content": "Hi, my name is David and I work at xpander.ai", "metrics": { "input_tokens": 0, "output_tokens": 0, "total_tokens": 0 }, "created_at": 1738945492 }, { "id": "<msg-id-2>", "role": "assistant", "content": "Hi David! Welcome. I'm here to help you with any questions or support needs. It's great to meet someone from the xpander.ai team!", "metrics": { "input_tokens": 247, "output_tokens": 2102, "total_tokens": 2349 }, "created_at": 1738945495 }, { "id": "<msg-id-3>", "role": "user", "content": "What is my name and where do I work?", "metrics": { "input_tokens": 0, "output_tokens": 0, "total_tokens": 0 }, "created_at": 1738945500 }, { "id": "<msg-id-4>", "role": "assistant", "content": "Your name is David and you work at xpander.ai.", "metrics": { "input_tokens": 165, "output_tokens": 2277, "total_tokens": 2442 }, "created_at": 1738945505 }]