curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/branches/import-from-repo \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch_name": "feature/checkout"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/branches/import-from-repo"
payload = { "branch_name": "feature/checkout" }
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({branch_name: 'feature/checkout'})
};
fetch('https://app.base44.com/api/apps/{app_id}/branches/import-from-repo', 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/import-from-repo",
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([
'branch_name' => 'feature/checkout'
]),
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://app.base44.com/api/apps/{app_id}/branches/import-from-repo"
payload := strings.NewReader("{\n \"branch_name\": \"feature/checkout\"\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://app.base44.com/api/apps/{app_id}/branches/import-from-repo")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"branch_name\": \"feature/checkout\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/branches/import-from-repo")
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 \"branch_name\": \"feature/checkout\"\n}"
response = http.request(request)
puts response.read_body{
"id": "68f1a2b3c4d5e6f708192a3b",
"app_id": "6820f3a4e7b91d003c45a1f2",
"branch_name": "feature/checkout",
"status": "active",
"code_state": "unchanged",
"created_by_id": "68a0c1d2e3f4a5b6c7d8e9f0",
"created_by_name": "Jane Doe",
"created_date": "2026-09-28T10:15:00"
}{
"error": {
"code": "database_unavailable",
"message": "Database temporarily unavailable, please retry",
"details": {}
}
}Import repository branch
Adds a branch that already exists in an imported app’s GitHub repository as a branch of the app, so you can work on it and open a pull request for it. Use Create branch to start a new branch from main instead.
branch_name is the exact name of the branch in the repository, and it can’t be the repository’s default branch. The branch starts at the commit the repository’s branch points to now. Its own preview starts the first time it’s used.
For a public repository connected without GitHub access, a branch that exists can still be reported as not found.
This endpoint is limited to 30 requests per minute, shared with Create branch, Delete branch, Merge branch and Import repository branch.
api_key query parameter is refused.
curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/branches/import-from-repo \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch_name": "feature/checkout"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/branches/import-from-repo"
payload = { "branch_name": "feature/checkout" }
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({branch_name: 'feature/checkout'})
};
fetch('https://app.base44.com/api/apps/{app_id}/branches/import-from-repo', 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/import-from-repo",
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([
'branch_name' => 'feature/checkout'
]),
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://app.base44.com/api/apps/{app_id}/branches/import-from-repo"
payload := strings.NewReader("{\n \"branch_name\": \"feature/checkout\"\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://app.base44.com/api/apps/{app_id}/branches/import-from-repo")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"branch_name\": \"feature/checkout\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/branches/import-from-repo")
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 \"branch_name\": \"feature/checkout\"\n}"
response = http.request(request)
puts response.read_body{
"id": "68f1a2b3c4d5e6f708192a3b",
"app_id": "6820f3a4e7b91d003c45a1f2",
"branch_name": "feature/checkout",
"status": "active",
"code_state": "unchanged",
"created_by_id": "68a0c1d2e3f4a5b6c7d8e9f0",
"created_by_name": "Jane Doe",
"created_date": "2026-09-28T10:15:00"
}{
"error": {
"code": "database_unavailable",
"message": "Database temporarily unavailable, please retry",
"details": {}
}
}Authorizations
Personal access token, sent as Authorization: Bearer <token>. Each operation lists the permission it needs: read_only or full_access. A full-access token can call every operation. A read-only token can call only the operations that list read_only; anything else returns 403 read_only_credential_route_not_allowed.
Body
Check out a branch that already exists in the repo (imported apps only).
The name is the exact git ref. Git validates the name in the sandbox.
We do not use is_legal_git_ref here — it refuses some names that a
user's repo can have.
Response
The new branch.
A branch of an app.
ID of the main checkpoint the branch started from, or null if the app had no checkpoint yet.
"6886b8d390dc7e2f4a2c91b3"
ID of the session this branch belongs to, or null for a branch Base44 hasn't put in a session yet.
"6820f3a4e7b91d003c45a1f9"
Was this page helpful?