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

# Github Connection Status

> Check if user has connected GitHub.

`connected` reflects the same working-token condition the capability
endpoints (`/installations`, `/repositories`, `/branches`) gate on —
not merely whether an installation record exists. A stored
installation_id with a dead token (decrypt failure, refresh failure,
App suspend) reports connected=False + needs_reconnect=True instead
of a phantom "connected" that 400s everywhere else. Expired tokens
self-heal here via the shared refresh path.



## OpenAPI

````yaml /openapi.json get /api/github/status
openapi: 3.1.0
info:
  description: >-
    Public CodeCobra API. Authenticate by sending a personal API key in the
    `Authorization: Bearer <key>` header. Generate keys from Settings → API keys
    in the CodeCobra dashboard.
  title: CodeCobra Public API
  version: 1.0.0
servers: []
security: []
paths:
  /api/github/status:
    get:
      tags:
        - public
      summary: Github Connection Status
      description: |-
        Check if user has connected GitHub.

        `connected` reflects the same working-token condition the capability
        endpoints (`/installations`, `/repositories`, `/branches`) gate on —
        not merely whether an installation record exists. A stored
        installation_id with a dead token (decrypt failure, refresh failure,
        App suspend) reports connected=False + needs_reconnect=True instead
        of a phantom "connected" that 400s everywhere else. Expired tokens
        self-heal here via the shared refresh path.
      operationId: github_connection_status_api_github_status_get
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GitHubConnectionStatus'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    GitHubConnectionStatus:
      properties:
        account_login:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Login
        account_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Type
        connected:
          title: Connected
          type: boolean
        installation_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Installation Id
        needs_reconnect:
          default: false
          title: Needs Reconnect
          type: boolean
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
      required:
        - connected
      title: GitHubConnectionStatus
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````