curl --request POST \
--url https://api.cloudhumans.com/typebot/v1/typebots/{flowId}/history/{historyId}/rollback \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cloudhumans.com/typebot/v1/typebots/{flowId}/history/{historyId}/rollback"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cloudhumans.com/typebot/v1/typebots/{flowId}/history/{historyId}/rollback', 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}/history/{historyId}/rollback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cloudhumans.com/typebot/v1/typebots/{flowId}/history/{historyId}/rollback"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/{flowId}/history/{historyId}/rollback")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudhumans.com/typebot/v1/typebots/{flowId}/history/{historyId}/rollback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"historyId": "<string>"
}{
"message": "<string>",
"code": "<string>",
"issues": [
{}
]
}{
"message": "<string>",
"code": "<string>",
"issues": [
{}
]
}{
"message": "<string>",
"code": "<string>",
"issues": [
{}
]
}Restore a flow version
Restores a flow’s draft to the content of one of its versions (name, groups, edges, events, variables, settings, theme, public id, tenant and tool description) and returns the version’s id. Get historyId from List flow versions; a version with hasDanglingReferences is refused with 400.
It does not publish: agents keep running the published version until you call Publish a flow.
updatedAt check, so any edit not yet published is lost. Read the draft with Get a flow first if you may want it back.The tool rules of Update a flow apply, except that a restore may rename: both tenants must be ones your token grants (403), and a tool whose name or tenant changes must not collide with another tool in its tenant (400).
curl --request POST \
--url https://api.cloudhumans.com/typebot/v1/typebots/{flowId}/history/{historyId}/rollback \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cloudhumans.com/typebot/v1/typebots/{flowId}/history/{historyId}/rollback"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cloudhumans.com/typebot/v1/typebots/{flowId}/history/{historyId}/rollback', 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}/history/{historyId}/rollback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cloudhumans.com/typebot/v1/typebots/{flowId}/history/{historyId}/rollback"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/{flowId}/history/{historyId}/rollback")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudhumans.com/typebot/v1/typebots/{flowId}/history/{historyId}/rollback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"historyId": "<string>"
}{
"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.