Embed Widgets
Create Iframe Widget
Create a new embeddable chat widget configuration linked to an API key.
POST
/
api
/
v1
/
iframes
Create Iframe Widget
curl --request POST \
--url https://api.example.com/api/v1/iframes \
--header 'Content-Type: application/json' \
--data '
{
"api_key_id": "<string>",
"name": "<string>",
"appearance": {},
"behavior": {},
"security": {}
}
'import requests
url = "https://api.example.com/api/v1/iframes"
payload = {
"api_key_id": "<string>",
"name": "<string>",
"appearance": {},
"behavior": {},
"security": {}
}
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({
api_key_id: '<string>',
name: '<string>',
appearance: {},
behavior: {},
security: {}
})
};
fetch('https://api.example.com/api/v1/iframes', 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/api/v1/iframes",
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([
'api_key_id' => '<string>',
'name' => '<string>',
'appearance' => [
],
'behavior' => [
],
'security' => [
]
]),
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://api.example.com/api/v1/iframes"
payload := strings.NewReader("{\n \"api_key_id\": \"<string>\",\n \"name\": \"<string>\",\n \"appearance\": {},\n \"behavior\": {},\n \"security\": {}\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://api.example.com/api/v1/iframes")
.header("Content-Type", "application/json")
.body("{\n \"api_key_id\": \"<string>\",\n \"name\": \"<string>\",\n \"appearance\": {},\n \"behavior\": {},\n \"security\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/iframes")
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 \"api_key_id\": \"<string>\",\n \"name\": \"<string>\",\n \"appearance\": {},\n \"behavior\": {},\n \"security\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"status": "<string>",
"embed_snippet": "<string>"
}Request
string
required
The API key ID to link this widget to. The widget uses this key’s credits, Brand Soul, and allowed origins.
string
Display name for the widget. Default:
"My Widget".object
Visual customization:
primaryColor, position (bottom-right | bottom-left), borderRadius, fontFamily, custom CSS overrides.object
Behavioral settings:
welcomeMessage, placeholder, maxPromptLength, enableFileUpload, enableVoice, strictAbuse (enables rate-limiting heuristics).object
Security settings:
requireTurnstile (bot protection), allowedOrigins (domain allowlist override).Response
string
The widget config UUID. Use this as the
configId in the embed script.string
Widget display name.
string
"active" or "disabled".string
Ready-to-use HTML
<script> tag for embedding on your site.Authentication
Requires a dashboard session.Example
curl
curl -X POST https://www.hitheo.ai/api/v1/iframes \
-H "Authorization: Bearer $THEO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"api_key_id": "key_abc123",
"name": "Support Widget",
"appearance": { "primaryColor": "#715eac" },
"behavior": { "welcomeMessage": "Hi! How can I help?", "strictAbuse": true }
}'
Was this page helpful?
Create Iframe Widget
curl --request POST \
--url https://api.example.com/api/v1/iframes \
--header 'Content-Type: application/json' \
--data '
{
"api_key_id": "<string>",
"name": "<string>",
"appearance": {},
"behavior": {},
"security": {}
}
'import requests
url = "https://api.example.com/api/v1/iframes"
payload = {
"api_key_id": "<string>",
"name": "<string>",
"appearance": {},
"behavior": {},
"security": {}
}
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({
api_key_id: '<string>',
name: '<string>',
appearance: {},
behavior: {},
security: {}
})
};
fetch('https://api.example.com/api/v1/iframes', 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/api/v1/iframes",
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([
'api_key_id' => '<string>',
'name' => '<string>',
'appearance' => [
],
'behavior' => [
],
'security' => [
]
]),
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://api.example.com/api/v1/iframes"
payload := strings.NewReader("{\n \"api_key_id\": \"<string>\",\n \"name\": \"<string>\",\n \"appearance\": {},\n \"behavior\": {},\n \"security\": {}\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://api.example.com/api/v1/iframes")
.header("Content-Type", "application/json")
.body("{\n \"api_key_id\": \"<string>\",\n \"name\": \"<string>\",\n \"appearance\": {},\n \"behavior\": {},\n \"security\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/iframes")
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 \"api_key_id\": \"<string>\",\n \"name\": \"<string>\",\n \"appearance\": {},\n \"behavior\": {},\n \"security\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"status": "<string>",
"embed_snippet": "<string>"
}