Preview Agent Branch Rebase
curl --request POST \
--url https://api.bland.ai/v2/agents/{agent_id}/branches/{branch_id}/rebase-preview \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v2/agents/{agent_id}/branches/{branch_id}/rebase-preview"
headers = {"authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {authorization: '<authorization>'}};
fetch('https://api.bland.ai/v2/agents/{agent_id}/branches/{branch_id}/rebase-preview', 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.bland.ai/v2/agents/{agent_id}/branches/{branch_id}/rebase-preview",
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: <authorization>"
],
]);
$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.bland.ai/v2/agents/{agent_id}/branches/{branch_id}/rebase-preview"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("authorization", "<authorization>")
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.bland.ai/v2/agents/{agent_id}/branches/{branch_id}/rebase-preview")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v2/agents/{agent_id}/branches/{branch_id}/rebase-preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": {
"dev_head_version_id": "50dc2b1d-854f-4403-8c26-e845238cc03b",
"up_to_date": false,
"auto_merged": 1,
"changes": [
{
"id": "node:40f4b50d-46a3-4235-99b7-09a299ce628c#data.rule",
"kind": "node",
"key": "40f4b50d-46a3-4235-99b7-09a299ce628c",
"path": "data.rule",
"path_labels": ["data", "rule"],
"label": "Verify account",
"base": "Ask for the account number and confirm the last four digits.",
"theirs": "Ask for the account number, then confirm the last four digits and the billing zip code."
}
],
"conflicts": [
{
"id": "setting:systemPrompt",
"kind": "setting",
"key": "systemPrompt",
"path": "",
"path_labels": [],
"label": "systemPrompt",
"base": "You are the front desk assistant for Northwind Dental.",
"theirs": "You are the front desk assistant for Northwind Dental. Keep answers under two sentences.",
"ours": "You are the scheduling assistant for Northwind Dental. Always offer the next two open slots."
}
]
},
"errors": null
}
{
"data": {
"dev_head_version_id": "50dc2b1d-854f-4403-8c26-e845238cc03b",
"up_to_date": true,
"auto_merged": 0,
"changes": [],
"conflicts": []
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Agent or branch not found"
}
]
}
Branches
Preview Agent Branch Rebase
Preview a branch rebase onto the current dev head.
POST
/
v2
/
agents
/
{agent_id}
/
branches
/
{branch_id}
/
rebase-preview
Preview Agent Branch Rebase
curl --request POST \
--url https://api.bland.ai/v2/agents/{agent_id}/branches/{branch_id}/rebase-preview \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v2/agents/{agent_id}/branches/{branch_id}/rebase-preview"
headers = {"authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {authorization: '<authorization>'}};
fetch('https://api.bland.ai/v2/agents/{agent_id}/branches/{branch_id}/rebase-preview', 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.bland.ai/v2/agents/{agent_id}/branches/{branch_id}/rebase-preview",
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: <authorization>"
],
]);
$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.bland.ai/v2/agents/{agent_id}/branches/{branch_id}/rebase-preview"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("authorization", "<authorization>")
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.bland.ai/v2/agents/{agent_id}/branches/{branch_id}/rebase-preview")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v2/agents/{agent_id}/branches/{branch_id}/rebase-preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": {
"dev_head_version_id": "50dc2b1d-854f-4403-8c26-e845238cc03b",
"up_to_date": false,
"auto_merged": 1,
"changes": [
{
"id": "node:40f4b50d-46a3-4235-99b7-09a299ce628c#data.rule",
"kind": "node",
"key": "40f4b50d-46a3-4235-99b7-09a299ce628c",
"path": "data.rule",
"path_labels": ["data", "rule"],
"label": "Verify account",
"base": "Ask for the account number and confirm the last four digits.",
"theirs": "Ask for the account number, then confirm the last four digits and the billing zip code."
}
],
"conflicts": [
{
"id": "setting:systemPrompt",
"kind": "setting",
"key": "systemPrompt",
"path": "",
"path_labels": [],
"label": "systemPrompt",
"base": "You are the front desk assistant for Northwind Dental.",
"theirs": "You are the front desk assistant for Northwind Dental. Keep answers under two sentences.",
"ours": "You are the scheduling assistant for Northwind Dental. Always offer the next two open slots."
}
]
},
"errors": null
}
{
"data": {
"dev_head_version_id": "50dc2b1d-854f-4403-8c26-e845238cc03b",
"up_to_date": true,
"auto_merged": 0,
"changes": [],
"conflicts": []
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Agent or branch not found"
}
]
}
Overview
Dry-runs a three-way merge of the branch onto dev’s current head and reports what a rebase would bring in from dev (changes) and where dev and the branch changed the same value differently (conflicts). This is a POST but it writes nothing and takes no body. Call it after Merge Agent Branch returns 409 BRANCH_BEHIND, then pass the returned dev_head_version_id and a resolution for every conflict to Rebase Agent Branch.
Requires an admin, owner, operator, or prompter role.
Headers
string
required
Your API key for authentication.
Path Parameters
string
required
The agent’s unique identifier.
string
required
The branch’s unique identifier. Must be an open branch on this agent.
Response
string | null
The dev version the preview ran against. Pass this unchanged to Rebase Agent Branch.
null when the agent has no dev versions.boolean
true when the branch’s base is already dev’s head (or the agent has no dev versions), so there is nothing to rebase and a merge would fast-forward. changes and conflicts are empty in that case.integer
Number of entries in
changes.array
Dev-side edits the branch did not touch. They merge in automatically on rebase; nothing is required from you.
Show change object
Show change object
string
Stable identifier,
kind:key or kind:key#path.string
One of
node, edge, setting, contact, knowledge.string
The node or edge ID, or the
settings, contact, or knowledge field name.string
Dot path to the changed value inside that unit. Empty string when the whole unit changed, such as an added or deleted node.
array
Display labels aligned with
path, with element IDs replaced by names where available.string
Human-readable name of the unit, such as a node’s name or a setting’s field name.
any
The value at
path on the branch’s base. Omitted when dev added the value.any
Dev’s current value at
path. Omitted when dev deleted the value.array
Values changed differently on both sides. Each needs a resolution before the rebase succeeds; key your
resolutions map by the conflict’s id.Show conflict object
Show conflict object
string
Stable identifier,
kind:key or kind:key#path. Use it as the key in the resolutions body of Rebase Agent Branch.string
One of
node, edge, setting, contact, knowledge.string
The node or edge ID, or the
settings, contact, or knowledge field name.string
Dot path to the conflicting value inside that unit. Empty string when the whole unit conflicts, such as one side deleting a node the other edited.
array
Display labels aligned with
path.string
Human-readable name of the unit.
any
The value on the branch’s base. Omitted when both sides added the value.
any
Dev’s value. Omitted when dev deleted it.
any
The branch’s value. Omitted when the branch deleted it.
null | array
null on success, or a list of error objects if the request failed.{
"data": {
"dev_head_version_id": "50dc2b1d-854f-4403-8c26-e845238cc03b",
"up_to_date": false,
"auto_merged": 1,
"changes": [
{
"id": "node:40f4b50d-46a3-4235-99b7-09a299ce628c#data.rule",
"kind": "node",
"key": "40f4b50d-46a3-4235-99b7-09a299ce628c",
"path": "data.rule",
"path_labels": ["data", "rule"],
"label": "Verify account",
"base": "Ask for the account number and confirm the last four digits.",
"theirs": "Ask for the account number, then confirm the last four digits and the billing zip code."
}
],
"conflicts": [
{
"id": "setting:systemPrompt",
"kind": "setting",
"key": "systemPrompt",
"path": "",
"path_labels": [],
"label": "systemPrompt",
"base": "You are the front desk assistant for Northwind Dental.",
"theirs": "You are the front desk assistant for Northwind Dental. Keep answers under two sentences.",
"ours": "You are the scheduling assistant for Northwind Dental. Always offer the next two open slots."
}
]
},
"errors": null
}
{
"data": {
"dev_head_version_id": "50dc2b1d-854f-4403-8c26-e845238cc03b",
"up_to_date": true,
"auto_merged": 0,
"changes": [],
"conflicts": []
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Agent or branch not found"
}
]
}
Docs for agents: llms.txt
Was this page helpful?