Submit Question Answers (Stream)
curl --request POST \
--url https://api.xpander.ai/v1/agents/{agent_id}/gateway/conversations/{conversation_id}/answers \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"decision_id": "<string>",
"answers": [
{
"question_id": "<string>",
"selected_option_ids": [
"<string>"
],
"free_text": "<string>"
}
],
"user": {}
}
'import requests
url = "https://api.xpander.ai/v1/agents/{agent_id}/gateway/conversations/{conversation_id}/answers"
payload = {
"decision_id": "<string>",
"answers": [
{
"question_id": "<string>",
"selected_option_ids": ["<string>"],
"free_text": "<string>"
}
],
"user": {}
}
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: '<string>',
answers: [
{
question_id: '<string>',
selected_option_ids: ['<string>'],
free_text: '<string>'
}
],
user: {}
})
};
fetch('https://api.xpander.ai/v1/agents/{agent_id}/gateway/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}/gateway/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' => '<string>',
'answers' => [
[
'question_id' => '<string>',
'selected_option_ids' => [
'<string>'
],
'free_text' => '<string>'
]
],
'user' => [
]
]),
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}/gateway/conversations/{conversation_id}/answers"
payload := strings.NewReader("{\n \"decision_id\": \"<string>\",\n \"answers\": [\n {\n \"question_id\": \"<string>\",\n \"selected_option_ids\": [\n \"<string>\"\n ],\n \"free_text\": \"<string>\"\n }\n ],\n \"user\": {}\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}/gateway/conversations/{conversation_id}/answers")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"decision_id\": \"<string>\",\n \"answers\": [\n {\n \"question_id\": \"<string>\",\n \"selected_option_ids\": [\n \"<string>\"\n ],\n \"free_text\": \"<string>\"\n }\n ],\n \"user\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xpander.ai/v1/agents/{agent_id}/gateway/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\": \"<string>\",\n \"answers\": [\n {\n \"question_id\": \"<string>\",\n \"selected_option_ids\": [\n \"<string>\"\n ],\n \"free_text\": \"<string>\"\n }\n ],\n \"user\": {}\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Resume & edit
Submit Question Answers
Answer a prior ask_user_questions card and resume the turn (SSE).
POST
/
v1
/
agents
/
{agent_id}
/
gateway
/
conversations
/
{conversation_id}
/
answers
Submit Question Answers (Stream)
curl --request POST \
--url https://api.xpander.ai/v1/agents/{agent_id}/gateway/conversations/{conversation_id}/answers \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"decision_id": "<string>",
"answers": [
{
"question_id": "<string>",
"selected_option_ids": [
"<string>"
],
"free_text": "<string>"
}
],
"user": {}
}
'import requests
url = "https://api.xpander.ai/v1/agents/{agent_id}/gateway/conversations/{conversation_id}/answers"
payload = {
"decision_id": "<string>",
"answers": [
{
"question_id": "<string>",
"selected_option_ids": ["<string>"],
"free_text": "<string>"
}
],
"user": {}
}
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: '<string>',
answers: [
{
question_id: '<string>',
selected_option_ids: ['<string>'],
free_text: '<string>'
}
],
user: {}
})
};
fetch('https://api.xpander.ai/v1/agents/{agent_id}/gateway/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}/gateway/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' => '<string>',
'answers' => [
[
'question_id' => '<string>',
'selected_option_ids' => [
'<string>'
],
'free_text' => '<string>'
]
],
'user' => [
]
]),
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}/gateway/conversations/{conversation_id}/answers"
payload := strings.NewReader("{\n \"decision_id\": \"<string>\",\n \"answers\": [\n {\n \"question_id\": \"<string>\",\n \"selected_option_ids\": [\n \"<string>\"\n ],\n \"free_text\": \"<string>\"\n }\n ],\n \"user\": {}\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}/gateway/conversations/{conversation_id}/answers")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"decision_id\": \"<string>\",\n \"answers\": [\n {\n \"question_id\": \"<string>\",\n \"selected_option_ids\": [\n \"<string>\"\n ],\n \"free_text\": \"<string>\"\n }\n ],\n \"user\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xpander.ai/v1/agents/{agent_id}/gateway/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\": \"<string>\",\n \"answers\": [\n {\n \"question_id\": \"<string>\",\n \"selected_option_ids\": [\n \"<string>\"\n ],\n \"free_text\": \"<string>\"\n }\n ],\n \"user\": {}\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}When a turn pauses with an
ask_user_questions card, submit the structured answers here to resume. Answers are validated against the asked questions; a mismatch returns 400 before any run. Streams the resumed turn’s events over SSE.
See the Agent Gateway overview for the full conversation model.Authorizations
API Key for authentication
Query Parameters
Agent version to run.
Body
application/json
Response
Successful Response
Was this page helpful?
⌘I

