Link an existing GitHub repository
Changed on<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>
Connects an app created with the Base44 CLI to the GitHub repository that already holds its code. Base44 adopts the repository as it is, without creating one or pushing code to it.
The repository's default branch must be main, and its base44/config.jsonc must name this app. From then on the repository is where the app's code lives. Entities, agents, and functions you deployed with the CLI are replaced by their versions in the repository.
Before the call can succeed, the app's owner needs:
- Their GitHub account connected to Base44. This is done once, in Base44.
- The Base44 GitHub App installed on the repository with write access.
When either is missing, send the user to the link in the error's details, connect_url or install_url, then repeat the same call. A refused call changes nothing. If a response is lost, check Get GitHub connection before retrying, because a repeat after a successful link is refused.
Base44 imports the repository's code in the background after the call returns. Pull changes from GitHub reports the app as already up to date once the import has finished.
Request
- Base URLhttps://app.base44.com
- URLhttps://app.base44.com/api/apps/{app_id}/github/link-existing
- AuthHTTP bearer
Path parameters
ID of the app to connect to a GitHub repository.
Request body
Example request
{
"repo_full_name": "acme/lead-tracker"
}Response
The connection Base44 stored for the app.
Example response
{
"connection_id": "6890b1c4f2a7e3105d8a4472",
"repo_full_name": "acme/lead-tracker",
"repo_url": "https://github.com/acme/lead-tracker",
"default_branch": "main",
"last_synced_commit": "3f5d19c8cfc920e65313a0c5174e7e052d13bb2c"
}Changes
- info
endpoint added
- info