curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/github/reconnect \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.base44.com/api/apps/{app_id}/github/reconnect"
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}/github/reconnect', 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}/github/reconnect",
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}/github/reconnect"
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}/github/reconnect")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/github/reconnect")
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{
"direction": "base44_to_github",
"repo_full_name": "base44/lead-tracker",
"repo_url": "https://github.com/base44/lead-tracker",
"base44_head": "4c7e1f90ab3d5628e1a0f7b24c9d8e6350a1b2c4",
"github_head": "9f2c1ab7d4e58036bb1f4c0a7de92b41c0d5e8a3",
"sync": {
"synced": true,
"already_up_to_date": false,
"commits_pulled": 2,
"latest_commit_hash": "4c7e1f90ab3d5628e1a0f7b24c9d8e6350a1b2c4",
"commits": [
{
"author_email": "dana@example.com",
"author_name": "Dana Levi",
"message": "Fix the lead scoring rounding",
"sha": "4c7e1f90ab3d5628e1a0f7b24c9d8e6350a1b2c4",
"short_sha": "4c7e1f9",
"timestamp": "2026-08-15T09:08:41+00:00",
"url": "https://github.com/base44/lead-tracker/commit/4c7e1f90ab3d5628e1a0f7b24c9d8e6350a1b2c4"
}
],
"files_summary": {
"total_files": 7,
"files_with_content": 6,
"files_metadata_only": 1,
"files_deleted": 1,
"total_additions": 214,
"total_deletions": 31
},
"error": "merge_conflict",
"error_message": "Merge conflict while applying the pulled commits",
"duration_ms": 4120
}
}Reconnect a GitHub repository
Reconnects the app to the GitHub repository it was disconnected from.
Reconnecting works only for an app that a user disconnected. Check previous_repository in Get GitHub connection first to see whether the app has a repository to reconnect to.
Base44 compares the app’s history with the repository’s default branch and brings whichever side is behind up to date:
- When they match, nothing moves.
- When the app has newer commits, Base44 pushes them to the repository.
- When the repository has newer commits, Base44 pulls them into the app.
When both sides have new commits, or their histories are unrelated, the reconnect is refused and the app stays disconnected. A successful reconnect also turns automatic sync back on, copies the app’s open branches to the repository, and installs a webhook that tells Base44 about new commits.
Installing that webhook can fail without failing the reconnect, so check webhook_active in Get GitHub connection afterwards. If you lost the response, check Get GitHub connection before you retry. A reconnect that already succeeded answers a retry with no_previous_repository.
If the pull from the repository fails, the reconnect still succeeds and the failure is reported in sync. Retry the pull with Pull changes from GitHub.
curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/github/reconnect \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.base44.com/api/apps/{app_id}/github/reconnect"
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}/github/reconnect', 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}/github/reconnect",
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}/github/reconnect"
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}/github/reconnect")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/github/reconnect")
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{
"direction": "base44_to_github",
"repo_full_name": "base44/lead-tracker",
"repo_url": "https://github.com/base44/lead-tracker",
"base44_head": "4c7e1f90ab3d5628e1a0f7b24c9d8e6350a1b2c4",
"github_head": "9f2c1ab7d4e58036bb1f4c0a7de92b41c0d5e8a3",
"sync": {
"synced": true,
"already_up_to_date": false,
"commits_pulled": 2,
"latest_commit_hash": "4c7e1f90ab3d5628e1a0f7b24c9d8e6350a1b2c4",
"commits": [
{
"author_email": "dana@example.com",
"author_name": "Dana Levi",
"message": "Fix the lead scoring rounding",
"sha": "4c7e1f90ab3d5628e1a0f7b24c9d8e6350a1b2c4",
"short_sha": "4c7e1f9",
"timestamp": "2026-08-15T09:08:41+00:00",
"url": "https://github.com/base44/lead-tracker/commit/4c7e1f90ab3d5628e1a0f7b24c9d8e6350a1b2c4"
}
],
"files_summary": {
"total_files": 7,
"files_with_content": 6,
"files_metadata_only": 1,
"files_deleted": 1,
"total_additions": 214,
"total_deletions": 31
},
"error": "merge_conflict",
"error_message": "Merge conflict while applying the pulled commits",
"duration_ms": 4120
}
}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.
Path Parameters
ID of the app to reconnect to the GitHub repository it was disconnected from.
Response
The app is connected to its repository again.
Which side Base44 brought up to date. The value is one of:
none: The two already matched.base44_to_github: Base44 pushed the app's newer commits.github_to_base44: Base44 pulled the repository's newer commits.
none, base44_to_github, github_to_base44 "base44_to_github"
Full repository name, as owner/repo.
"base44/lead-tracker"
URL of the repository on GitHub.
"https://github.com/base44/lead-tracker"
The app's latest commit when the reconnect started.
"4c7e1f90ab3d5628e1a0f7b24c9d8e6350a1b2c4"
Head of the repository's default branch when the reconnect started.
"9f2c1ab7d4e58036bb1f4c0a7de92b41c0d5e8a3"
Outcome of pulling the repository's newer commits into the app, or null unless direction is github_to_base44.
Show child attributes
Show child attributes
Was this page helpful?