Save partial or completed answers
Signed-session, immutable-version answer validation with stable 12–128 byte idempotency_key. Same completed key/body/session retries replay; changed completed requests conflict. Single-use invitations serialize consumption. Profile consent applies only explicit mappings; anonymous matching phone/email cannot claim an existing contact. New consented lead creation leaves identity_verified false.
curl --request POST \
--url https://app.huechat.ai/api/v2/forms/{publicCode}/responses \
--header 'Content-Type: application/json' \
--data '
{
"session_id": "signed-session",
"invite": "opaque-token",
"idempotency_key": "2b17a03d-respondent-visit-1",
"status": "completed",
"device": "mobile",
"profile_consent": true,
"answers": {
"csat": 5,
"name": "Mona"
}
}
'import requests
url = "https://app.huechat.ai/api/v2/forms/{publicCode}/responses"
payload = {
"session_id": "signed-session",
"invite": "opaque-token",
"idempotency_key": "2b17a03d-respondent-visit-1",
"status": "completed",
"device": "mobile",
"profile_consent": True,
"answers": {
"csat": 5,
"name": "Mona"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
session_id: 'signed-session',
invite: 'opaque-token',
idempotency_key: '2b17a03d-respondent-visit-1',
status: 'completed',
device: 'mobile',
profile_consent: true,
answers: {csat: 5, name: 'Mona'}
})
};
fetch('https://app.huechat.ai/api/v2/forms/{publicCode}/responses', 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://app.huechat.ai/api/v2/forms/{publicCode}/responses",
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([
'session_id' => 'signed-session',
'invite' => 'opaque-token',
'idempotency_key' => '2b17a03d-respondent-visit-1',
'status' => 'completed',
'device' => 'mobile',
'profile_consent' => true,
'answers' => [
'csat' => 5,
'name' => 'Mona'
]
]),
CURLOPT_HTTPHEADER => [
"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://app.huechat.ai/api/v2/forms/{publicCode}/responses"
payload := strings.NewReader("{\n \"session_id\": \"signed-session\",\n \"invite\": \"opaque-token\",\n \"idempotency_key\": \"2b17a03d-respondent-visit-1\",\n \"status\": \"completed\",\n \"device\": \"mobile\",\n \"profile_consent\": true,\n \"answers\": {\n \"csat\": 5,\n \"name\": \"Mona\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://app.huechat.ai/api/v2/forms/{publicCode}/responses")
.header("Content-Type", "application/json")
.body("{\n \"session_id\": \"signed-session\",\n \"invite\": \"opaque-token\",\n \"idempotency_key\": \"2b17a03d-respondent-visit-1\",\n \"status\": \"completed\",\n \"device\": \"mobile\",\n \"profile_consent\": true,\n \"answers\": {\n \"csat\": 5,\n \"name\": \"Mona\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.huechat.ai/api/v2/forms/{publicCode}/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"session_id\": \"signed-session\",\n \"invite\": \"opaque-token\",\n \"idempotency_key\": \"2b17a03d-respondent-visit-1\",\n \"status\": \"completed\",\n \"device\": \"mobile\",\n \"profile_consent\": true,\n \"answers\": {\n \"csat\": 5,\n \"name\": \"Mona\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "partial",
"completed": true,
"score": 123
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Path Parameters
8 - 24Body
12 - 128Question ID to canonical answer. Ranking: ordered options; matrix: row to column; signature: typed name. Files/video_audio use AssetReceipt; scheduler uses BookingReceipt; AI uses AIAnswer, all unchanged from native endpoints. Server proves ownership and recomputes logic/score.
partial, completed desktop, mobile, tablet, other Separate consent to apply mapped fill_empty changes or, when enabled, create a new unverified lead.
curl --request POST \
--url https://app.huechat.ai/api/v2/forms/{publicCode}/responses \
--header 'Content-Type: application/json' \
--data '
{
"session_id": "signed-session",
"invite": "opaque-token",
"idempotency_key": "2b17a03d-respondent-visit-1",
"status": "completed",
"device": "mobile",
"profile_consent": true,
"answers": {
"csat": 5,
"name": "Mona"
}
}
'import requests
url = "https://app.huechat.ai/api/v2/forms/{publicCode}/responses"
payload = {
"session_id": "signed-session",
"invite": "opaque-token",
"idempotency_key": "2b17a03d-respondent-visit-1",
"status": "completed",
"device": "mobile",
"profile_consent": True,
"answers": {
"csat": 5,
"name": "Mona"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
session_id: 'signed-session',
invite: 'opaque-token',
idempotency_key: '2b17a03d-respondent-visit-1',
status: 'completed',
device: 'mobile',
profile_consent: true,
answers: {csat: 5, name: 'Mona'}
})
};
fetch('https://app.huechat.ai/api/v2/forms/{publicCode}/responses', 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://app.huechat.ai/api/v2/forms/{publicCode}/responses",
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([
'session_id' => 'signed-session',
'invite' => 'opaque-token',
'idempotency_key' => '2b17a03d-respondent-visit-1',
'status' => 'completed',
'device' => 'mobile',
'profile_consent' => true,
'answers' => [
'csat' => 5,
'name' => 'Mona'
]
]),
CURLOPT_HTTPHEADER => [
"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://app.huechat.ai/api/v2/forms/{publicCode}/responses"
payload := strings.NewReader("{\n \"session_id\": \"signed-session\",\n \"invite\": \"opaque-token\",\n \"idempotency_key\": \"2b17a03d-respondent-visit-1\",\n \"status\": \"completed\",\n \"device\": \"mobile\",\n \"profile_consent\": true,\n \"answers\": {\n \"csat\": 5,\n \"name\": \"Mona\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://app.huechat.ai/api/v2/forms/{publicCode}/responses")
.header("Content-Type", "application/json")
.body("{\n \"session_id\": \"signed-session\",\n \"invite\": \"opaque-token\",\n \"idempotency_key\": \"2b17a03d-respondent-visit-1\",\n \"status\": \"completed\",\n \"device\": \"mobile\",\n \"profile_consent\": true,\n \"answers\": {\n \"csat\": 5,\n \"name\": \"Mona\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.huechat.ai/api/v2/forms/{publicCode}/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"session_id\": \"signed-session\",\n \"invite\": \"opaque-token\",\n \"idempotency_key\": \"2b17a03d-respondent-visit-1\",\n \"status\": \"completed\",\n \"device\": \"mobile\",\n \"profile_consent\": true,\n \"answers\": {\n \"csat\": 5,\n \"name\": \"Mona\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "partial",
"completed": true,
"score": 123
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}
