Connect a GitHub repository
<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>
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.
Path parameters
ID of the app to connect to a GitHub repository.
ID of the app to connect to a GitHub repository.
Request body
Example request
{
"org_name": "base44",
"repo_name": "lead-tracker",
"installation_id": "58231904",
"description": "Sales lead tracker"
}Response
The repository that was created and connected.
Example response
{
"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"
}