curl --request POST \
--url https://api.cloudhumans.com/typebot/v1/typebots \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspaceId": "<string>",
"typebot": {
"name": "<string>",
"icon": "<string>",
"folderId": "<string>",
"groups": [
{}
],
"edges": [
{}
],
"events": [
{}
],
"variables": [
{}
],
"settings": {},
"theme": {},
"selectedThemeTemplateId": "<string>",
"resultsTablePreferences": {},
"publicId": "<string>",
"customDomain": "<string>",
"tenant": "<string>",
"toolDescription": "<string>"
}
}
'import requests
url = "https://api.cloudhumans.com/typebot/v1/typebots"
payload = {
"workspaceId": "<string>",
"typebot": {
"name": "<string>",
"icon": "<string>",
"folderId": "<string>",
"groups": [{}],
"edges": [{}],
"events": [{}],
"variables": [{}],
"settings": {},
"theme": {},
"selectedThemeTemplateId": "<string>",
"resultsTablePreferences": {},
"publicId": "<string>",
"customDomain": "<string>",
"tenant": "<string>",
"toolDescription": "<string>"
}
}
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({
workspaceId: '<string>',
typebot: {
name: '<string>',
icon: '<string>',
folderId: '<string>',
groups: [{}],
edges: [{}],
events: [{}],
variables: [{}],
settings: {},
theme: {},
selectedThemeTemplateId: '<string>',
resultsTablePreferences: {},
publicId: '<string>',
customDomain: '<string>',
tenant: '<string>',
toolDescription: '<string>'
}
})
};
fetch('https://api.cloudhumans.com/typebot/v1/typebots', 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.cloudhumans.com/typebot/v1/typebots",
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([
'workspaceId' => '<string>',
'typebot' => [
'name' => '<string>',
'icon' => '<string>',
'folderId' => '<string>',
'groups' => [
[
]
],
'edges' => [
[
]
],
'events' => [
[
]
],
'variables' => [
[
]
],
'settings' => [
],
'theme' => [
],
'selectedThemeTemplateId' => '<string>',
'resultsTablePreferences' => [
],
'publicId' => '<string>',
'customDomain' => '<string>',
'tenant' => '<string>',
'toolDescription' => '<string>'
]
]),
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.cloudhumans.com/typebot/v1/typebots"
payload := strings.NewReader("{\n \"workspaceId\": \"<string>\",\n \"typebot\": {\n \"name\": \"<string>\",\n \"icon\": \"<string>\",\n \"folderId\": \"<string>\",\n \"groups\": [\n {}\n ],\n \"edges\": [\n {}\n ],\n \"events\": [\n {}\n ],\n \"variables\": [\n {}\n ],\n \"settings\": {},\n \"theme\": {},\n \"selectedThemeTemplateId\": \"<string>\",\n \"resultsTablePreferences\": {},\n \"publicId\": \"<string>\",\n \"customDomain\": \"<string>\",\n \"tenant\": \"<string>\",\n \"toolDescription\": \"<string>\"\n }\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.cloudhumans.com/typebot/v1/typebots")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspaceId\": \"<string>\",\n \"typebot\": {\n \"name\": \"<string>\",\n \"icon\": \"<string>\",\n \"folderId\": \"<string>\",\n \"groups\": [\n {}\n ],\n \"edges\": [\n {}\n ],\n \"events\": [\n {}\n ],\n \"variables\": [\n {}\n ],\n \"settings\": {},\n \"theme\": {},\n \"selectedThemeTemplateId\": \"<string>\",\n \"resultsTablePreferences\": {},\n \"publicId\": \"<string>\",\n \"customDomain\": \"<string>\",\n \"tenant\": \"<string>\",\n \"toolDescription\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudhumans.com/typebot/v1/typebots")
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 \"workspaceId\": \"<string>\",\n \"typebot\": {\n \"name\": \"<string>\",\n \"icon\": \"<string>\",\n \"folderId\": \"<string>\",\n \"groups\": [\n {}\n ],\n \"edges\": [\n {}\n ],\n \"events\": [\n {}\n ],\n \"variables\": [\n {}\n ],\n \"settings\": {},\n \"theme\": {},\n \"selectedThemeTemplateId\": \"<string>\",\n \"resultsTablePreferences\": {},\n \"publicId\": \"<string>\",\n \"customDomain\": \"<string>\",\n \"tenant\": \"<string>\",\n \"toolDescription\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"typebot": {
"id": "<string>",
"name": "<string>",
"version": "<string>",
"icon": "<string>",
"folderId": "<string>",
"workspaceId": "<string>",
"publicId": "<string>",
"tenant": "<string>",
"toolDescription": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isArchived": true,
"isClosed": true,
"groups": [
{}
],
"edges": [
{}
],
"events": [
{}
],
"variables": [
{}
],
"settings": {}
}
}{
"message": "<string>",
"code": "<string>",
"issues": [
{}
]
}{
"message": "<string>",
"code": "<string>",
"issues": [
{}
]
}{
"message": "<string>",
"code": "<string>",
"issues": [
{}
]
}Create a flow
Creates a flow in a workspace and returns it in full. Only typebot.name is required; omit groups, edges and events for an empty flow with a start event.
The new flow is a draft: agents do not see it until you call Publish a flow.
A flow is a conversational flow unless typebot.settings.general.type is TOOL or CONTEXT_ENRICHMENT. A TOOL needs a tenant your token grants (otherwise 403) and a toolDescription, and its name must contain a letter or a number and be unique inside the tenant (otherwise 400). Its inputs are declared in a Declare variables block of groups; copying the shape from an existing tool read with Get a flow is the safest way to build one.
The flow is checked before it is saved, and a refusal saves nothing and says what to fix:
- Groups, edges and events must be consistent: an edge pointing at a missing group or block, or a missing start event, is a
400. - A tool’s
Codeblocks and the custom code of itsSet variableblocks are linted. ASet variablethat runs on the client is refused, because tools run without a browser. settings.tool.outputSchemamust compile.
curl --request POST \
--url https://api.cloudhumans.com/typebot/v1/typebots \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspaceId": "<string>",
"typebot": {
"name": "<string>",
"icon": "<string>",
"folderId": "<string>",
"groups": [
{}
],
"edges": [
{}
],
"events": [
{}
],
"variables": [
{}
],
"settings": {},
"theme": {},
"selectedThemeTemplateId": "<string>",
"resultsTablePreferences": {},
"publicId": "<string>",
"customDomain": "<string>",
"tenant": "<string>",
"toolDescription": "<string>"
}
}
'import requests
url = "https://api.cloudhumans.com/typebot/v1/typebots"
payload = {
"workspaceId": "<string>",
"typebot": {
"name": "<string>",
"icon": "<string>",
"folderId": "<string>",
"groups": [{}],
"edges": [{}],
"events": [{}],
"variables": [{}],
"settings": {},
"theme": {},
"selectedThemeTemplateId": "<string>",
"resultsTablePreferences": {},
"publicId": "<string>",
"customDomain": "<string>",
"tenant": "<string>",
"toolDescription": "<string>"
}
}
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({
workspaceId: '<string>',
typebot: {
name: '<string>',
icon: '<string>',
folderId: '<string>',
groups: [{}],
edges: [{}],
events: [{}],
variables: [{}],
settings: {},
theme: {},
selectedThemeTemplateId: '<string>',
resultsTablePreferences: {},
publicId: '<string>',
customDomain: '<string>',
tenant: '<string>',
toolDescription: '<string>'
}
})
};
fetch('https://api.cloudhumans.com/typebot/v1/typebots', 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.cloudhumans.com/typebot/v1/typebots",
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([
'workspaceId' => '<string>',
'typebot' => [
'name' => '<string>',
'icon' => '<string>',
'folderId' => '<string>',
'groups' => [
[
]
],
'edges' => [
[
]
],
'events' => [
[
]
],
'variables' => [
[
]
],
'settings' => [
],
'theme' => [
],
'selectedThemeTemplateId' => '<string>',
'resultsTablePreferences' => [
],
'publicId' => '<string>',
'customDomain' => '<string>',
'tenant' => '<string>',
'toolDescription' => '<string>'
]
]),
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.cloudhumans.com/typebot/v1/typebots"
payload := strings.NewReader("{\n \"workspaceId\": \"<string>\",\n \"typebot\": {\n \"name\": \"<string>\",\n \"icon\": \"<string>\",\n \"folderId\": \"<string>\",\n \"groups\": [\n {}\n ],\n \"edges\": [\n {}\n ],\n \"events\": [\n {}\n ],\n \"variables\": [\n {}\n ],\n \"settings\": {},\n \"theme\": {},\n \"selectedThemeTemplateId\": \"<string>\",\n \"resultsTablePreferences\": {},\n \"publicId\": \"<string>\",\n \"customDomain\": \"<string>\",\n \"tenant\": \"<string>\",\n \"toolDescription\": \"<string>\"\n }\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.cloudhumans.com/typebot/v1/typebots")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspaceId\": \"<string>\",\n \"typebot\": {\n \"name\": \"<string>\",\n \"icon\": \"<string>\",\n \"folderId\": \"<string>\",\n \"groups\": [\n {}\n ],\n \"edges\": [\n {}\n ],\n \"events\": [\n {}\n ],\n \"variables\": [\n {}\n ],\n \"settings\": {},\n \"theme\": {},\n \"selectedThemeTemplateId\": \"<string>\",\n \"resultsTablePreferences\": {},\n \"publicId\": \"<string>\",\n \"customDomain\": \"<string>\",\n \"tenant\": \"<string>\",\n \"toolDescription\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudhumans.com/typebot/v1/typebots")
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 \"workspaceId\": \"<string>\",\n \"typebot\": {\n \"name\": \"<string>\",\n \"icon\": \"<string>\",\n \"folderId\": \"<string>\",\n \"groups\": [\n {}\n ],\n \"edges\": [\n {}\n ],\n \"events\": [\n {}\n ],\n \"variables\": [\n {}\n ],\n \"settings\": {},\n \"theme\": {},\n \"selectedThemeTemplateId\": \"<string>\",\n \"resultsTablePreferences\": {},\n \"publicId\": \"<string>\",\n \"customDomain\": \"<string>\",\n \"tenant\": \"<string>\",\n \"toolDescription\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"typebot": {
"id": "<string>",
"name": "<string>",
"version": "<string>",
"icon": "<string>",
"folderId": "<string>",
"workspaceId": "<string>",
"publicId": "<string>",
"tenant": "<string>",
"toolDescription": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isArchived": true,
"isClosed": true,
"groups": [
{}
],
"edges": [
{}
],
"events": [
{}
],
"variables": [
{}
],
"settings": {}
}
}{
"message": "<string>",
"code": "<string>",
"issues": [
{}
]
}{
"message": "<string>",
"code": "<string>",
"issues": [
{}
]
}{
"message": "<string>",
"code": "<string>",
"issues": [
{}
]
}Authorizations
Body
Where to create the flow and what it contains.