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

# Turn automatic GitHub sync on or off

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

Turns automatic sync between the app and its connected GitHub repository on or off.

Automatic sync brings in commits pushed to the repository from outside Base44. While it's on, the Base44 editor pulls them in as soon as GitHub reports them, as long as someone has the app open in it. While it's off, Base44 ignores those reports, so new commits come in only when someone opens the app in the editor or you call [Pull changes from GitHub](/api-reference/pull-changes-from-github). The setting covers the app's main line and its [branches](/developers/references/app-management/get-started/concepts#branches) alike.

The setting doesn't affect the other direction. Base44 commits every change the builder saves to the repository whether automatic sync is on or off, and [Push changes to GitHub](/api-reference/push-changes-to-github) works either way.

If the repository receives more than 20 pushes within a minute, counting Base44's own, Base44 pauses automatic sync for an hour to stop a sync loop. Pushes during the pause are ignored whatever the setting. When the pause ends, Base44 turns automatic sync back on only if the pause is what turned it off. A setting you chose with this endpoint, before or during the pause, is kept. Turning sync on during a pause doesn't end the pause early.

Anyone with editor access to the app can change the setting. [Reconnect a GitHub repository](/api-reference/reconnect-a-github-repository) turns it back on.

This is limited to 10 requests a minute per app for each workspace's personal API keys, so every key in a workspace shares one allowance. Some workspaces have a different limit.



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/apps/{app_id}/github/sync/toggle
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/toggle:
    post:
      summary: Turn automatic GitHub sync on or off
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Turns automatic sync between the app and its connected GitHub repository
        on or off.


        Automatic sync brings in commits pushed to the repository from outside
        Base44. While it's on, the Base44 editor pulls them in as soon as GitHub
        reports them, as long as someone has the app open in it. While it's off,
        Base44 ignores those reports, so new commits come in only when someone
        opens the app in the editor or you call [Pull changes from
        GitHub](/api-reference/pull-changes-from-github). The setting covers the
        app's main line and its
        [branches](/developers/references/app-management/get-started/concepts#branches)
        alike.


        The setting doesn't affect the other direction. Base44 commits every
        change the builder saves to the repository whether automatic sync is on
        or off, and [Push changes to
        GitHub](/api-reference/push-changes-to-github) works either way.


        If the repository receives more than 20 pushes within a minute, counting
        Base44's own, Base44 pauses automatic sync for an hour to stop a sync
        loop. Pushes during the pause are ignored whatever the setting. When the
        pause ends, Base44 turns automatic sync back on only if the pause is
        what turned it off. A setting you chose with this endpoint, before or
        during the pause, is kept. Turning sync on during a pause doesn't end
        the pause early.


        Anyone with editor access to the app can change the setting. [Reconnect
        a GitHub repository](/api-reference/reconnect-a-github-repository) turns
        it back on.


        This is limited to 10 requests a minute per app for each workspace's
        personal API keys, so every key in a workspace shares one allowance.
        Some workspaces have a different limit.
      operationId: toggle_sync_api_apps__app_id__github_sync_toggle_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
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ToggleSyncRequest'
      responses:
        '200':
          description: The setting was saved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToggleSyncResponse'
        '401':
          description: Missing or invalid credentials.
        '403':
          description: >-
            You don't have editor access to this app, your API key is read-only,
            or you used a workspace API key.
        '404':
          description: App not found, or the app has no active GitHub connection.
        '422':
          description: >-
            The request body is missing a required field, or one of its values
            has the wrong type.
        '429':
          description: >-
            Too many changes to this app's setting in the last minute from
            personal API keys in your workspace.
components:
  schemas:
    ToggleSyncRequest:
      properties:
        enabled:
          type: boolean
          title: Enabled
          description: Turn automatic sync on (`true`) or off (`false`).
          example: false
      type: object
      required:
        - enabled
      title: ToggleSyncRequest
      description: The automatic sync setting to apply.
    ToggleSyncResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: >-
            Always `true`. A change that can't be applied is rejected with an
            error status instead.
          example: true
        sync_enabled:
          type: boolean
          title: Sync Enabled
          description: >-
            Whether automatic sync is now on (`true`) or off (`false`). This is
            the value you sent.
          example: false
      type: object
      required:
        - success
        - sync_enabled
      title: ToggleSyncResponse
      description: The app's automatic sync setting after the change.
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: 'Personal access token, sent as `Authorization: Bearer <token>`.'

````