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

# Create a draft release and get upload targets

> Send the parsed patch.json and every file's path, SHA-256 and size. Only files Patch doesn't already store come back as upload targets. Sending the same version again while it's a draft replaces it, so a retried publish resumes.



## OpenAPI

````yaml /api-reference/openapi.json post /projects/{owner}/{slug}/releases
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}/releases:
    post:
      tags:
        - Releases
      summary: Create a draft release and get upload targets
      description: >-
        Send the parsed patch.json and every file's path, SHA-256 and size. Only
        files Patch doesn't already store come back as upload targets. Sending
        the same version again while it's a draft replaces it, so a retried
        publish resumes.
      parameters:
        - schema:
            type: string
            example: patch
          required: true
          name: owner
          in: path
        - schema:
            type: string
            example: demo-mod
          required: true
          name: slug
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                manifest:
                  type: object
                  additionalProperties: {}
                files:
                  type: array
                  items:
                    type: object
                    properties:
                      path:
                        type: string
                        example: files/plugins.zip
                      sha256:
                        type: string
                        example: >-
                          9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
                      size:
                        type: integer
                    required:
                      - path
                      - sha256
                      - size
                  minItems: 1
                  maxItems: 10000
                changelog:
                  type: string
                  maxLength: 20000
                channel:
                  type: string
                  enum:
                    - private
                    - unlisted
                    - public
              required:
                - manifest
                - files
      responses:
        '201':
          description: The draft and what to upload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DraftRelease'
        '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'
      security:
        - bearer: []
components:
  schemas:
    DraftRelease:
      type: object
      properties:
        release:
          $ref: '#/components/schemas/Release'
        uploads:
          type: array
          items:
            $ref: '#/components/schemas/UploadTarget'
      required:
        - release
        - uploads
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: version_exists
            message:
              type: string
            details: {}
          required:
            - code
            - message
      required:
        - error
    Release:
      type: object
      properties:
        id:
          type: string
          format: uuid
        project:
          type: string
        version:
          type: string
        channel:
          type: string
          enum:
            - dev
            - private
            - unlisted
            - public
        status:
          type: string
          enum:
            - draft
            - checking
            - in_review
            - published
            - rejected
            - yanked
            - quarantined
        kind:
          type: string
          enum:
            - web_game
            - mod
            - crossover_mod
            - remix
        trust_tier:
          type: string
          enum:
            - sandboxed
            - game_files_only
            - runs_code
          description: >-
            What the release can do on the player's PC, derived from its
            manifest: runs sandboxed in Patch, changes game files only, or runs
            code. Drives the consent sheet and review.
        changelog:
          type:
            - string
            - 'null'
        manifest:
          type: object
          additionalProperties: {}
        created_at:
          type: string
        submitted_at:
          type:
            - string
            - 'null'
        published_at:
          type:
            - string
            - 'null'
      required:
        - id
        - project
        - version
        - channel
        - status
        - kind
        - trust_tier
        - changelog
        - manifest
        - created_at
        - submitted_at
        - published_at
    UploadTarget:
      type: object
      properties:
        id:
          type: string
          format: uuid
        sha256:
          type: string
        size:
          type: integer
        paths:
          type: array
          items:
            type: string
        method:
          type: string
          enum:
            - PUT
        url:
          type:
            - string
            - 'null'
          description: Single PUT target; null for multipart
        headers:
          type: object
          additionalProperties:
            type: string
          description: Send exactly these headers
        expires_at:
          type:
            - string
            - 'null'
        multipart:
          type:
            - object
            - 'null'
          properties:
            part_size:
              type: integer
            parts:
              type: array
              items:
                type: object
                properties:
                  part_number:
                    type: integer
                  url:
                    type: string
                  headers:
                    type: object
                    additionalProperties:
                      type: string
                required:
                  - part_number
                  - url
                  - headers
            complete_path:
              type: string
          required:
            - part_size
            - parts
            - complete_path
      required:
        - id
        - sha256
        - size
        - paths
        - method
        - url
        - headers
        - expires_at
        - multipart
  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.