curl --request POST \
--url https://api.myustadia.com/api/v1/courses/{course_id}/assistant/{session_id}/turn \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_turn_id": "<string>",
"message": "",
"confirm": {
"question_id": "<string>",
"value": "<unknown>"
}
}
'import requests
url = "https://api.myustadia.com/api/v1/courses/{course_id}/assistant/{session_id}/turn"
payload = {
"client_turn_id": "<string>",
"message": "",
"confirm": {
"question_id": "<string>",
"value": "<unknown>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_turn_id: '<string>',
message: '',
confirm: {question_id: '<string>', value: '<unknown>'}
})
};
fetch('https://api.myustadia.com/api/v1/courses/{course_id}/assistant/{session_id}/turn', 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.myustadia.com/api/v1/courses/{course_id}/assistant/{session_id}/turn",
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([
'client_turn_id' => '<string>',
'message' => '',
'confirm' => [
'question_id' => '<string>',
'value' => '<unknown>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.myustadia.com/api/v1/courses/{course_id}/assistant/{session_id}/turn"
payload := strings.NewReader("{\n \"client_turn_id\": \"<string>\",\n \"message\": \"\",\n \"confirm\": {\n \"question_id\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.myustadia.com/api/v1/courses/{course_id}/assistant/{session_id}/turn")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_turn_id\": \"<string>\",\n \"message\": \"\",\n \"confirm\": {\n \"question_id\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.myustadia.com/api/v1/courses/{course_id}/assistant/{session_id}/turn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_turn_id\": \"<string>\",\n \"message\": \"\",\n \"confirm\": {\n \"question_id\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Course Assistant Turn
One assistant turn: send the client’s message, get the reply and the next question.
When the course’s uploaded documents have been digested, the response may
carry a suggestion object for the served question:
{question_id, theme, say, candidate, evidence, status}. candidate is the
full pre-validated value a confirm would record (every field shown, exactly
as stored); evidence quotes the client’s own documents. While the digest is
still building (or failed, or the course has no sources) the field is simply
omitted and the turn proceeds normally.
To accept a suggestion, send confirm: {question_id, value?} instead of a
message. The server validates and records it exactly like a typed answer
(source='text') with zero model calls; value overrides the stored
candidate when the client edited the surface. Errors: 400 confirm_not_current
(the id is not the question currently served), 400 confirm_no_candidate
(nothing stored to confirm and no value supplied). Confirm turns are
idempotent under client_turn_id like any other turn.
A message that exactly equals the served ENUM question’s option value
or any language’s label (whole message, case-insensitive) is recorded
deterministically with ZERO model calls. An empty message with no
confirm is 400 empty_message (checked before session lookup).
curl --request POST \
--url https://api.myustadia.com/api/v1/courses/{course_id}/assistant/{session_id}/turn \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_turn_id": "<string>",
"message": "",
"confirm": {
"question_id": "<string>",
"value": "<unknown>"
}
}
'import requests
url = "https://api.myustadia.com/api/v1/courses/{course_id}/assistant/{session_id}/turn"
payload = {
"client_turn_id": "<string>",
"message": "",
"confirm": {
"question_id": "<string>",
"value": "<unknown>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_turn_id: '<string>',
message: '',
confirm: {question_id: '<string>', value: '<unknown>'}
})
};
fetch('https://api.myustadia.com/api/v1/courses/{course_id}/assistant/{session_id}/turn', 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.myustadia.com/api/v1/courses/{course_id}/assistant/{session_id}/turn",
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([
'client_turn_id' => '<string>',
'message' => '',
'confirm' => [
'question_id' => '<string>',
'value' => '<unknown>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.myustadia.com/api/v1/courses/{course_id}/assistant/{session_id}/turn"
payload := strings.NewReader("{\n \"client_turn_id\": \"<string>\",\n \"message\": \"\",\n \"confirm\": {\n \"question_id\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.myustadia.com/api/v1/courses/{course_id}/assistant/{session_id}/turn")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_turn_id\": \"<string>\",\n \"message\": \"\",\n \"confirm\": {\n \"question_id\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.myustadia.com/api/v1/courses/{course_id}/assistant/{session_id}/turn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_turn_id\": \"<string>\",\n \"message\": \"\",\n \"confirm\": {\n \"question_id\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
1 - 1288000Explicit confirmation of the served question's document suggestion. A confirm turn makes zero model calls; the answer is validated and recorded by the server exactly as a typed answer would be (source='text').
Show child attributes
Show child attributes
Response
Successful Response