curl --request PATCH \
--url https://api.cloudhumans.com/typebot/v1/typebots/{flowId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"typebot": {
"updatedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"icon": "<string>",
"folderId": "<string>",
"groups": [
{}
],
"edges": [
{}
],
"events": [
{}
],
"variables": [
{}
],
"settings": {},
"theme": {},
"selectedThemeTemplateId": "<string>",
"publicId": "<string>",
"customDomain": "<string>",
"tenant": "<string>",
"toolDescription": "<string>",
"isClosed": true,
"isArchived": true
}
}
'import requests
url = "https://api.cloudhumans.com/typebot/v1/typebots/{flowId}"
payload = { "typebot": {
"updatedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"icon": "<string>",
"folderId": "<string>",
"groups": [{}],
"edges": [{}],
"events": [{}],
"variables": [{}],
"settings": {},
"theme": {},
"selectedThemeTemplateId": "<string>",
"publicId": "<string>",
"customDomain": "<string>",
"tenant": "<string>",
"toolDescription": "<string>",
"isClosed": True,
"isArchived": True
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
typebot: {
updatedAt: '2023-11-07T05:31:56Z',
name: '<string>',
icon: '<string>',
folderId: '<string>',
groups: [{}],
edges: [{}],
events: [{}],
variables: [{}],
settings: {},
theme: {},
selectedThemeTemplateId: '<string>',
publicId: '<string>',
customDomain: '<string>',
tenant: '<string>',
toolDescription: '<string>',
isClosed: true,
isArchived: true
}
})
};
fetch('https://api.cloudhumans.com/typebot/v1/typebots/{flowId}', 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/{flowId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'typebot' => [
'updatedAt' => '2023-11-07T05:31:56Z',
'name' => '<string>',
'icon' => '<string>',
'folderId' => '<string>',
'groups' => [
[
]
],
'edges' => [
[
]
],
'events' => [
[
]
],
'variables' => [
[
]
],
'settings' => [
],
'theme' => [
],
'selectedThemeTemplateId' => '<string>',
'publicId' => '<string>',
'customDomain' => '<string>',
'tenant' => '<string>',
'toolDescription' => '<string>',
'isClosed' => true,
'isArchived' => true
]
]),
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/{flowId}"
payload := strings.NewReader("{\n \"typebot\": {\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\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 \"publicId\": \"<string>\",\n \"customDomain\": \"<string>\",\n \"tenant\": \"<string>\",\n \"toolDescription\": \"<string>\",\n \"isClosed\": true,\n \"isArchived\": true\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.cloudhumans.com/typebot/v1/typebots/{flowId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"typebot\": {\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\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 \"publicId\": \"<string>\",\n \"customDomain\": \"<string>\",\n \"tenant\": \"<string>\",\n \"toolDescription\": \"<string>\",\n \"isClosed\": true,\n \"isArchived\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudhumans.com/typebot/v1/typebots/{flowId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"typebot\": {\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\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 \"publicId\": \"<string>\",\n \"customDomain\": \"<string>\",\n \"tenant\": \"<string>\",\n \"toolDescription\": \"<string>\",\n \"isClosed\": true,\n \"isArchived\": true\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": [
{}
]
}{
"message": "<string>",
"code": "<string>",
"issues": [
{}
]
}Update a flow
Changes a flow and returns it in full. The change lands in the draft: agents keep running the published version until you call Publish a flow.
Send only the fields you change, plus typebot.updatedAt from your last read. updatedAt is required (400 without it), and a stale one is a 409 with nothing saved: read the flow again, redo the change and resend.
groups, edges, events, variables and settings each replace the stored value as a whole. To change one block, read the flow, edit that block inside the full groups array and send groups, edges and events back complete. Sending only the group you touched deletes every other group.A tool has extra rules:
- Its name cannot change, it cannot be archived, and
tenantandtoolDescriptioncannot be emptied (400). - When the flow is a tool before or after the change, both tenants must be ones your token grants (
403otherwise). Flows that are not tools are not checked. - When it becomes a tool, or moves to another tenant, its name must not collide with another tool there (
400).
The result is checked like on create (graph consistency, script lint, client-side Set variable, outputSchema). Only problems that are new since the stored draft count, and a refusal lists each one and saves nothing.
curl --request PATCH \
--url https://api.cloudhumans.com/typebot/v1/typebots/{flowId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"typebot": {
"updatedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"icon": "<string>",
"folderId": "<string>",
"groups": [
{}
],
"edges": [
{}
],
"events": [
{}
],
"variables": [
{}
],
"settings": {},
"theme": {},
"selectedThemeTemplateId": "<string>",
"publicId": "<string>",
"customDomain": "<string>",
"tenant": "<string>",
"toolDescription": "<string>",
"isClosed": true,
"isArchived": true
}
}
'import requests
url = "https://api.cloudhumans.com/typebot/v1/typebots/{flowId}"
payload = { "typebot": {
"updatedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"icon": "<string>",
"folderId": "<string>",
"groups": [{}],
"edges": [{}],
"events": [{}],
"variables": [{}],
"settings": {},
"theme": {},
"selectedThemeTemplateId": "<string>",
"publicId": "<string>",
"customDomain": "<string>",
"tenant": "<string>",
"toolDescription": "<string>",
"isClosed": True,
"isArchived": True
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
typebot: {
updatedAt: '2023-11-07T05:31:56Z',
name: '<string>',
icon: '<string>',
folderId: '<string>',
groups: [{}],
edges: [{}],
events: [{}],
variables: [{}],
settings: {},
theme: {},
selectedThemeTemplateId: '<string>',
publicId: '<string>',
customDomain: '<string>',
tenant: '<string>',
toolDescription: '<string>',
isClosed: true,
isArchived: true
}
})
};
fetch('https://api.cloudhumans.com/typebot/v1/typebots/{flowId}', 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/{flowId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'typebot' => [
'updatedAt' => '2023-11-07T05:31:56Z',
'name' => '<string>',
'icon' => '<string>',
'folderId' => '<string>',
'groups' => [
[
]
],
'edges' => [
[
]
],
'events' => [
[
]
],
'variables' => [
[
]
],
'settings' => [
],
'theme' => [
],
'selectedThemeTemplateId' => '<string>',
'publicId' => '<string>',
'customDomain' => '<string>',
'tenant' => '<string>',
'toolDescription' => '<string>',
'isClosed' => true,
'isArchived' => true
]
]),
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/{flowId}"
payload := strings.NewReader("{\n \"typebot\": {\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\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 \"publicId\": \"<string>\",\n \"customDomain\": \"<string>\",\n \"tenant\": \"<string>\",\n \"toolDescription\": \"<string>\",\n \"isClosed\": true,\n \"isArchived\": true\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.cloudhumans.com/typebot/v1/typebots/{flowId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"typebot\": {\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\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 \"publicId\": \"<string>\",\n \"customDomain\": \"<string>\",\n \"tenant\": \"<string>\",\n \"toolDescription\": \"<string>\",\n \"isClosed\": true,\n \"isArchived\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudhumans.com/typebot/v1/typebots/{flowId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"typebot\": {\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\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 \"publicId\": \"<string>\",\n \"customDomain\": \"<string>\",\n \"tenant\": \"<string>\",\n \"toolDescription\": \"<string>\",\n \"isClosed\": true,\n \"isArchived\": true\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": [
{}
]
}{
"message": "<string>",
"code": "<string>",
"issues": [
{}
]
}Authorizations
Path Parameters
The flow's internal id, e.g. clx9z8y7x6w5v4u3t2s1. Get it from List flows (the id field of each flow). It is NOT the publicId slug that appears in a flow's public URL: a slug answers 404 here. A flow your token cannot write to answers 404, indistinguishable from one that does not exist.