> ## 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.

> ## Agent Instructions
> Internal links on these pages omit the .md extension. Append .md to a docs page URL, or send an Accept: text/markdown header, to get that page as markdown.

# Get branch sync status

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

Returns how far an active branch is behind main, whether updating it from main is expected to conflict, and whether an update is running. Check it before you call [Update branch from main](/api-reference/update-branch-from-main), and poll it while an update runs.

An update that has been running for more than 15 minutes with nothing working on the branch counts as stuck. This endpoint rolls a stuck update back and returns the branch to `idle`, so it can be updated again.

This endpoint is limited to 120 requests per minute.

<Note>This endpoint accepts a personal API key belonging to a user with editor access to the app. A read-only key is refused, and workspace API keys are not accepted.</Note>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json get /api/apps/{app_id}/branches/{branch_id}/sync-status
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}/branches/{branch_id}/sync-status:
    get:
      summary: Get branch sync status
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Returns how far an active branch is behind main, whether updating it
        from main is expected to conflict, and whether an update is running.
        Check it before you call [Update branch from
        main](/api-reference/update-branch-from-main), and poll it while an
        update runs.


        An update that has been running for more than 15 minutes with nothing
        working on the branch counts as stuck. This endpoint rolls a stuck
        update back and returns the branch to `idle`, so it can be updated
        again.


        This endpoint is limited to 120 requests per minute.


        <Note>This endpoint accepts a personal API key belonging to a user with
        editor access to the app. A read-only key is refused, and workspace API
        keys are not accepted.</Note>
      operationId: >-
        get_branch_sync_status_api_apps__app_id__branches__branch_id__sync_status_get
      parameters:
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            description: >-
              ID of the branch, as returned by [List
              branches](/api-reference/list-branches).
            title: Branch Id
          description: >-
            ID of the branch, as returned by [List
            branches](/api-reference/list-branches).
          example: 68f1a2b3c4d5e6f708192a3b
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app the branch belongs to.
            title: App Id
          description: ID of the app the branch belongs to.
          example: 6820f3a4e7b91d003c45a1f2
      responses:
        '200':
          description: How the branch stands against main.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BranchSyncStatus'
        '401':
          description: Missing or invalid credentials.
        '403':
          description: >-
            You don't have editor access to this app, the app is blocked, your
            API key is read-only, or you used a workspace API key.
        '404':
          description: App not found, or the app has no active branch with this ID.
        '429':
          description: >-
            Rate limit exceeded. The base limit is 120 requests per minute. See
            [Rate
            limits](/developers/references/apps-api/get-started/rate-limits) for
            the multiplier your plan gets.
components:
  schemas:
    BranchSyncStatus:
      properties:
        new_main_message_count:
          type: integer
          title: New Main Message Count
          description: >-
            How many chat messages people sent on main since the branch was
            created or last updated from main.
          example: 2
        main_code_changed:
          type: boolean
          title: Main Code Changed
          description: >-
            `true` when main's code changed since the branch was created or last
            updated from main.
          example: true
        conflict_state:
          type: string
          enum:
            - clear
            - overlap
            - unavailable
          title: Conflict State
          description: >-
            Whether updating the branch from main is expected to conflict.
            `clear` when main's code hasn't changed, so an update can't
            conflict. `overlap` when the update is expected to conflict, or
            while conflicts from an update are being resolved. `unavailable`
            when Base44 can't tell, including while an update runs. Once main's
            code has changed, it's never `clear`, even when the update would
            apply cleanly.
          example: unavailable
        sync_state:
          type: string
          enum:
            - idle
            - updating
            - resolving
            - needs_input
          title: Sync State
          description: >-
            `idle` when no update is running. `updating` while main's changes
            are being applied, `resolving` while the AI resolves conflicts, and
            `needs_input` when the AI needs an answer to finish resolving them.
            Answer it in the Base44 editor. Until the state is back to `idle`,
            the branch can't be merged or deleted.
          example: idle
        blocked_reason:
          anyOf:
            - type: string
              enum:
                - app_processing
                - branch_processing
            - type: 'null'
          title: Blocked Reason
          description: >-
            Why [Update branch from
            main](/api-reference/update-branch-from-main) would be refused right
            now: `app_processing` while the AI is working on main, and
            `branch_processing` while it's working on the branch. `null` when
            neither applies. An update is also refused while `sync_state` is
            `resolving` or `needs_input`.
          example: app_processing
      type: object
      required:
        - new_main_message_count
        - main_code_changed
        - conflict_state
        - sync_state
        - blocked_reason
      title: BranchSyncStatus
      description: How the branch stands against main.
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: 'Personal access token, sent as `Authorization: Bearer <token>`.'

````

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