Forms
Read a form draft and metadata
Requires forms:read.
GET
/
api
/
v2
/
accounts
/
{accountId}
/
forms
/
{formId}
Read a form draft and metadata
curl --request GET \
--url https://app.huechat.ai/api/v2/accounts/{accountId}/forms/{formId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.huechat.ai/api/v2/accounts/{accountId}/forms/{formId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.huechat.ai/api/v2/accounts/{accountId}/forms/{formId}', 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/accounts/{accountId}/forms/{formId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.huechat.ai/api/v2/accounts/{accountId}/forms/{formId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.huechat.ai/api/v2/accounts/{accountId}/forms/{formId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.huechat.ai/api/v2/accounts/{accountId}/forms/{formId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"status": "draft",
"public_code": "<string>",
"public_url": "<string>",
"definition": {
"language": "en",
"questions": [
{
"id": "<string>",
"type": "welcome",
"title": "<string>",
"required": true,
"options": [
"<string>"
],
"rows": [
"<string>"
],
"columns": [
"<string>"
],
"min": 123,
"max": 123,
"score": {},
"description": "<string>",
"placeholder": "<string>",
"titleDelta": {
"ops": [
{
"insert": "<string>",
"attributes": {
"bold": true,
"italic": true,
"underline": true
}
}
]
},
"descriptionDelta": {
"ops": [
{
"insert": "<string>",
"attributes": {
"bold": true,
"italic": true,
"underline": true
}
}
]
},
"images": [
"<string>"
],
"mediaUrl": "<string>",
"mediaKind": "image",
"presentation": "text",
"randomize": true,
"currency": "<string>",
"amount": 5000000,
"redirectUrl": "<string>",
"notes": [
"<string>"
],
"schedule": {
"service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"ai": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_turns": 2,
"instructions": "<string>",
"knowledge": "<string>"
}
}
],
"branding": {
"name": "<string>",
"logo_url": "<string>",
"logo_alt": "<string>",
"show_logo": true,
"show_name": true
},
"cdp_mapping": [
{
"question_id": "<string>",
"target": "name",
"fill_policy": "fill_empty",
"subfield": "<string>",
"prefill_from_cdp": true
}
],
"advancedLogic": {
"allowedUrlParams": [
"<string>"
],
"variables": [
{
"name": "<string>",
"initial": 0
}
],
"startRules": [
{
"when": {
"mode": "all",
"conditions": [
{
"source": {
"kind": "answer",
"key": "<string>"
},
"operator": "equals",
"value": "<string>"
}
]
},
"destination": {
"kind": "next",
"questionId": "<string>"
}
}
],
"questionRules": [
{
"questionId": "<string>",
"hideWhen": {
"mode": "all",
"conditions": [
{
"source": {
"kind": "answer",
"key": "<string>"
},
"operator": "equals",
"value": "<string>"
}
]
},
"branches": [
{
"when": {
"mode": "all",
"conditions": [
{
"source": {
"kind": "answer",
"key": "<string>"
},
"operator": "equals",
"value": "<string>"
}
]
},
"destination": {
"kind": "next",
"questionId": "<string>"
}
}
],
"fallback": {
"kind": "next",
"questionId": "<string>"
},
"calculations": [
{
"operation": "set",
"target": "<string>",
"operand": {
"kind": "constant",
"value": "<string>"
},
"when": {
"mode": "all",
"conditions": [
{
"source": {
"kind": "answer",
"key": "<string>"
},
"operator": "equals",
"value": "<string>"
}
]
}
}
]
}
]
},
"logic": {},
"description": "<string>",
"domain": "<string>",
"mode": "universal",
"accent": "<string>",
"thankYou": "<string>",
"share": {
"expires_at": "2023-11-07T05:31:56Z",
"single_use": true,
"title": "<string>",
"description": "<string>",
"image_url": "<string>"
},
"controls": {
"responseCap": 0
},
"translations": {
"schemaVersion": 1,
"languages": {},
"updatedAt": "<string>"
},
"create_contacts": false
},
"published_version": 123,
"version": 123,
"share_mode": "public_link",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"responses": 1,
"completed": 1,
"views": 1,
"starts": 1,
"published_available": true
}{
"error": "<string>"
}{
"error": "<string>",
"code": "plan_disabled",
"feature": "forms"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Your personal access token where supported, or a scoped API key (hc_…) created inside HueChat at Account → Developer API. Send it as Authorization: Bearer <token>.
Response
Form metadata and editable definition
Available options:
draft, published, closed, archived Built by the server from trusted FRONTEND_URL, never a fixed tenant subdomain.
Owner editable definition, maximum serialized size 256 KiB. PublicDefinition strips notes and private AI configuration.
Show child attributes
Show child attributes
Available options:
public_link, invitation_only Required range:
x >= 0Required range:
x >= 0Required range:
x >= 0Required range:
x >= 0Server-derived availability of the immutable published definition at the time of this response, including its respondent expiry. False for unpublished or expired definitions.
⌘I
Read a form draft and metadata
curl --request GET \
--url https://app.huechat.ai/api/v2/accounts/{accountId}/forms/{formId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.huechat.ai/api/v2/accounts/{accountId}/forms/{formId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.huechat.ai/api/v2/accounts/{accountId}/forms/{formId}', 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/accounts/{accountId}/forms/{formId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.huechat.ai/api/v2/accounts/{accountId}/forms/{formId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.huechat.ai/api/v2/accounts/{accountId}/forms/{formId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.huechat.ai/api/v2/accounts/{accountId}/forms/{formId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"status": "draft",
"public_code": "<string>",
"public_url": "<string>",
"definition": {
"language": "en",
"questions": [
{
"id": "<string>",
"type": "welcome",
"title": "<string>",
"required": true,
"options": [
"<string>"
],
"rows": [
"<string>"
],
"columns": [
"<string>"
],
"min": 123,
"max": 123,
"score": {},
"description": "<string>",
"placeholder": "<string>",
"titleDelta": {
"ops": [
{
"insert": "<string>",
"attributes": {
"bold": true,
"italic": true,
"underline": true
}
}
]
},
"descriptionDelta": {
"ops": [
{
"insert": "<string>",
"attributes": {
"bold": true,
"italic": true,
"underline": true
}
}
]
},
"images": [
"<string>"
],
"mediaUrl": "<string>",
"mediaKind": "image",
"presentation": "text",
"randomize": true,
"currency": "<string>",
"amount": 5000000,
"redirectUrl": "<string>",
"notes": [
"<string>"
],
"schedule": {
"service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"ai": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_turns": 2,
"instructions": "<string>",
"knowledge": "<string>"
}
}
],
"branding": {
"name": "<string>",
"logo_url": "<string>",
"logo_alt": "<string>",
"show_logo": true,
"show_name": true
},
"cdp_mapping": [
{
"question_id": "<string>",
"target": "name",
"fill_policy": "fill_empty",
"subfield": "<string>",
"prefill_from_cdp": true
}
],
"advancedLogic": {
"allowedUrlParams": [
"<string>"
],
"variables": [
{
"name": "<string>",
"initial": 0
}
],
"startRules": [
{
"when": {
"mode": "all",
"conditions": [
{
"source": {
"kind": "answer",
"key": "<string>"
},
"operator": "equals",
"value": "<string>"
}
]
},
"destination": {
"kind": "next",
"questionId": "<string>"
}
}
],
"questionRules": [
{
"questionId": "<string>",
"hideWhen": {
"mode": "all",
"conditions": [
{
"source": {
"kind": "answer",
"key": "<string>"
},
"operator": "equals",
"value": "<string>"
}
]
},
"branches": [
{
"when": {
"mode": "all",
"conditions": [
{
"source": {
"kind": "answer",
"key": "<string>"
},
"operator": "equals",
"value": "<string>"
}
]
},
"destination": {
"kind": "next",
"questionId": "<string>"
}
}
],
"fallback": {
"kind": "next",
"questionId": "<string>"
},
"calculations": [
{
"operation": "set",
"target": "<string>",
"operand": {
"kind": "constant",
"value": "<string>"
},
"when": {
"mode": "all",
"conditions": [
{
"source": {
"kind": "answer",
"key": "<string>"
},
"operator": "equals",
"value": "<string>"
}
]
}
}
]
}
]
},
"logic": {},
"description": "<string>",
"domain": "<string>",
"mode": "universal",
"accent": "<string>",
"thankYou": "<string>",
"share": {
"expires_at": "2023-11-07T05:31:56Z",
"single_use": true,
"title": "<string>",
"description": "<string>",
"image_url": "<string>"
},
"controls": {
"responseCap": 0
},
"translations": {
"schemaVersion": 1,
"languages": {},
"updatedAt": "<string>"
},
"create_contacts": false
},
"published_version": 123,
"version": 123,
"share_mode": "public_link",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"responses": 1,
"completed": 1,
"views": 1,
"starts": 1,
"published_available": true
}{
"error": "<string>"
}{
"error": "<string>",
"code": "plan_disabled",
"feature": "forms"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}
