Create an embedded form
Create an embedded form, PAUSED and unpublished. Edit its draft with lead_capture_embedded_forms_update, publish it with lead_capture_embedded_forms_publish, then set it ACTIVE. Visitors see nothing until it is published, ACTIVE, and embedded on an allowed site.
curl --request POST \
--url https://www.useboom.ai/api/v1/lead-capture/embedded-forms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"allowedOrigins": [
"<string>"
],
"draft": {}
}
'import requests
url = "https://www.useboom.ai/api/v1/lead-capture/embedded-forms"
payload = {
"name": "<string>",
"allowedOrigins": ["<string>"],
"draft": {}
}
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({name: '<string>', allowedOrigins: ['<string>'], draft: {}})
};
fetch('https://www.useboom.ai/api/v1/lead-capture/embedded-forms', 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://www.useboom.ai/api/v1/lead-capture/embedded-forms",
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([
'name' => '<string>',
'allowedOrigins' => [
'<string>'
],
'draft' => [
]
]),
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://www.useboom.ai/api/v1/lead-capture/embedded-forms"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"draft\": {}\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://www.useboom.ai/api/v1/lead-capture/embedded-forms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"draft\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.useboom.ai/api/v1/lead-capture/embedded-forms")
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 \"name\": \"<string>\",\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"draft\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"status": "PAUSED",
"allowedOrigins": [
"<string>"
],
"installKey": "<string>",
"publishedVersion": 123,
"unpublishedChanges": true,
"updatedAt": "<string>",
"embedTag": "<string>",
"installTag": "<string>",
"draft": {},
"publishIssues": [
"<string>"
]
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Organization API key, sent as Authorization: Bearer boom_org_....
Body
Internal name, unique in the organization.
1 - 80Every site the pop-up may open on, as bare origins such as https://www.example.com. Matching is exact: https://example.com does not cover https://www.example.com.
20A full starting config (see lead_capture_embedded_forms_get). Omitted: one email question and a thank-you ending, the slug taken from the name.
Show child attributes
Show child attributes
Response
Success
PAUSED, ACTIVE Public; identifies the form in the embed.
The version visitors get; null until first published.
The draft differs from the published version.
Paste where the form should appear, together with installTag.
The editable config: steps, fields (typed questions with key, options[].value, score, sensitive), endings (with score ranges), consent, hidden, constants and design. Edit it and send it back as draft to lead_capture_embedded_forms_update; lists are replaced whole. Visitors see nothing until lead_capture_embedded_forms_publish.
Show child attributes
Show child attributes
Why the draft cannot be published yet; empty when it can.
Was this page helpful?
curl --request POST \
--url https://www.useboom.ai/api/v1/lead-capture/embedded-forms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"allowedOrigins": [
"<string>"
],
"draft": {}
}
'import requests
url = "https://www.useboom.ai/api/v1/lead-capture/embedded-forms"
payload = {
"name": "<string>",
"allowedOrigins": ["<string>"],
"draft": {}
}
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({name: '<string>', allowedOrigins: ['<string>'], draft: {}})
};
fetch('https://www.useboom.ai/api/v1/lead-capture/embedded-forms', 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://www.useboom.ai/api/v1/lead-capture/embedded-forms",
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([
'name' => '<string>',
'allowedOrigins' => [
'<string>'
],
'draft' => [
]
]),
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://www.useboom.ai/api/v1/lead-capture/embedded-forms"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"draft\": {}\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://www.useboom.ai/api/v1/lead-capture/embedded-forms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"draft\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.useboom.ai/api/v1/lead-capture/embedded-forms")
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 \"name\": \"<string>\",\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"draft\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"status": "PAUSED",
"allowedOrigins": [
"<string>"
],
"installKey": "<string>",
"publishedVersion": 123,
"unpublishedChanges": true,
"updatedAt": "<string>",
"embedTag": "<string>",
"installTag": "<string>",
"draft": {},
"publishIssues": [
"<string>"
]
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}