Connect a 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>

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 until you disconnect it.

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.

post/api/apps/{app_id}/github/connect

Request

  • Base URL: https://app.base44.com
  • URL: https://app.base44.com/api/apps/{app_id}/github/connect
  • Auth: HTTP bearer

Path parameters

app_idstring required

ID of the app to connect to a GitHub repository.

Request body

org_namestring required

GitHub username or organization to create the repository under, as returned in login by List GitHub organizations.

repo_namestring required

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.

installation_idstring nullable

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.

workspace_installation_idstring nullable

ID of a GitHub installation connected to the app's workspace, as id in List workspace GitHub installations. Provide either this or installation_id.

descriptionstring nullable

Description for the new repository. Defaults to the app's name.

Example request

{
  "org_name": "base44",
  "repo_name": "lead-tracker",
  "installation_id": "58231904",
  "description": "Sales lead tracker"
}

Response

The repository that was created and connected.

connection_idstring required

ID of the connection Base44 stored for this app.

repo_urlstring required

URL of the repository on GitHub.

repo_full_namestring required

Full repository name, as owner/repo.

default_branchstring required

Default branch of the new repository. Base44 pushes the app's code to this branch.

main_branch_protectedboolean nullable

GitHub-managed main branch protection after connection, or null when the feature is off.

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"
}

Changes

    • info

      the endpoint scheme security PersonalAccessTokenAuth was added to the API

    • info

      added the optional property to the response with the status

    • info

      added the new optional request property

    • info

      the request property became optional

    • info

      request property list-of-types was widened by adding types null to media type application/json