Submit Question Answers (Stream)
curl --request POST \
--url https://api.xpander.ai/v1/agents/{agent_id}/conversations/{conversation_id}/answers \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"decision_id": "d-1a2b3c",
"answers": [
{
"question_id": "q1",
"selected_option_ids": [
"weekly"
]
},
{
"question_id": "q2",
"free_text": "Mondays at 9:00"
}
]
}
'import requests
url = "https://api.xpander.ai/v1/agents/{agent_id}/conversations/{conversation_id}/answers"
payload = {
"decision_id": "d-1a2b3c",
"answers": [
{
"question_id": "q1",
"selected_option_ids": ["weekly"]
},
{
"question_id": "q2",
"free_text": "Mondays at 9:00"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
decision_id: 'd-1a2b3c',
answers: [
{question_id: 'q1', selected_option_ids: ['weekly']},
{question_id: 'q2', free_text: 'Mondays at 9:00'}
]
})
};
fetch('https://api.xpander.ai/v1/agents/{agent_id}/conversations/{conversation_id}/answers', 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.xpander.ai/v1/agents/{agent_id}/conversations/{conversation_id}/answers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'decision_id' => 'd-1a2b3c',
'answers' => [
[
'question_id' => 'q1',
'selected_option_ids' => [
'weekly'
]
],
[
'question_id' => 'q2',
'free_text' => 'Mondays at 9:00'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.xpander.ai/v1/agents/{agent_id}/conversations/{conversation_id}/answers"
payload := strings.NewReader("{\n \"decision_id\": \"d-1a2b3c\",\n \"answers\": [\n {\n \"question_id\": \"q1\",\n \"selected_option_ids\": [\n \"weekly\"\n ]\n },\n {\n \"question_id\": \"q2\",\n \"free_text\": \"Mondays at 9:00\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.xpander.ai/v1/agents/{agent_id}/conversations/{conversation_id}/answers")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"decision_id\": \"d-1a2b3c\",\n \"answers\": [\n {\n \"question_id\": \"q1\",\n \"selected_option_ids\": [\n \"weekly\"\n ]\n },\n {\n \"question_id\": \"q2\",\n \"free_text\": \"Mondays at 9:00\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xpander.ai/v1/agents/{agent_id}/conversations/{conversation_id}/answers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"decision_id\": \"d-1a2b3c\",\n \"answers\": [\n {\n \"question_id\": \"q1\",\n \"selected_option_ids\": [\n \"weekly\"\n ]\n },\n {\n \"question_id\": \"q2\",\n \"free_text\": \"Mondays at 9:00\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "f0f0f0f0-1111-2222-3333-444444444444",
"agent_id": "a1a1a1a1-b2b2-c3c3-d4d4-e5e5e5e5e5e5",
"organization_id": "0a0a0a0a-1b1b-2c2c-3d3d-4e4e4e4e4e4e",
"status": "completed",
"input": {
"text": "Summarize today's signups.",
"user": {
"id": "user-123",
"email": "you@example.com"
}
},
"result": "42 new signups today, up 12% week over week.",
"created_at": "2026-07-28T20:59:02.915959Z",
"finished_at": "2026-07-28T20:59:51.661537Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}REST API - Conversations
Submit Question Answers
Answer a question card and continue the turn (SSE).
POST
/
v1
/
agents
/
{agent_id}
/
conversations
/
{conversation_id}
/
answers
Submit Question Answers (Stream)
curl --request POST \
--url https://api.xpander.ai/v1/agents/{agent_id}/conversations/{conversation_id}/answers \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"decision_id": "d-1a2b3c",
"answers": [
{
"question_id": "q1",
"selected_option_ids": [
"weekly"
]
},
{
"question_id": "q2",
"free_text": "Mondays at 9:00"
}
]
}
'import requests
url = "https://api.xpander.ai/v1/agents/{agent_id}/conversations/{conversation_id}/answers"
payload = {
"decision_id": "d-1a2b3c",
"answers": [
{
"question_id": "q1",
"selected_option_ids": ["weekly"]
},
{
"question_id": "q2",
"free_text": "Mondays at 9:00"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
decision_id: 'd-1a2b3c',
answers: [
{question_id: 'q1', selected_option_ids: ['weekly']},
{question_id: 'q2', free_text: 'Mondays at 9:00'}
]
})
};
fetch('https://api.xpander.ai/v1/agents/{agent_id}/conversations/{conversation_id}/answers', 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.xpander.ai/v1/agents/{agent_id}/conversations/{conversation_id}/answers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'decision_id' => 'd-1a2b3c',
'answers' => [
[
'question_id' => 'q1',
'selected_option_ids' => [
'weekly'
]
],
[
'question_id' => 'q2',
'free_text' => 'Mondays at 9:00'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.xpander.ai/v1/agents/{agent_id}/conversations/{conversation_id}/answers"
payload := strings.NewReader("{\n \"decision_id\": \"d-1a2b3c\",\n \"answers\": [\n {\n \"question_id\": \"q1\",\n \"selected_option_ids\": [\n \"weekly\"\n ]\n },\n {\n \"question_id\": \"q2\",\n \"free_text\": \"Mondays at 9:00\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.xpander.ai/v1/agents/{agent_id}/conversations/{conversation_id}/answers")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"decision_id\": \"d-1a2b3c\",\n \"answers\": [\n {\n \"question_id\": \"q1\",\n \"selected_option_ids\": [\n \"weekly\"\n ]\n },\n {\n \"question_id\": \"q2\",\n \"free_text\": \"Mondays at 9:00\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xpander.ai/v1/agents/{agent_id}/conversations/{conversation_id}/answers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"decision_id\": \"d-1a2b3c\",\n \"answers\": [\n {\n \"question_id\": \"q1\",\n \"selected_option_ids\": [\n \"weekly\"\n ]\n },\n {\n \"question_id\": \"q2\",\n \"free_text\": \"Mondays at 9:00\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "f0f0f0f0-1111-2222-3333-444444444444",
"agent_id": "a1a1a1a1-b2b2-c3c3-d4d4-e5e5e5e5e5e5",
"organization_id": "0a0a0a0a-1b1b-2c2c-3d3d-4e4e4e4e4e4e",
"status": "completed",
"input": {
"text": "Summarize today's signups.",
"user": {
"id": "user-123",
"email": "you@example.com"
}
},
"result": "42 new signups today, up 12% week over week.",
"created_at": "2026-07-28T20:59:02.915959Z",
"finished_at": "2026-07-28T20:59:51.661537Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}When a turn raises a question card, submit the structured answers here to resume it. Answers are validated against the asked questions; a mismatch returns
400 before any run. Streams the continued turn’s events over SSE.
See the Conversations overview for the full conversation model.Body
application/json
Response
Successful Response
Was this page helpful?

