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

# Who you are on GitHub, and where Patch's GitHub App is installed for you

> `linked` says whether Patch knows your GitHub account. Once it does, `login` and `id` say who you are there (a chat's commits to GitHub are authored as `<id>+<login>@users.noreply.github.com`), `installations` are the app's installations GitHub lists for you (`can_write` when it has Contents write), and `requests` your requests that an owner install it. `sign_in_url` starts `connect github` until you're linked, and `install_url` after, and for another account.



## OpenAPI

````yaml /api-reference/openapi.json get /me/github
openapi: 3.1.0
info:
  title: Patch API
  version: 1.0.0
  description: >-
    The public API behind patch.gg, the desktop app and pch. Changes within v1
    are additive only. Errors are { error: { code, message, details } }; branch
    on code.
servers:
  - url: https://patch.gg/api/v1
security: []
paths:
  /me/github:
    get:
      tags:
        - GitHub
      summary: Who you are on GitHub, and where Patch's GitHub App is installed for you
      description: >-
        `linked` says whether Patch knows your GitHub account. Once it does,
        `login` and `id` say who you are there (a chat's commits to GitHub are
        authored as `<id>+<login>@users.noreply.github.com`), `installations`
        are the app's installations GitHub lists for you (`can_write` when it
        has Contents write), and `requests` your requests that an owner install
        it. `sign_in_url` starts `connect github` until you're linked, and
        `install_url` after, and for another account.
      responses:
        '200':
          description: Your GitHub link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GithubLink'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Not signed in
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: GitHub didn't answer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearer: []
components:
  schemas:
    GithubLink:
      type: object
      properties:
        linked:
          type: boolean
          description: Whether Patch knows who you are on GitHub
        login:
          type: string
          description: Your GitHub login, once linked
        id:
          type: integer
          exclusiveMinimum: 0
          description: >-
            Your GitHub user id, once linked. A chat's commits to GitHub are
            authored as you with it: `<id>+<login>@users.noreply.github.com`
          example: 12345678
        install_url:
          type: string
          format: uri
          description: >-
            Patch's page that sends a browser to GitHub's install page for the
            app, and back: `connect github` once you're linked, and `add an
            account`. Add `?return_to=<a page here>`, and from Patch Desktop
            `&scheme=<its link scheme>`
        sign_in_url:
          type: string
          format: uri
          description: >-
            Patch's page that sends a browser to GitHub's sign-in for the app,
            and back: `connect github` until you're linked. It comes back with
            who you are whether or not the app is installed anywhere, and goes
            on to the install page where it's on none of your accounts. Add
            `?return_to=<a page here>`, and from Patch Desktop `&scheme=<its
            link scheme>`
        installations:
          type: array
          items:
            $ref: '#/components/schemas/GithubInstallation'
          description: The app's installations you can reach, as GitHub lists them
        requests:
          type: array
          items:
            type: object
            properties:
              account:
                type: string
              created_at:
                type: string
            required:
              - account
              - created_at
          description: 'Your requests that an owner install the app: `waiting on an owner`'
      required:
        - linked
        - install_url
        - sign_in_url
        - installations
        - requests
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: version_exists
            message:
              type: string
            details: {}
          required:
            - code
            - message
      required:
        - error
    GithubInstallation:
      type: object
      properties:
        id:
          type: integer
          description: GitHub's id for the installation
        account:
          type: string
          description: The account it's on
          example: sam
        type:
          type: string
          enum:
            - User
            - Organization
        selection:
          type: string
          enum:
            - all
            - selected
          description: Whether it reaches all of the account's repos, or the ones picked
        suspended:
          type: boolean
        can_write:
          type: boolean
          description: Whether it has Contents write, which a chat's pushes need
        settings_url:
          type: string
          format: uri
          description: 'Where its repos are picked on GitHub: `add a repo`'
      required:
        - id
        - account
        - type
        - selection
        - suspended
        - can_write
        - settings_url
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: An API key (pch_...) or the token from pch login.

````

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