curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/merge \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/merge"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/merge', 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://app.base44.com/api/apps/{app_id}/branches/{branch_id}/merge",
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://app.base44.com/api/apps/{app_id}/branches/{branch_id}/merge"
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://app.base44.com/api/apps/{app_id}/branches/{branch_id}/merge")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/merge")
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{
"branch": {
"id": "68f1a2b3c4d5e6f708192a3b",
"app_id": "6820f3a4e7b91d003c45a1f2",
"branch_name": "add-contact-form",
"status": "active",
"run_state": {
"state": "ready",
"details": "Restoring checkpoint",
"last_updated_date": "2026-09-28T10:18:40"
},
"code_state": "changed",
"base_checkpoint_id": "6886b8d390dc7e2f4a2c91b3",
"created_by_id": "68a0c1d2e3f4a5b6c7d8e9f0",
"created_by_name": "Jane Doe",
"created_date": "2026-09-28T10:15:00",
"merged_at": "2026-09-29T08:02:11",
"merged_by_id": "68a0c1d2e3f4a5b6c7d8e9f0",
"static_preview_url": "https://preview--6820f3a4e7b91d003c45a1f2--b-d8c647b.base44.app"
},
"merge_message_id": "7f3a1c88-52d4-4a0e-9b31-2c6f0d8e4a19"
}Merge branch
Merges an active branch into the app’s main branch. Base44 merges the branch’s code into main, applies its entity and backend function changes to main, saves a checkpoint, and adds a message to main’s conversation that summarizes the merge. The branch’s status then becomes merged, and it can’t be changed after that. This works while main branch protection is on.
The request returns once the merge is done. A 409 leaves the branch active and main unchanged. Its extra_data.reason tells you what to do:
branch_has_no_changes: the branch has no code changes to merge.branch_merge_conflict: the branch conflicts with main. Update the branch from main to resolve the conflicts, then merge again.app_processingorbranch_processing: the AI is working on main or on the branch. Try again once it’s done.branch_sync_in_progress: the branch is being updated from main. Try again once Get branch sync status showssync_stateasidle.branch_pending_commit_wait_failed: the branch’s latest changes are still being saved. Try again shortly.
In this response, branch.created_by_name is always null. Get branch returns it.
This endpoint is limited to 30 requests per minute, shared with Create branch, Delete branch and Merge branch.
branch_has_no_changes.curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/merge \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/merge"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/merge', 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://app.base44.com/api/apps/{app_id}/branches/{branch_id}/merge",
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://app.base44.com/api/apps/{app_id}/branches/{branch_id}/merge"
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://app.base44.com/api/apps/{app_id}/branches/{branch_id}/merge")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/merge")
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{
"branch": {
"id": "68f1a2b3c4d5e6f708192a3b",
"app_id": "6820f3a4e7b91d003c45a1f2",
"branch_name": "add-contact-form",
"status": "active",
"run_state": {
"state": "ready",
"details": "Restoring checkpoint",
"last_updated_date": "2026-09-28T10:18:40"
},
"code_state": "changed",
"base_checkpoint_id": "6886b8d390dc7e2f4a2c91b3",
"created_by_id": "68a0c1d2e3f4a5b6c7d8e9f0",
"created_by_name": "Jane Doe",
"created_date": "2026-09-28T10:15:00",
"merged_at": "2026-09-29T08:02:11",
"merged_by_id": "68a0c1d2e3f4a5b6c7d8e9f0",
"static_preview_url": "https://preview--6820f3a4e7b91d003c45a1f2--b-d8c647b.base44.app"
},
"merge_message_id": "7f3a1c88-52d4-4a0e-9b31-2c6f0d8e4a19"
}Authorizations
Personal access token, sent as Authorization: Bearer <token>.
Response
The merged branch.
The merged branch.
The branch, now with status set to merged.
Show child attributes
Show child attributes
ID of the message Base44 added to main's conversation to summarize the merge. Find it with Read conversation messages.
"7f3a1c88-52d4-4a0e-9b31-2c6f0d8e4a19"
Was this page helpful?