curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/github/connect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"org_name": "base44",
"repo_name": "lead-tracker",
"installation_id": "58231904",
"workspace_installation_id": "<string>",
"description": "Sales lead tracker"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/github/connect"
payload = {
"org_name": "base44",
"repo_name": "lead-tracker",
"installation_id": "58231904",
"workspace_installation_id": "<string>",
"description": "Sales lead tracker"
}
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({
org_name: 'base44',
repo_name: 'lead-tracker',
installation_id: '58231904',
workspace_installation_id: '<string>',
description: 'Sales lead tracker'
})
};
fetch('https://app.base44.com/api/apps/{app_id}/github/connect', 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/connect",
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([
'org_name' => 'base44',
'repo_name' => 'lead-tracker',
'installation_id' => '58231904',
'workspace_installation_id' => '<string>',
'description' => 'Sales lead tracker'
]),
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}/github/connect"
payload := strings.NewReader("{\n \"org_name\": \"base44\",\n \"repo_name\": \"lead-tracker\",\n \"installation_id\": \"58231904\",\n \"workspace_installation_id\": \"<string>\",\n \"description\": \"Sales lead tracker\"\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}/github/connect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"org_name\": \"base44\",\n \"repo_name\": \"lead-tracker\",\n \"installation_id\": \"58231904\",\n \"workspace_installation_id\": \"<string>\",\n \"description\": \"Sales lead tracker\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/github/connect")
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 \"org_name\": \"base44\",\n \"repo_name\": \"lead-tracker\",\n \"installation_id\": \"58231904\",\n \"workspace_installation_id\": \"<string>\",\n \"description\": \"Sales lead tracker\"\n}"
response = http.request(request)
puts response.read_body{
"connection_id": "6890b1c4f2a7e3105d8a4472",
"repo_url": "https://github.com/base44/lead-tracker",
"repo_full_name": "base44/lead-tracker",
"clone_urls": {
"https": "https://github.com/base44/lead-tracker.git",
"ssh": "git@github.com:base44/lead-tracker.git",
"gh_cli": "gh repo clone base44/lead-tracker"
},
"default_branch": "main"
}{
"error": {
"code": "database_unavailable",
"message": "Database temporarily unavailable, please retry",
"details": {}
}
}Connect an app to GitHub
Connects the app to a GitHub repository.
For Base Code apps, this attaches to an existing repository without creating one or pushing code to it. For other apps, this creates a new private repository and publishes the app’s current code.
Only the app’s owner can connect a repository, and the workspace plan has to include the GitHub integration, except for a Base Code app, which needs no plan. A workspace API key acts as the workspace owner, so it can connect only apps the workspace owner owns, and only through workspace_installation_id on a GitHub organization. An app that already has a connection can’t connect again until you disconnect it.
When creating a repository, the call installs the webhook that tells Base44 about new commits and pushes the app’s current code as the first commit. The response comes back only after all of that finishes. The webhook is the one step that can fail without failing the connection, so check webhook_active in Get GitHub connection afterwards.
If repository creation or the initial code push fails, Base44 undoes the connection but leaves any repository it already created on GitHub. Delete that repository or send a different repo_name before you retry. Check Get GitHub connection first, because a failure late in the call can leave the connection in place.
For the new-repository flow, Base44 pushes each change to GitHub, and you bring work done in GitHub back with Pull changes from GitHub.
curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/github/connect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"org_name": "base44",
"repo_name": "lead-tracker",
"installation_id": "58231904",
"workspace_installation_id": "<string>",
"description": "Sales lead tracker"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/github/connect"
payload = {
"org_name": "base44",
"repo_name": "lead-tracker",
"installation_id": "58231904",
"workspace_installation_id": "<string>",
"description": "Sales lead tracker"
}
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({
org_name: 'base44',
repo_name: 'lead-tracker',
installation_id: '58231904',
workspace_installation_id: '<string>',
description: 'Sales lead tracker'
})
};
fetch('https://app.base44.com/api/apps/{app_id}/github/connect', 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/connect",
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([
'org_name' => 'base44',
'repo_name' => 'lead-tracker',
'installation_id' => '58231904',
'workspace_installation_id' => '<string>',
'description' => 'Sales lead tracker'
]),
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}/github/connect"
payload := strings.NewReader("{\n \"org_name\": \"base44\",\n \"repo_name\": \"lead-tracker\",\n \"installation_id\": \"58231904\",\n \"workspace_installation_id\": \"<string>\",\n \"description\": \"Sales lead tracker\"\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}/github/connect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"org_name\": \"base44\",\n \"repo_name\": \"lead-tracker\",\n \"installation_id\": \"58231904\",\n \"workspace_installation_id\": \"<string>\",\n \"description\": \"Sales lead tracker\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/github/connect")
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 \"org_name\": \"base44\",\n \"repo_name\": \"lead-tracker\",\n \"installation_id\": \"58231904\",\n \"workspace_installation_id\": \"<string>\",\n \"description\": \"Sales lead tracker\"\n}"
response = http.request(request)
puts response.read_body{
"connection_id": "6890b1c4f2a7e3105d8a4472",
"repo_url": "https://github.com/base44/lead-tracker",
"repo_full_name": "base44/lead-tracker",
"clone_urls": {
"https": "https://github.com/base44/lead-tracker.git",
"ssh": "git@github.com:base44/lead-tracker.git",
"gh_cli": "gh repo clone base44/lead-tracker"
},
"default_branch": "main"
}{
"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.
Scopes
Body
Request to connect a repository.
Exactly one of installation_id or workspace_installation_id must be provided.
GitHub username or organization to create the repository under, as returned in login by List GitHub organizations.
"base44"
ID of the Base44 GitHub App installation on that account, as returned in installation_id by List GitHub organizations. Provide either this or workspace_installation_id.
"58231904"
ID of a GitHub installation connected to the app's workspace, as id in List workspace GitHub installations. Provide either this or installation_id.
Response
The repository connected to the app.
Result of connecting a repository.
Was this page helpful?