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

# Send a browser to a file's bytes

> A 302 to the git host, which serves repo files from outside patch.gg: images to show, and anything else to download. It's what an image in a page uses, since the page's sign-in reaches this route and not the git host. For a repo not everyone can read, the link carries a signature that lasts 15 minutes and unlocks only that file, as it is at the commit `ref` is at now. 404 `ref_not_found` for such a repo, if `ref` is at nothing.



## OpenAPI

````yaml /api-reference/openapi.json get /projects/{owner}/{slug}/repo/raw
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/raw:
    get:
      tags:
        - Repos
      summary: Send a browser to a file's bytes
      description: >-
        A 302 to the git host, which serves repo files from outside patch.gg:
        images to show, and anything else to download. It's what an image in a
        page uses, since the page's sign-in reaches this route and not the git
        host. For a repo not everyone can read, the link carries a signature
        that lasts 15 minutes and unlocks only that file, as it is at the commit
        `ref` is at now. 404 `ref_not_found` for such a repo, if `ref` is at
        nothing.
      parameters:
        - schema:
            type: string
            example: patch
          required: true
          name: owner
          in: path
        - schema:
            type: string
            example: demo-mod
          required: true
          name: slug
          in: path
        - schema:
            type: string
            pattern: ^\S{1,255}$
            description: >-
              A branch, a tag or a full commit hash: the default branch unless
              you say. A branch comes before a tag of the same name, and
              `refs/tags/v1` says which.
            example: main
          required: false
          description: >-
            A branch, a tag or a full commit hash: the default branch unless you
            say. A branch comes before a tag of the same name, and
            `refs/tags/v1` says which.
          name: ref
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 4096
            description: A file in the repo, from its top
            example: docs/guide.md
          required: true
          description: A file in the repo, from its top
          name: path
          in: query
      responses:
        '302':
          description: To the file on the git host
        '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'
        '502':
          description: '`ref` couldn''t be looked up'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: There's no git host here
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: version_exists
            message:
              type: string
            details: {}
          required:
            - code
            - message
      required:
        - error

````

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