Create Web Widget
curl --request POST \
--url https://api.voiceaiwrapper.app/api/v2/web-widgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"voice_campaign_id": "Vm9pY2VDYW1wYWlnbjoxMjM=",
"config": {
"mode": [
"voice"
],
"theme": "light",
"position": "bottom-right",
"title": "AI Assistant",
"subtitle": "Get instant help from our AI",
"ctaButtonText": "Start Conversation",
"accentColor": "#3b82f6",
"ctaButtonColor": "#3b82f6"
},
"voice_assistant_id": "asst_abc123",
"chat_assistant_id": "asst_chat123"
}
'import requests
url = "https://api.voiceaiwrapper.app/api/v2/web-widgets"
payload = {
"voice_campaign_id": "Vm9pY2VDYW1wYWlnbjoxMjM=",
"config": {
"mode": ["voice"],
"theme": "light",
"position": "bottom-right",
"title": "AI Assistant",
"subtitle": "Get instant help from our AI",
"ctaButtonText": "Start Conversation",
"accentColor": "#3b82f6",
"ctaButtonColor": "#3b82f6"
},
"voice_assistant_id": "asst_abc123",
"chat_assistant_id": "asst_chat123"
}
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({
voice_campaign_id: 'Vm9pY2VDYW1wYWlnbjoxMjM=',
config: {
mode: ['voice'],
theme: 'light',
position: 'bottom-right',
title: 'AI Assistant',
subtitle: 'Get instant help from our AI',
ctaButtonText: 'Start Conversation',
accentColor: '#3b82f6',
ctaButtonColor: '#3b82f6'
},
voice_assistant_id: 'asst_abc123',
chat_assistant_id: 'asst_chat123'
})
};
fetch('https://api.voiceaiwrapper.app/api/v2/web-widgets', 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.voiceaiwrapper.app/api/v2/web-widgets",
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([
'voice_campaign_id' => 'Vm9pY2VDYW1wYWlnbjoxMjM=',
'config' => [
'mode' => [
'voice'
],
'theme' => 'light',
'position' => 'bottom-right',
'title' => 'AI Assistant',
'subtitle' => 'Get instant help from our AI',
'ctaButtonText' => 'Start Conversation',
'accentColor' => '#3b82f6',
'ctaButtonColor' => '#3b82f6'
],
'voice_assistant_id' => 'asst_abc123',
'chat_assistant_id' => 'asst_chat123'
]),
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.voiceaiwrapper.app/api/v2/web-widgets"
payload := strings.NewReader("{\n \"voice_campaign_id\": \"Vm9pY2VDYW1wYWlnbjoxMjM=\",\n \"config\": {\n \"mode\": [\n \"voice\"\n ],\n \"theme\": \"light\",\n \"position\": \"bottom-right\",\n \"title\": \"AI Assistant\",\n \"subtitle\": \"Get instant help from our AI\",\n \"ctaButtonText\": \"Start Conversation\",\n \"accentColor\": \"#3b82f6\",\n \"ctaButtonColor\": \"#3b82f6\"\n },\n \"voice_assistant_id\": \"asst_abc123\",\n \"chat_assistant_id\": \"asst_chat123\"\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.voiceaiwrapper.app/api/v2/web-widgets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"voice_campaign_id\": \"Vm9pY2VDYW1wYWlnbjoxMjM=\",\n \"config\": {\n \"mode\": [\n \"voice\"\n ],\n \"theme\": \"light\",\n \"position\": \"bottom-right\",\n \"title\": \"AI Assistant\",\n \"subtitle\": \"Get instant help from our AI\",\n \"ctaButtonText\": \"Start Conversation\",\n \"accentColor\": \"#3b82f6\",\n \"ctaButtonColor\": \"#3b82f6\"\n },\n \"voice_assistant_id\": \"asst_abc123\",\n \"chat_assistant_id\": \"asst_chat123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voiceaiwrapper.app/api/v2/web-widgets")
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 \"voice_campaign_id\": \"Vm9pY2VDYW1wYWlnbjoxMjM=\",\n \"config\": {\n \"mode\": [\n \"voice\"\n ],\n \"theme\": \"light\",\n \"position\": \"bottom-right\",\n \"title\": \"AI Assistant\",\n \"subtitle\": \"Get instant help from our AI\",\n \"ctaButtonText\": \"Start Conversation\",\n \"accentColor\": \"#3b82f6\",\n \"ctaButtonColor\": \"#3b82f6\"\n },\n \"voice_assistant_id\": \"asst_abc123\",\n \"chat_assistant_id\": \"asst_chat123\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Web widget created successfully",
"data": {
"web_widget_id": "<string>",
"voice_campaign_id": "<string>",
"config": {},
"created_at": "2023-11-07T05:31:56Z"
}
}{
"message": "Invalid data",
"errors": [
"campaign ID is missing: voice_campaign_id"
]
}{
"message": "<string>"
}{
"message": "campaign not found or does not belong to this tenant",
"errors": [
"Invalid voice_campaign_id"
]
}{
"message": "A web widget already exists for this campaign",
"errors": [
"Duplicate web widget"
]
}{
"message": "<string>"
}Web Widgets
Create Web Widget
Creates a new web widget for an inbound campaign.
Authentication
All requests require an Authorization header using Bearer token authentication:
Authorization: Bearer <api_key>
POST
/
api
/
v2
/
web-widgets
Create Web Widget
curl --request POST \
--url https://api.voiceaiwrapper.app/api/v2/web-widgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"voice_campaign_id": "Vm9pY2VDYW1wYWlnbjoxMjM=",
"config": {
"mode": [
"voice"
],
"theme": "light",
"position": "bottom-right",
"title": "AI Assistant",
"subtitle": "Get instant help from our AI",
"ctaButtonText": "Start Conversation",
"accentColor": "#3b82f6",
"ctaButtonColor": "#3b82f6"
},
"voice_assistant_id": "asst_abc123",
"chat_assistant_id": "asst_chat123"
}
'import requests
url = "https://api.voiceaiwrapper.app/api/v2/web-widgets"
payload = {
"voice_campaign_id": "Vm9pY2VDYW1wYWlnbjoxMjM=",
"config": {
"mode": ["voice"],
"theme": "light",
"position": "bottom-right",
"title": "AI Assistant",
"subtitle": "Get instant help from our AI",
"ctaButtonText": "Start Conversation",
"accentColor": "#3b82f6",
"ctaButtonColor": "#3b82f6"
},
"voice_assistant_id": "asst_abc123",
"chat_assistant_id": "asst_chat123"
}
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({
voice_campaign_id: 'Vm9pY2VDYW1wYWlnbjoxMjM=',
config: {
mode: ['voice'],
theme: 'light',
position: 'bottom-right',
title: 'AI Assistant',
subtitle: 'Get instant help from our AI',
ctaButtonText: 'Start Conversation',
accentColor: '#3b82f6',
ctaButtonColor: '#3b82f6'
},
voice_assistant_id: 'asst_abc123',
chat_assistant_id: 'asst_chat123'
})
};
fetch('https://api.voiceaiwrapper.app/api/v2/web-widgets', 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.voiceaiwrapper.app/api/v2/web-widgets",
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([
'voice_campaign_id' => 'Vm9pY2VDYW1wYWlnbjoxMjM=',
'config' => [
'mode' => [
'voice'
],
'theme' => 'light',
'position' => 'bottom-right',
'title' => 'AI Assistant',
'subtitle' => 'Get instant help from our AI',
'ctaButtonText' => 'Start Conversation',
'accentColor' => '#3b82f6',
'ctaButtonColor' => '#3b82f6'
],
'voice_assistant_id' => 'asst_abc123',
'chat_assistant_id' => 'asst_chat123'
]),
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.voiceaiwrapper.app/api/v2/web-widgets"
payload := strings.NewReader("{\n \"voice_campaign_id\": \"Vm9pY2VDYW1wYWlnbjoxMjM=\",\n \"config\": {\n \"mode\": [\n \"voice\"\n ],\n \"theme\": \"light\",\n \"position\": \"bottom-right\",\n \"title\": \"AI Assistant\",\n \"subtitle\": \"Get instant help from our AI\",\n \"ctaButtonText\": \"Start Conversation\",\n \"accentColor\": \"#3b82f6\",\n \"ctaButtonColor\": \"#3b82f6\"\n },\n \"voice_assistant_id\": \"asst_abc123\",\n \"chat_assistant_id\": \"asst_chat123\"\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.voiceaiwrapper.app/api/v2/web-widgets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"voice_campaign_id\": \"Vm9pY2VDYW1wYWlnbjoxMjM=\",\n \"config\": {\n \"mode\": [\n \"voice\"\n ],\n \"theme\": \"light\",\n \"position\": \"bottom-right\",\n \"title\": \"AI Assistant\",\n \"subtitle\": \"Get instant help from our AI\",\n \"ctaButtonText\": \"Start Conversation\",\n \"accentColor\": \"#3b82f6\",\n \"ctaButtonColor\": \"#3b82f6\"\n },\n \"voice_assistant_id\": \"asst_abc123\",\n \"chat_assistant_id\": \"asst_chat123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voiceaiwrapper.app/api/v2/web-widgets")
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 \"voice_campaign_id\": \"Vm9pY2VDYW1wYWlnbjoxMjM=\",\n \"config\": {\n \"mode\": [\n \"voice\"\n ],\n \"theme\": \"light\",\n \"position\": \"bottom-right\",\n \"title\": \"AI Assistant\",\n \"subtitle\": \"Get instant help from our AI\",\n \"ctaButtonText\": \"Start Conversation\",\n \"accentColor\": \"#3b82f6\",\n \"ctaButtonColor\": \"#3b82f6\"\n },\n \"voice_assistant_id\": \"asst_abc123\",\n \"chat_assistant_id\": \"asst_chat123\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Web widget created successfully",
"data": {
"web_widget_id": "<string>",
"voice_campaign_id": "<string>",
"config": {},
"created_at": "2023-11-07T05:31:56Z"
}
}{
"message": "Invalid data",
"errors": [
"campaign ID is missing: voice_campaign_id"
]
}{
"message": "<string>"
}{
"message": "campaign not found or does not belong to this tenant",
"errors": [
"Invalid voice_campaign_id"
]
}{
"message": "A web widget already exists for this campaign",
"errors": [
"Duplicate web widget"
]
}{
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Web widget configuration
Global ID of the inbound campaign for this widget. Required.
Example:
"Vm9pY2VDYW1wYWlnbjoxMjM="
Widget appearance and behaviour configuration. Required. All fields inside config are optional and will use defaults if not provided.
Show child attributes
Show child attributes
Example:
{
"mode": ["voice"],
"theme": "light",
"position": "bottom-right",
"title": "AI Assistant",
"subtitle": "Get instant help from our AI",
"ctaButtonText": "Start Conversation",
"accentColor": "#3b82f6",
"ctaButtonColor": "#3b82f6"
}
Provider-native ID of the voice assistant. Required when config.mode includes 'voice'.
Example:
"asst_abc123"
Provider-native ID of the chat assistant. Required when config.mode includes 'chat'.
Example:
"asst_chat123"
Was this page helpful?
⌘I

