curl --request GET \
--url https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/sync-status \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/sync-status"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/sync-status', 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}/sync-status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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}/sync-status"
req, _ := http.NewRequest("GET", 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.get("https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/sync-status")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/sync-status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"new_main_message_count": 2,
"main_code_changed": true,
"conflict_state": "unavailable",
"sync_state": "idle",
"blocked_reason": "app_processing"
}Get branch sync status
Returns how far an active branch is behind main, whether updating it from main is expected to conflict, and whether an update is running. Check it before you call Update branch from main, and poll it while an update runs.
An update that has been running for more than 15 minutes with nothing working on the branch counts as stuck. This endpoint rolls a stuck update back and returns the branch to idle, so it can be updated again.
This endpoint is limited to 120 requests per minute.
curl --request GET \
--url https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/sync-status \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/sync-status"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/sync-status', 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}/sync-status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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}/sync-status"
req, _ := http.NewRequest("GET", 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.get("https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/sync-status")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/sync-status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"new_main_message_count": 2,
"main_code_changed": true,
"conflict_state": "unavailable",
"sync_state": "idle",
"blocked_reason": "app_processing"
}Authorizations
Personal access token, sent as Authorization: Bearer <token>.
Response
How the branch stands against main.
How the branch stands against main.
How many chat messages people sent on main since the branch was created or last updated from main.
2
true when main's code changed since the branch was created or last updated from main.
true
Whether updating the branch from main is expected to conflict. clear when main's code hasn't changed, so an update can't conflict. overlap when the update is expected to conflict, or while conflicts from an update are being resolved. unavailable when Base44 can't tell, including while an update runs. Once main's code has changed, it's never clear, even when the update would apply cleanly.
clear, overlap, unavailable "unavailable"
idle when no update is running. updating while main's changes are being applied, resolving while the AI resolves conflicts, and needs_input when the AI needs an answer to finish resolving them. Answer it in the Base44 editor. Until the state is back to idle, the branch can't be merged or deleted.
idle, updating, resolving, needs_input "idle"
Why Update branch from main would be refused right now: app_processing while the AI is working on main, and branch_processing while it's working on the branch. null when neither applies. An update is also refused while sync_state is resolving or needs_input.
app_processing, branch_processing "app_processing"
Was this page helpful?