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

# Get GitHub connection

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

Returns the app's GitHub repository connection, if it has one.

Calling this re-checks the connection against GitHub and tries to repair a broken one, so what it reports can change between two calls even when nobody has touched the app.

An app that never connected and one whose repository was disconnected both report `connected: false`. After a user disconnects the app, `previous_repository` names the repository [Reconnect a GitHub repository](/api-reference/reconnect-a-github-repository) can bring back.



## OpenAPI

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


        Returns the app's GitHub repository connection, if it has one.


        Calling this re-checks the connection against GitHub and tries to repair
        a broken one, so what it reports can change between two calls even when
        nobody has touched the app.


        An app that never connected and one whose repository was disconnected
        both report `connected: false`. After a user disconnects the app,
        `previous_repository` names the repository [Reconnect a GitHub
        repository](/api-reference/reconnect-a-github-repository) can bring
        back.
      operationId: get_connection_status_api_apps__app_id__github_connection_get
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app whose GitHub connection to use.
            title: App Id
          description: ID of the app whose GitHub connection to use.
          example: 6820f3a4e7b91d003c45a1f2
      responses:
        '200':
          description: The app's GitHub connection.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionStatus'
        '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.
        '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:
            - read_only
        - WorkspaceApiKeyAuth:
            - read_only
        - WorkspaceApiKeyBearerAuth:
            - read_only
components:
  schemas:
    ConnectionStatus:
      properties:
        connection_mode:
          anyOf:
            - $ref: '#/components/schemas/GitHubConnectionMode'
            - type: 'null'
          description: Workspace GitHub write model; null when not connected.
        user_github_connected:
          anyOf:
            - type: boolean
            - type: 'null'
          title: User Github Connected
          description: >-
            Whether the current user has a linked GitHub account; computed only
            in per_user mode.
        can_push:
          type: boolean
          title: Can Push
          description: >-
            Whether the connection permits a push attempt under the workspace
            mode. Failed user permission lookups allow an attempt; GitHub
            enforces access.
          default: false
        connected:
          type: boolean
          title: Connected
          description: >-
            Whether the app still has its repository connection, including one
            whose `status` is `error` or `revoked`. The value is `false` only
            when the app never connected and when its repository was
            disconnected.
          example: true
        repo_full_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Repo Full Name
          description: >-
            Full repository name, as `owner/repo`, or `null` when `connected` is
            `false`.
          example: base44/lead-tracker
        repo_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Repo Url
          description: >-
            URL of the repository on GitHub, or `null` when `connected` is
            `false`.
          example: https://github.com/base44/lead-tracker
        clone_urls:
          anyOf:
            - $ref: '#/components/schemas/CloneUrls'
            - type: 'null'
          description: >-
            URLs and CLI command for cloning the repository, or `null` when
            `connected` is `false`.
        org_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Org Name
          description: >-
            GitHub username or organization that owns the repository, or `null`
            when `connected` is `false`.
          example: base44
        status:
          anyOf:
            - $ref: '#/components/schemas/GitHubConnectionStatus'
            - type: 'null'
          description: >-
            Health of the connection, or `null` when `connected` is `false`. A
            value of `active` works normally, `error` hit a technical failure,
            and `revoked` means the GitHub App access was withdrawn. The last
            two still report `connected: true`, so this is the field that tells
            you the connection needs repair.
          example: active
        installation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Installation Id
          description: >-
            ID of the Base44 GitHub App installation backing this connection, or
            `null` when `connected` is `false` and on a connection stored
            without one.
          example: '58231904'
        webhook_active:
          type: boolean
          title: Webhook Active
          description: >-
            Whether the repository has the Base44 webhook that triggers
            automatic pulls. While this is `false` on a connected app, GitHub
            isn't telling Base44 about pushes, so nothing arrives until you
            pull.
          default: false
          example: true
        connected_by_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Connected By User Id
          description: >-
            ID of the Base44 user who connected the repository, or `null` when
            `connected` is `false`.
          example: 6820f3a4e7b91d003c45a1f0
        previous_repository:
          anyOf:
            - $ref: '#/components/schemas/PreviousRepository'
            - type: 'null'
          description: >-
            The repository a user disconnected the app from, which [Reconnect a
            GitHub repository](/api-reference/reconnect-a-github-repository) can
            bring back, or `null` when the app is connected, never connected, or
            lost its repository some other way.
      type: object
      required:
        - connected
      title: ConnectionStatus
      description: Current connection status for an app.
    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.
    GitHubConnectionMode:
      type: string
      enum:
        - shared
        - per_user
      title: GitHubConnectionMode
    CloneUrls:
      properties:
        https:
          type: string
          title: Https
          description: URL to clone the repository over HTTPS.
          example: https://github.com/base44/lead-tracker.git
        ssh:
          type: string
          title: Ssh
          description: URL to clone the repository over SSH.
          example: git@github.com:base44/lead-tracker.git
        gh_cli:
          type: string
          title: Gh Cli
          description: Ready-to-run GitHub CLI clone command.
          example: gh repo clone base44/lead-tracker
      type: object
      required:
        - https
        - ssh
        - gh_cli
      title: CloneUrls
      description: Repository clone URLs in different formats.
    GitHubConnectionStatus:
      type: string
      enum:
        - active
        - disconnected
        - error
        - revoked
      title: GitHubConnectionStatus
      description: |-
        Health of an app's GitHub repository connection.

        - `active` works normally.
        - `disconnected` was disconnected by a user.
        - `error` hit a technical failure.
        - `revoked` means the GitHub App access was withdrawn.
    PreviousRepository:
      properties:
        repo_full_name:
          type: string
          title: Repo Full Name
          description: Full repository name, as `owner/repo`.
          example: base44/lead-tracker
        repo_url:
          type: string
          title: Repo Url
          description: URL of the repository on GitHub.
          example: https://github.com/base44/lead-tracker
        org_name:
          type: string
          title: Org Name
          description: GitHub username or organization that owns the repository.
          example: base44
      type: object
      required:
        - repo_full_name
        - repo_url
        - org_name
      title: PreviousRepository
      description: The repository an app was connected to before a user disconnected it.
    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.