curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/github/connect \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--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 = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {api_key: '<api-key>', '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 => [
"Content-Type: application/json",
"api_key: <api-key>"
],
]);
$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("api_key", "<api-key>")
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("api_key", "<api-key>")
.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["api_key"] = '<api-key>'
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"
}Connect a GitHub repository
Creates a new private GitHub repository and connects the app to it.
Only the app’s owner can connect a repository, and the workspace plan has to include the GitHub integration. An app that already has a connection can’t connect again, and this API can’t disconnect one. You do that in the Base44 online app editor.
The call creates the repository, 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 any of the rest fails, Base44 undoes the connection but leaves the 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.
From then on the repository is where the app’s code lives. Base44 pushes each change to it, 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 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--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 = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {api_key: '<api-key>', '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 => [
"Content-Type: application/json",
"api_key: <api-key>"
],
]);
$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("api_key", "<api-key>")
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("api_key", "<api-key>")
.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["api_key"] = '<api-key>'
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"
}Authorizations
Personal API key.
Path Parameters
ID of the app to connect to a GitHub repository.
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"
Name for the new repository. 1 to 100 characters made of letters, digits, hyphens, underscores or periods, starting and ending with a letter or digit, and it must not already exist on the account.
"lead-tracker"
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 returned by the workspace installations listing. Provide either this or installation_id.
Description for the new repository. Defaults to the app's name.
"Sales lead tracker"
Response
The repository that was created and connected.
Result of connecting a repository.
ID of the connection Base44 stored for this app.
"6890b1c4f2a7e3105d8a4472"
URL of the repository on GitHub.
"https://github.com/base44/lead-tracker"
Full repository name, as owner/repo.
"base44/lead-tracker"
URLs and CLI command for cloning the new repository.
Show child attributes
Show child attributes
Default branch of the new repository. Base44 pushes the app's code to this branch.
"main"
Was this page helpful?