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

# A project's git repo

> Its public facts, where to clone it, and with its source readable, its latest commit and README. Once it has its first push, anyone can see an open or closed source repo, but only an open repo's source; the owning org always can. A repo open when its first push lands is closed source until a scan of its history is clean, and then it opens by itself, and so is an open repo a later push brought a secret to: `opening` tells its org where that's got to, and what was found. A private repo answers 404 to everyone else, as if it weren't there. Where connecting GitHub is on, `home` says where the repo lives, and `github` which GitHub repo, for one whose home is GitHub. Its `default_branch`, `head_commit`, `pushed_at` and `readme` then follow GitHub's pushes, and `last_commit` is null.



## OpenAPI

````yaml /api-reference/openapi.json get /projects/{owner}/{slug}/repo
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:
  /projects/{owner}/{slug}/repo:
    get:
      tags:
        - Repos
      summary: A project's git repo
      description: >-
        Its public facts, where to clone it, and with its source readable, its
        latest commit and README. Once it has its first push, anyone can see an
        open or closed source repo, but only an open repo's source; the owning
        org always can. A repo open when its first push lands is closed source
        until a scan of its history is clean, and then it opens by itself, and
        so is an open repo a later push brought a secret to: `opening` tells its
        org where that's got to, and what was found. A private repo answers 404
        to everyone else, as if it weren't there. Where connecting GitHub is on,
        `home` says where the repo lives, and `github` which GitHub repo, for
        one whose home is GitHub. Its `default_branch`, `head_commit`,
        `pushed_at` and `readme` then follow GitHub's pushes, and `last_commit`
        is null.
      parameters:
        - schema:
            type: string
            example: patch
          required: true
          name: owner
          in: path
        - schema:
            type: string
            example: demo-mod
          required: true
          name: slug
          in: path
      responses:
        '200':
          description: The repo
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Repo'
        '308':
          description: Renamed; follow the Location header
        '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'
        '429':
          description: >-
            Too many requests: wait as long as `Retry-After` says
            (`retry_after_s` in `details`), then retry
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Repo:
      type: object
      properties:
        name:
          type: string
        summary:
          type:
            - string
            - 'null'
        code_license:
          type: string
          maxLength: 64
          pattern: ^[A-Za-z0-9][A-Za-z0-9.+-]*$
          example: MIT
          description: License of the code
        art_license:
          type: string
          maxLength: 64
          pattern: ^[A-Za-z0-9][A-Za-z0-9.+-]*$
          example: MIT
          description: License of original art and other assets
        clone_url:
          type: string
          format: uri
          example: https://git.patch.gg/patch/demo-mod.git
        visibility:
          type: string
          enum:
            - open
            - closed_source
            - private
          description: >-
            Who can reach the project's repo. open: anyone can find it, read it
            and fork it. closed_source: anyone can find and play what it
            releases; only its org reads the source. private: only its org can
            find it, and anyone else gets a 404. It isn't locked: the game host
            serves a published browser game to anyone who has its address.
        visibility_chosen_at:
          type:
            - string
            - 'null'
          description: >-
            When someone last set `visibility` on purpose, for its org: what to
            send back with a change that depends on nobody having done that
            since
        opening:
          type:
            - object
            - 'null'
          properties:
            status:
              type: string
              enum:
                - scanning
                - secrets_found
                - big_files_unread
                - failed
            says:
              type: string
              description: Where it's got to, to pass on to the person
            found:
              type: array
              items:
                type: object
                properties:
                  kind:
                    type: string
                    example: an AWS access key
                  path:
                    type:
                      - string
                      - 'null'
                    description: Null for a commit's message.
                  line:
                    type: integer
                    minimum: 1
                  commit:
                    type:
                      - string
                      - 'null'
                required:
                  - kind
                  - path
                  - line
                  - commit
              description: >-
                What a later push brought that closed it, as Patch read that
                push, and never a secret's value. Empty for a first push's hold,
                and for a push Patch couldn't read all of.
            was_open:
              type: boolean
              description: >-
                Whether it was open until a later push closed it. With nothing
                in `found`, that's for what Patch couldn't read of the push.
          required:
            - status
            - says
            - found
            - was_open
          description: >-
            For the repo's org. A repo that was open when its first push landed
            stays closed source until a scan of its history is clean, and then
            opens by itself, and so does an open repo that a later push closed
            by bringing a secret, or something Patch couldn't read. This says
            where that's got to. Null for anyone else, and for a repo that isn't
            waiting.
        can_read_source:
          type: boolean
          description: >-
            Whether you can read its source. When false, as for someone outside
            a closed source repo's org, `head_commit`, `last_commit` and
            `readme` are null, and its file, tree and commit reads answer 403
            `source_closed`.
        default_branch:
          type: string
          example: main
        created_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the repo was made; null until its first push.
        head_commit:
          type:
            - string
            - 'null'
          description: The default branch's latest commit, as of the last push.
        pushed_at:
          type:
            - string
            - 'null'
          format: date-time
        forked_from:
          type:
            - string
            - 'null'
          description: The repo it was forked from, as owner/slug.
          example: patch/demo-mod
        fork_count:
          type: integer
          description: >-
            Its forks anyone can see: open ones with a repo, each once it has a
            public release. Until then a fork is quiet, and nothing counts it.
        clone_count:
          type: integer
          description: >-
            Fresh clones by people outside its org, each cloner counted once a
            day, as the git host saw them.
        training_opt_out:
          type: boolean
          description: When true, Patch doesn't train its own models on this project.
        change_requests:
          type: boolean
          description: >-
            The owner's switch for change requests. Only open repos take them,
            so it does nothing while the repo isn't open.
        open_change_requests:
          type: integer
          description: >-
            How many change requests are open, for whoever can read its source:
            0 for anyone else.
        last_commit:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
            subject:
              type: string
              description: Its message's first line
            author:
              type: string
            committed_at:
              type: string
              format: date-time
          required:
            - id
            - subject
            - author
            - committed_at
          description: >-
            The default branch's latest commit, as read after the push that
            moved it.
        readme:
          type:
            - object
            - 'null'
          properties:
            path:
              type: string
              example: README.md
            text:
              type: string
          required:
            - path
            - text
          description: >-
            The README at the top of the default branch, its first 128 KB; null
            when there's none.
        readme_pictures:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
                format: uri
                description: The file, as the README writes its address.
              levels:
                $ref: '#/components/schemas/MediaLevels'
              fit:
                type: string
                enum:
                  - cover
                  - contain
                  - pixel
                  - wave
                description: >-
                  How it sits in a card's frame. cover: fills it. contain: a
                  thing on nothing, whole, on the frame's ground. pixel: the
                  same, with its pixels kept sharp. wave: a sound's waveform,
                  across the frame.
            required:
              - url
              - levels
              - fit
          description: >-
            The pictures in a library repo's README, which Patch holds copies
            of, so a page can show them at their levels. Empty for any other
            repo, and for anyone who can't read its source.
        home:
          type: string
          enum:
            - patch
            - github
          description: >-
            Where its repo lives, where connecting GitHub is on (and only
            there): `patch`, or `github` once a GitHub repo is connected to it,
            whose files and commits stay on GitHub. `clone_url` is the same
            either way.
        github:
          type:
            - object
            - 'null'
          properties:
            full_name:
              type: string
              example: sam/sky-mod
            html_url:
              type: string
              format: uri
              example: https://github.com/sam/sky-mod
            private:
              type: boolean
              description: Whether it's private on GitHub
            default_branch:
              type: string
              example: main
            head_commit:
              type:
                - string
                - 'null'
              description: >-
                The default branch's latest commit, as of GitHub's last push
                event
            pushed_at:
              type:
                - string
                - 'null'
              format: date-time
            state:
              type: string
              enum:
                - connected
                - disconnected
                - gone
                - suspended
                - no_access
              description: >-
                connected. disconnected: someone disconnected it on Patch, or it
                moved to an account without Patch's GitHub App. gone: deleted
                from GitHub. suspended: the app is suspended on its account.
                no_access: the app no longer reaches it (uninstalled, or the
                repo was taken out of the installation).
          required:
            - full_name
            - html_url
            - private
            - default_branch
          description: >-
            The GitHub repo that's its home, with `home`. Null on Patch, and for
            someone outside the project's org when the repo is private on
            GitHub.
      required:
        - name
        - summary
        - code_license
        - art_license
        - clone_url
        - visibility
        - opening
        - can_read_source
        - default_branch
        - created_at
        - head_commit
        - pushed_at
        - forked_from
        - fork_count
        - clone_count
        - training_opt_out
        - change_requests
        - open_change_requests
        - last_commit
        - readme
        - readme_pictures
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: version_exists
            message:
              type: string
            details: {}
          required:
            - code
            - message
      required:
        - error
    MediaLevels:
      type: array
      items:
        type: object
        properties:
          width:
            type: integer
          url:
            type: string
        required:
          - width
          - url
      description: >-
        Smaller copies of a picture (WebP) or a clip (MP4, H.264, without
        sound), smallest first, each at its own address that never changes. Show
        the smallest that's sharp where it goes. Empty for animated pictures,
        for flat art and short clips with no smaller copy, and for media from
        before Patch made copies until theirs are made: then use the file
        itself.

````

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