Reconnect 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>

Reconnects the app to the GitHub repository it was disconnected from.

Reconnecting works only for an app that a user disconnected. Check previous_repository in Get GitHub connection first to see whether the app has a repository to reconnect to.

Base44 compares the app's history with the repository's default branch and brings whichever side is behind up to date:

  • When they match, nothing moves.
  • When the app has newer commits, Base44 pushes them to the repository.
  • When the repository has newer commits, Base44 pulls them into the app.

When both sides have new commits, or their histories are unrelated, the reconnect is refused and the app stays disconnected. A successful reconnect also turns automatic sync back on, copies the app's open branches to the repository, and installs a webhook that tells Base44 about new commits.

Installing that webhook can fail without failing the reconnect, so check webhook_active in Get GitHub connection afterwards. If you lost the response, check Get GitHub connection before you retry. A reconnect that already succeeded answers a retry with no_previous_repository.

If the pull from the repository fails, the reconnect still succeeds and the failure is reported in sync. Retry the pull with Pull changes from GitHub.

<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time.</Warning>

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

Request

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

Path parameters

app_idstring required

ID of the app to reconnect to the GitHub repository it was disconnected from.

Response

The app is connected to its repository again.

direction'none' | 'base44_to_github' | 'github_to_base44' required

Which side Base44 brought up to date. The value is one of:

  • none: The two already matched.
  • base44_to_github: Base44 pushed the app's newer commits.
  • github_to_base44: Base44 pulled the repository's newer commits.
repo_full_namestring required

Full repository name, as owner/repo.

repo_urlstring required

URL of the repository on GitHub.

base44_headstring required

The app's latest commit when the reconnect started.

github_headstring required

Head of the repository's default branch when the reconnect started.

Example response

{
  "direction": "base44_to_github",
  "repo_full_name": "base44/lead-tracker",
  "repo_url": "https://github.com/base44/lead-tracker",
  "base44_head": "4c7e1f90ab3d5628e1a0f7b24c9d8e6350a1b2c4",
  "github_head": "9f2c1ab7d4e58036bb1f4c0a7de92b41c0d5e8a3",
  "sync": {
    "synced": true,
    "commits_pulled": 2,
    "latest_commit_hash": "4c7e1f90ab3d5628e1a0f7b24c9d8e6350a1b2c4",
    "commits": [
      {
        "author_email": "dana@example.com",
        "author_name": "Dana Levi",
        "message": "Fix the lead scoring rounding",
        "sha": "4c7e1f90ab3d5628e1a0f7b24c9d8e6350a1b2c4",
        "short_sha": "4c7e1f9",
        "timestamp": "2026-08-15T09:08:41+00:00",
        "url": "https://github.com/base44/lead-tracker/commit/4c7e1f90ab3d5628e1a0f7b24c9d8e6350a1b2c4"
      }
    ],
    "files_summary": {
      "total_files": 7,
      "files_with_content": 6,
      "files_metadata_only": 1,
      "files_deleted": 1,
      "total_additions": 214,
      "total_deletions": 31
    },
    "error": "merge_conflict",
    "error_message": "Merge conflict while applying the pulled commits",
    "duration_ms": 4120
  }
}

Changes

    • info

      added the optional property // to the response with the status

    • info

      the endpoint scheme security PersonalAccessTokenAuth was added to the API