v1-platform
Participant Voice Turn
Participant Voice Turn
curl --request POST \
--url https://api.example.com/v1/participant/voice-turn \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"client_event_id": "<string>",
"metadata": {},
"occurred_at": "2023-11-07T05:31:56Z",
"answer": {},
"elapsed_ms": 43200000,
"previous_answer": {},
"question_id": "<string>"
}
'import requests
url = "https://api.example.com/v1/participant/voice-turn"
payload = {
"client_event_id": "<string>",
"metadata": {},
"occurred_at": "2023-11-07T05:31:56Z",
"answer": {},
"elapsed_ms": 43200000,
"previous_answer": {},
"question_id": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
client_event_id: '<string>',
metadata: {},
occurred_at: '2023-11-07T05:31:56Z',
answer: {},
elapsed_ms: 43200000,
previous_answer: {},
question_id: '<string>'
})
};
fetch('https://api.example.com/v1/participant/voice-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.example.com/v1/participant/voice-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_event_id' => '<string>',
'metadata' => [
],
'occurred_at' => '2023-11-07T05:31:56Z',
'answer' => [
],
'elapsed_ms' => 43200000,
'previous_answer' => [
],
'question_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.example.com/v1/participant/voice-turn"
payload := strings.NewReader("{\n \"client_event_id\": \"<string>\",\n \"metadata\": {},\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"answer\": {},\n \"elapsed_ms\": 43200000,\n \"previous_answer\": {},\n \"question_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.example.com/v1/participant/voice-turn")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_event_id\": \"<string>\",\n \"metadata\": {},\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"answer\": {},\n \"elapsed_ms\": 43200000,\n \"previous_answer\": {},\n \"question_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/participant/voice-turn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_event_id\": \"<string>\",\n \"metadata\": {},\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"answer\": {},\n \"elapsed_ms\": 43200000,\n \"previous_answer\": {},\n \"question_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"next": {
"complete": true,
"progress": 0.5,
"trace": {
"mandatory": true,
"policy_version": "<string>",
"selected_question_id": "<string>",
"stop_reason": "mandatory_guardrail"
},
"question": {
"id": "<string>",
"input": "single_select",
"options": [
{
"id": "<string>",
"label": "<string>"
}
],
"prompt": "<string>",
"required": false
},
"why": "<string>"
},
"receipt": {
"accepted": true,
"client_event_id": "<string>",
"idempotent_replay": true
}
}{
"detail": {
"code": "<string>",
"message": "<string>",
"context": {},
"request_id": "<string>"
}
}{
"detail": {
"code": "<string>",
"message": "<string>",
"context": {},
"request_id": "<string>"
}
}{
"detail": {
"code": "<string>",
"message": "<string>",
"context": {},
"request_id": "<string>"
}
}{
"detail": {
"code": "<string>",
"message": "<string>",
"context": {},
"request_id": "<string>"
}
}{
"detail": {
"code": "<string>",
"message": "<string>",
"context": {},
"request_id": "<string>"
}
}{
"detail": {
"code": "<string>",
"message": "<string>",
"context": {},
"request_id": "<string>"
}
}Authorizations
Short-lived token bound to one participant session.
Headers
Required string length:
1 - 255Body
application/json
Exactly one server-pinned response from the realtime interviewer.
Required string length:
1 - 255Exactly input_channel=realtime_voice_interviewer; skipped turns also require response_state=unknown.
Available options:
answered, declined, skipped Required range:
0 <= x <= 86400000Required string length:
1 - 255⌘I
Participant Voice Turn
curl --request POST \
--url https://api.example.com/v1/participant/voice-turn \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"client_event_id": "<string>",
"metadata": {},
"occurred_at": "2023-11-07T05:31:56Z",
"answer": {},
"elapsed_ms": 43200000,
"previous_answer": {},
"question_id": "<string>"
}
'import requests
url = "https://api.example.com/v1/participant/voice-turn"
payload = {
"client_event_id": "<string>",
"metadata": {},
"occurred_at": "2023-11-07T05:31:56Z",
"answer": {},
"elapsed_ms": 43200000,
"previous_answer": {},
"question_id": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
client_event_id: '<string>',
metadata: {},
occurred_at: '2023-11-07T05:31:56Z',
answer: {},
elapsed_ms: 43200000,
previous_answer: {},
question_id: '<string>'
})
};
fetch('https://api.example.com/v1/participant/voice-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.example.com/v1/participant/voice-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_event_id' => '<string>',
'metadata' => [
],
'occurred_at' => '2023-11-07T05:31:56Z',
'answer' => [
],
'elapsed_ms' => 43200000,
'previous_answer' => [
],
'question_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.example.com/v1/participant/voice-turn"
payload := strings.NewReader("{\n \"client_event_id\": \"<string>\",\n \"metadata\": {},\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"answer\": {},\n \"elapsed_ms\": 43200000,\n \"previous_answer\": {},\n \"question_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.example.com/v1/participant/voice-turn")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_event_id\": \"<string>\",\n \"metadata\": {},\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"answer\": {},\n \"elapsed_ms\": 43200000,\n \"previous_answer\": {},\n \"question_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/participant/voice-turn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_event_id\": \"<string>\",\n \"metadata\": {},\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"answer\": {},\n \"elapsed_ms\": 43200000,\n \"previous_answer\": {},\n \"question_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"next": {
"complete": true,
"progress": 0.5,
"trace": {
"mandatory": true,
"policy_version": "<string>",
"selected_question_id": "<string>",
"stop_reason": "mandatory_guardrail"
},
"question": {
"id": "<string>",
"input": "single_select",
"options": [
{
"id": "<string>",
"label": "<string>"
}
],
"prompt": "<string>",
"required": false
},
"why": "<string>"
},
"receipt": {
"accepted": true,
"client_event_id": "<string>",
"idempotent_replay": true
}
}{
"detail": {
"code": "<string>",
"message": "<string>",
"context": {},
"request_id": "<string>"
}
}{
"detail": {
"code": "<string>",
"message": "<string>",
"context": {},
"request_id": "<string>"
}
}{
"detail": {
"code": "<string>",
"message": "<string>",
"context": {},
"request_id": "<string>"
}
}{
"detail": {
"code": "<string>",
"message": "<string>",
"context": {},
"request_id": "<string>"
}
}{
"detail": {
"code": "<string>",
"message": "<string>",
"context": {},
"request_id": "<string>"
}
}{
"detail": {
"code": "<string>",
"message": "<string>",
"context": {},
"request_id": "<string>"
}
}