curl --request POST \
--url https://haico.gr/api/conversations/{thread_id}/branch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_turn": 1,
"reason": "<string>",
"workspace": {
"preferences": [
{
"title": "<string>",
"subtitle": "<string>",
"kind": "soft",
"locked": false
}
],
"todos": [
{
"text": "<string>",
"done": false,
"depth": 0
}
],
"objective": "<string>",
"document": {
"title": "<string>",
"content": "<string>"
}
}
}
'import requests
url = "https://haico.gr/api/conversations/{thread_id}/branch"
payload = {
"from_turn": 1,
"reason": "<string>",
"workspace": {
"preferences": [
{
"title": "<string>",
"subtitle": "<string>",
"kind": "soft",
"locked": False
}
],
"todos": [
{
"text": "<string>",
"done": False,
"depth": 0
}
],
"objective": "<string>",
"document": {
"title": "<string>",
"content": "<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({
from_turn: 1,
reason: '<string>',
workspace: {
preferences: [{title: '<string>', subtitle: '<string>', kind: 'soft', locked: false}],
todos: [{text: '<string>', done: false, depth: 0}],
objective: '<string>',
document: {title: '<string>', content: '<string>'}
}
})
};
fetch('https://haico.gr/api/conversations/{thread_id}/branch', 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://haico.gr/api/conversations/{thread_id}/branch",
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([
'from_turn' => 1,
'reason' => '<string>',
'workspace' => [
'preferences' => [
[
'title' => '<string>',
'subtitle' => '<string>',
'kind' => 'soft',
'locked' => false
]
],
'todos' => [
[
'text' => '<string>',
'done' => false,
'depth' => 0
]
],
'objective' => '<string>',
'document' => [
'title' => '<string>',
'content' => '<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://haico.gr/api/conversations/{thread_id}/branch"
payload := strings.NewReader("{\n \"from_turn\": 1,\n \"reason\": \"<string>\",\n \"workspace\": {\n \"preferences\": [\n {\n \"title\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"kind\": \"soft\",\n \"locked\": false\n }\n ],\n \"todos\": [\n {\n \"text\": \"<string>\",\n \"done\": false,\n \"depth\": 0\n }\n ],\n \"objective\": \"<string>\",\n \"document\": {\n \"title\": \"<string>\",\n \"content\": \"<string>\"\n }\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://haico.gr/api/conversations/{thread_id}/branch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_turn\": 1,\n \"reason\": \"<string>\",\n \"workspace\": {\n \"preferences\": [\n {\n \"title\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"kind\": \"soft\",\n \"locked\": false\n }\n ],\n \"todos\": [\n {\n \"text\": \"<string>\",\n \"done\": false,\n \"depth\": 0\n }\n ],\n \"objective\": \"<string>\",\n \"document\": {\n \"title\": \"<string>\",\n \"content\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://haico.gr/api/conversations/{thread_id}/branch")
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 \"from_turn\": 1,\n \"reason\": \"<string>\",\n \"workspace\": {\n \"preferences\": [\n {\n \"title\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"kind\": \"soft\",\n \"locked\": false\n }\n ],\n \"todos\": [\n {\n \"text\": \"<string>\",\n \"done\": false,\n \"depth\": 0\n }\n ],\n \"objective\": \"<string>\",\n \"document\": {\n \"title\": \"<string>\",\n \"content\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"thread_id": "<string>",
"parent_thread_id": "<string>",
"branch_point_turn": 123,
"title": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Branch Conversation
Fork a conversation at a completed user turn.
Creates a NEW thread whose message history is the parent’s prefix up to
from_turn and whose workspace (document / preferences / todos /
artifacts) is copied as-of that turn. The service manages its own
sessions because the LangGraph checkpointer seeding must happen between
two committed transactions.
Args:
payload: from_turn (>= 0; 0 forks from the empty start) and an
optional reason label.
user: The authenticated user (must own the conversation).
thread_id: The conversation to fork.
Returns:
BranchCreateResponse with the new thread id and branch metadata.
Raises:
HTTPException 400: from_turn at or before the thread’s own branch point.
HTTPException 403: The conversation belongs to another user.
HTTPException 404: Unknown conversation, or from_turn beyond the latest turn.
HTTPException 409: The snapshot needed to reconstruct the workspace is missing.
HTTPException 502: Checkpointer seeding failed (branch fully rolled back).
curl --request POST \
--url https://haico.gr/api/conversations/{thread_id}/branch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_turn": 1,
"reason": "<string>",
"workspace": {
"preferences": [
{
"title": "<string>",
"subtitle": "<string>",
"kind": "soft",
"locked": false
}
],
"todos": [
{
"text": "<string>",
"done": false,
"depth": 0
}
],
"objective": "<string>",
"document": {
"title": "<string>",
"content": "<string>"
}
}
}
'import requests
url = "https://haico.gr/api/conversations/{thread_id}/branch"
payload = {
"from_turn": 1,
"reason": "<string>",
"workspace": {
"preferences": [
{
"title": "<string>",
"subtitle": "<string>",
"kind": "soft",
"locked": False
}
],
"todos": [
{
"text": "<string>",
"done": False,
"depth": 0
}
],
"objective": "<string>",
"document": {
"title": "<string>",
"content": "<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({
from_turn: 1,
reason: '<string>',
workspace: {
preferences: [{title: '<string>', subtitle: '<string>', kind: 'soft', locked: false}],
todos: [{text: '<string>', done: false, depth: 0}],
objective: '<string>',
document: {title: '<string>', content: '<string>'}
}
})
};
fetch('https://haico.gr/api/conversations/{thread_id}/branch', 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://haico.gr/api/conversations/{thread_id}/branch",
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([
'from_turn' => 1,
'reason' => '<string>',
'workspace' => [
'preferences' => [
[
'title' => '<string>',
'subtitle' => '<string>',
'kind' => 'soft',
'locked' => false
]
],
'todos' => [
[
'text' => '<string>',
'done' => false,
'depth' => 0
]
],
'objective' => '<string>',
'document' => [
'title' => '<string>',
'content' => '<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://haico.gr/api/conversations/{thread_id}/branch"
payload := strings.NewReader("{\n \"from_turn\": 1,\n \"reason\": \"<string>\",\n \"workspace\": {\n \"preferences\": [\n {\n \"title\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"kind\": \"soft\",\n \"locked\": false\n }\n ],\n \"todos\": [\n {\n \"text\": \"<string>\",\n \"done\": false,\n \"depth\": 0\n }\n ],\n \"objective\": \"<string>\",\n \"document\": {\n \"title\": \"<string>\",\n \"content\": \"<string>\"\n }\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://haico.gr/api/conversations/{thread_id}/branch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_turn\": 1,\n \"reason\": \"<string>\",\n \"workspace\": {\n \"preferences\": [\n {\n \"title\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"kind\": \"soft\",\n \"locked\": false\n }\n ],\n \"todos\": [\n {\n \"text\": \"<string>\",\n \"done\": false,\n \"depth\": 0\n }\n ],\n \"objective\": \"<string>\",\n \"document\": {\n \"title\": \"<string>\",\n \"content\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://haico.gr/api/conversations/{thread_id}/branch")
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 \"from_turn\": 1,\n \"reason\": \"<string>\",\n \"workspace\": {\n \"preferences\": [\n {\n \"title\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"kind\": \"soft\",\n \"locked\": false\n }\n ],\n \"todos\": [\n {\n \"text\": \"<string>\",\n \"done\": false,\n \"depth\": 0\n }\n ],\n \"objective\": \"<string>\",\n \"document\": {\n \"title\": \"<string>\",\n \"content\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"thread_id": "<string>",
"parent_thread_id": "<string>",
"branch_point_turn": 123,
"title": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
A personal access token (haico_pat_...), created under Profile → API keys. Send it as Authorization: Bearer <key>. The browser session JWT is also accepted but is an internal mechanism and is not part of the public contract.
Path Parameters
1 - 255Body
Payload for forking a conversation at a completed user turn.
Parent turn index to branch from. 0 forks from the empty start (used to retry/edit the very first turn).
x >= 0Optional branch label
500Displayed workspace to seed the branch with (restored-preview edits included). Omit to seed from the as-of-turn snapshot.
Show child attributes
Show child attributes