> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base44.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pull changes from GitHub

> <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](/api-reference/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](/developers/references/app-management/get-started/concepts#branches) 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](/api-reference/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>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/apps/{app_id}/github/sync
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - PersonalAccessTokenAuth: []
paths:
  /api/apps/{app_id}/github/sync:
    post:
      summary: Pull changes from GitHub
      description: >-
        <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](/api-reference/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](/developers/references/app-management/get-started/concepts#branches)
        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](/api-reference/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>
      operationId: sync_github_to_base44_api_apps__app_id__github_sync_post
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app whose GitHub sync this affects.
            title: App Id
          description: ID of the app whose GitHub sync this affects.
          example: 6820f3a4e7b91d003c45a1f2
        - name: branch_id
          in: query
          required: false
          schema:
            type: string
            description: >-
              ID of the branch to work on, as returned by [List
              branches](/api-reference/list-branches). Omit it to work on the
              app's main branch.
            title: Branch Id
          description: >-
            ID of the branch to work on, as returned by [List
            branches](/api-reference/list-branches). Omit it to work on the
            app's main branch.
          example: 68f1a2b3c4d5e6f708192a3b
      responses:
        '200':
          description: The outcome of the pull.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GitHubPullResult'
        '401':
          description: Missing or invalid credentials.
        '403':
          description: >-
            You don't have access to this app. The code is
            `git_sync_not_supported` when the app's type doesn't support Git
            sync.
        '404':
          description: App not found, or no branch you can see has this `branch_id`.
        '429':
          description: >-
            Rate limit exceeded. The base limit is 20 requests per minute, and
            this endpoint shares it with [Resolve GitHub sync
            conflicts](/api-reference/resolve-github-sync-conflicts). See [Rate
            limits](/developers/references/apps-api/get-started/rate-limits) for
            the multiplier your plan gets.
        '503':
          description: >-
            Database temporarily unavailable (`database_unavailable`): the data
            cluster did not answer in time. Retry after the `Retry-After`
            seconds.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
              examples:
                database_unavailable:
                  summary: database_unavailable
                  value:
                    error:
                      code: database_unavailable
                      message: Database temporarily unavailable, please retry
                      details: {}
      security:
        - PersonalAccessTokenAuth:
            - full_access
        - WorkspaceApiKeyAuth:
            - full_access
        - WorkspaceApiKeyBearerAuth:
            - full_access
components:
  schemas:
    GitHubPullResult:
      properties:
        synced:
          type: boolean
          title: Synced
          description: Whether this call applied new commits to the app.
          example: true
        already_up_to_date:
          type: boolean
          title: Already Up To Date
          description: >-
            Whether the repository's head was already the last commit Base44
            pulled, so there was nothing to do.
          example: false
        commits_pulled:
          type: integer
          title: Commits Pulled
          description: >-
            How many commits `commits` holds, so commits Base44 pushed itself
            aren't counted. The value is `0` when nothing was pulled.
          example: 2
        latest_commit_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Latest Commit Hash
          description: Repository head after the pull, or `null` when nothing was pulled.
          example: 4c7e1f90ab3d5628e1a0f7b24c9d8e6350a1b2c4
        commits:
          items:
            $ref: '#/components/schemas/GitHubPulledCommit'
          type: array
          title: Commits
          description: >-
            The commits this call applied, oldest first. Commits Base44 pushed
            itself are left out, so a pull of only those comes back with an
            empty list.
          example:
            - 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:
          anyOf:
            - $ref: '#/components/schemas/GitHubPulledFiles'
            - type: 'null'
          description: >-
            Change counts for the pulled commits, or `null` when nothing was
            pulled.
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: >-
            Why the pull didn't happen, or `null` when it succeeded. See [Pull
            error
            codes](/developers/references/apps-api/sections/github#pull-error-codes)
            for the possible values.
          example: merge_conflict
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
          description: >-
            Human-readable explanation of `error`, or `null` when the pull
            succeeded.
          example: Merge conflict while applying the pulled commits
        duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration Ms
          description: >-
            How long the pull took, in milliseconds, or `null` when Base44
            recorded no duration for it.
          example: 4120
        build_check_started:
          type: boolean
          title: Build Check Started
          description: >-
            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.
          default: false
          example: false
      type: object
      required:
        - synced
        - already_up_to_date
        - commits_pulled
      title: GitHubPullResult
      description: Outcome of a pull from the connected repository.
    StandardErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/StandardError'
          description: What went wrong.
      type: object
      required:
        - error
      title: StandardErrorEnvelope
      description: The error body returned in the standard envelope.
    GitHubPulledCommit:
      properties:
        sha:
          type: string
          title: Sha
          description: Full commit SHA.
          example: 4c7e1f90ab3d5628e1a0f7b24c9d8e6350a1b2c4
        short_sha:
          type: string
          title: Short Sha
          description: Short form of the commit SHA.
          example: 4c7e1f9
        message:
          type: string
          title: Message
          description: Commit message.
          example: Fix the lead scoring rounding
        author_name:
          type: string
          title: Author Name
          description: >-
            The author's GitHub username when GitHub reports one, otherwise the
            name recorded in the commit.
          example: dana-levi
        author_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Email
          description: >-
            Email recorded as the commit's author, or `null` when GitHub doesn't
            report one.
          example: dana@example.com
        timestamp:
          type: string
          title: Timestamp
          description: When the commit was authored, in ISO 8601.
          example: '2026-08-15T09:08:41+00:00'
        url:
          type: string
          title: Url
          description: URL of the commit on GitHub.
          example: >-
            https://github.com/base44/lead-tracker/commit/4c7e1f90ab3d5628e1a0f7b24c9d8e6350a1b2c4
      type: object
      required:
        - sha
        - short_sha
        - message
        - author_name
        - timestamp
        - url
      title: GitHubPulledCommit
      description: One commit brought in by a pull.
    GitHubPulledFiles:
      properties:
        total_files:
          type: integer
          title: Total Files
          description: Files changed across the pulled commits.
          example: 7
        files_with_content:
          type: integer
          title: Files With Content
          description: Changed files whose new content Base44 applied to the app.
          example: 6
        files_metadata_only:
          type: integer
          title: Files Metadata Only
          description: >-
            Changed files Base44 recorded without their content, because GitHub
            didn't return a usable diff for them.
          example: 1
        files_deleted:
          type: integer
          title: Files Deleted
          description: Files removed from the app by the pull.
          example: 1
        total_additions:
          type: integer
          title: Total Additions
          description: Lines added across the pulled commits.
          example: 214
        total_deletions:
          type: integer
          title: Total Deletions
          description: Lines removed across the pulled commits.
          example: 31
      type: object
      required:
        - total_files
        - files_with_content
        - files_metadata_only
        - files_deleted
        - total_additions
        - total_deletions
      title: GitHubPulledFiles
      description: How much the pulled commits changed.
    StandardError:
      properties:
        code:
          type: string
          title: Code
          description: >-
            Stable machine-readable cause of the failure. Match on this, not on
            `message`.
          example: not_found
        message:
          type: string
          title: Message
          description: Human-readable explanation. It isn't a stable contract.
          example: App not found
        details:
          additionalProperties: true
          type: object
          title: Details
          description: >-
            Structured context for the failure, or an empty object when there's
            none.
          example: {}
      type: object
      required:
        - code
        - message
      title: StandardError
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: >-
        Personal access token, sent as `Authorization: Bearer <token>`. Each
        operation lists the permission it needs: `read_only` or `full_access`. A
        full-access token can call every operation. A read-only token can call
        only the operations that list `read_only`; anything else returns 403
        `read_only_credential_route_not_allowed`.
    WorkspaceApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: >-
        Workspace API key, sent as `api_key: <key>`. Each operation that accepts
        one lists what the key needs: a permission, `read_only` or
        `full_access`, like a personal access token, or a scope. A key without
        the scope gets 403 `workspace_api_key_scope_required`.
    WorkspaceApiKeyBearerAuth:
      type: http
      scheme: bearer
      description: >-
        Workspace API key, sent as `Authorization: Bearer <key>`. Accepted
        wherever `api_key` is, with the same permission.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.