Pull changes from GitHub

Changed on

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Pulls new commits from the connected GitHub repository into the app.

Call this after someone pushes to the repository, or before you read the app's code, so Base44 is working from the latest version. It applies only what is new since the last pull, and does nothing when the app is already up to date.

A failed pull is reported in the response body rather than as an error, so read synced and error. Base44 doesn't record the commits it couldn't apply, so the next pull picks them up again rather than skipping past them. A pull that fails late can already have added a chat message or a checkpoint, and retrying repeats those.

A merge conflict means the repository's commits and the app's own changes touch the same lines. Hand it to Resolve GitHub sync conflicts.

When Base44 can't read the repository's latest commit, for example because the branch no longer exists on GitHub or GitHub didn't respond, error is github_check_failed and nothing is pulled.

Set branch_id to pull into a branch instead of main. Base44 pulls the new commits on the branch's own ref in the repository, and leaves main alone. A merge conflict on a branch comes back as merge_conflict without conflict_details, and Resolve GitHub sync conflicts only resolves main's conflicts, so resolve it in the repository and pull again. A merged branch has nothing left to pull, so the response reports it as already up to date.

Some apps, such as Base Code apps, don't pull new commits straight into main. Base44 first builds the new commits in a separate copy of the app. Main gets them only when that build passes, so a broken commit never breaks the live app. For these apps, a pull of main starts that build and returns build_check_started: true without pulling anything yet. Pulls into a branch work as usual.

<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/sync

Request

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

Path parameters

app_idstring required

ID of the app whose GitHub sync this affects.

Query parameters

branch_idstring

ID of the branch to work on, as returned by List branches. Omit it to work on the app's main branch.

Response

The outcome of the pull.

syncedboolean required

Whether this call applied new commits to the app.

already_up_to_dateboolean required

Whether the repository's head was already the last commit Base44 pulled, so there was nothing to do.

commits_pulledinteger required

How many commits commits holds, so commits Base44 pushed itself aren't counted. The value is 0 when nothing was pulled.

latest_commit_hashstring nullable

Repository head after the pull, or null when nothing was pulled.

errorstring nullable

Why the pull didn't happen, or null when it succeeded. See Pull error codes for the possible values.

error_messagestring nullable

Human-readable explanation of error, or null when the pull succeeded.

duration_msinteger nullable

How long the pull took, in milliseconds, or null when Base44 recorded no duration for it.

build_check_startedboolean

Whether Base44 started a build of the new commits instead of pulling them straight into main. When true, nothing was pulled yet. Main gets the new commits only after the build passes.

Example response

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