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

# Create a presigned upload session for a local OCI image archive.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/image-uploads
openapi: 3.1.0
info:
  title: Vers API
  description: >-
    REST API for creating, checkpointing, branching, and managing Vers computers
    and projects.
  version: 2.0.0
servers:
  - url: https://api.vers.sh
    description: Vers API
security:
  - bearerAuth: []
tags:
  - name: Computers
    description: Create, inspect, execute commands in, sleep, wake, and delete computers.
  - name: Branches
    description: Branch one or more computers from a live computer, checkpoint, or tag.
  - name: Checkpoints
    description: Capture, inspect, tag, and delete whole-computer checkpoints.
  - name: Projects
    description: >-
      Organize computers into projects with private service networks and grouped
      restores.
  - name: Operations
    description: Inspect and stream status events for asynchronous durable operations.
  - name: Images
    description: >-
      Import and manage custom OCI images, system images, and registry
      artifacts.
  - name: Repositories
    description: Manage checkpoint repositories, tags, and public catalog entries.
  - name: Domains
    description: Register and manage custom domains.
  - name: Environment Variables
    description: Manage account-level environment variables applied to new computers.
  - name: Account & System
    description: Inspect API key identity, usage, and control-plane health.
paths:
  /api/v2/image-uploads:
    post:
      tags:
        - Images
      summary: Create a presigned upload session for a local OCI image archive.
      operationId: v2_create_image_upload
      parameters:
        - name: Idempotency-Key
          in: header
          description: Tenant-scoped upload reservation identity
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOciUploadRequest'
        required: true
      responses:
        '200':
          description: Upload identity is already owned by an import
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateV2OciUploadResponse'
        '201':
          description: Upload bytes are required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateV2OciUploadResponse'
        '400':
          description: Invalid upload size, digest, or idempotency key
        '401':
          description: Missing or invalid API key
        '409':
          description: Idempotency key reused with different immutable input
        '503':
          description: Retry the same upload identity after the Retry-After delay
          headers:
            Retry-After:
              schema:
                type: integer
                format: int64
                minimum: 0
              description: Seconds until a retry-after outcome can be replayed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateV2OciUploadResponse'
components:
  schemas:
    CreateOciUploadRequest:
      type: object
      required:
        - size_bytes
        - content_sha256
        - archive_format
      properties:
        archive_format:
          type: string
          description: >-
            Exact local-image interchange contract. New uploads must explicitly

            request the server-verified v2 contract: `docker_archive_v2` for a

            plain archive, or `docker_archive_v2_gzip` for the same archive

            gzip-compressed in transit, where `size_bytes` and `content_sha256`

            describe the compressed bytes. The deserializer accepts a missing

            field only so pre-v2 clients receive an actionable upgrade error
            from

            admission rather than a generic JSON decode failure.
          example: docker_archive_v2
        content_sha256:
          type: string
          description: Lowercase hexadecimal SHA-256 of the complete uploaded object.
        size_bytes:
          type: integer
          format: int64
    CreateV2OciUploadResponse:
      oneOf:
        - type: object
          required:
            - upload_id
            - method
            - url
            - headers
            - expires_at
            - outcome
          properties:
            expires_at:
              type: string
              format: date-time
            headers:
              type: object
              description: |-
                Headers signed into the upload URL. Clients must send every
                returned header verbatim, including `content-length`.
              additionalProperties:
                type: string
              propertyNames:
                type: string
            method:
              type: string
            outcome:
              type: string
              enum:
                - upload_required
            upload_id:
              type: string
              format: uuid
            url:
              type: string
        - type: object
          required:
            - upload_id
            - outcome
          properties:
            outcome:
              type: string
              enum:
                - already_admitted
            upload_id:
              type: string
              format: uuid
        - type: object
          description: |-
            The current PUT remains valid but is too close to expiry to hand out
            again safely. Retry the same immutable upload identity at this time.
          required:
            - upload_id
            - retry_at
            - outcome
          properties:
            outcome:
              type: string
              enum:
                - retry_after
            retry_at:
              type: string
              format: date-time
            upload_id:
              type: string
              format: uuid
      description: |-
        Durable v2 replay result. An upload identity that is already owned by an
        import never receives another writable object contract.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: 'Vers API key (`VERS_API_KEY`) sent as `Authorization: Bearer <key>`.'

````

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