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

# Allocate an upload version and backend signed PUT slots

> Customer org_id comes from authentication and overrides supplied values. System tokens require explicit org_id, in the init/process body or status query. Backend response bodies, status codes, and URLs are preserved. Upload operations consume no review credits. PUT every upload slot with all required_headers verbatim, without a bearer token; then POST /api/v1/upload/asset/{asset_id}/process with asset_current_version and an optional ctx, and poll the protected asset route with asset_current_version. Artifact reads use bearer authentication at /storage. Requests propagate cancellation and time out after 30 seconds.



## OpenAPI

````yaml https://app.inspack.com/api/v1/docs/json post /api/v1/upload/asset/init
openapi: 3.1.0
info:
  title: GetGenAI API
  version: 1.38.0
servers: []
security:
  - bearerAuth: []
tags: []
paths:
  /api/v1/upload/asset/init:
    post:
      tags:
        - Upload
      summary: Allocate an upload version and backend signed PUT slots
      description: >-
        Customer org_id comes from authentication and overrides supplied values.
        System tokens require explicit org_id, in the init/process body or
        status query. Backend response bodies, status codes, and URLs are
        preserved. Upload operations consume no review credits. PUT every upload
        slot with all required_headers verbatim, without a bearer token; then
        POST /api/v1/upload/asset/{asset_id}/process with asset_current_version
        and an optional ctx, and poll the protected asset route with
        asset_current_version. Artifact reads use bearer authentication at
        /storage. Requests propagate cancellation and time out after 30 seconds.
      operationId: init_upload_api_upload_asset_init_post
      requestBody:
        content:
          application/json:
            schema:
              properties:
                org_id:
                  type: integer
                  exclusiveMinimum: 0
                  title: Org Id
                  description: >-
                    Required for system tokens; customer organization comes from
                    authentication and overrides this value.
                asset_id:
                  anyOf:
                    - type: string
                      format: uuid
                    - type: 'null'
                  title: Asset Id
                  description: >-
                    Existing asset to add a version to. Absent mints a new
                    asset.
                readable:
                  $ref: '#/components/schemas/UploadFileSpec'
                  description: The one readable source (pdf/docx/pptx/image)
                originals:
                  items:
                    $ref: '#/components/schemas/UploadFileSpec'
                  type: array
                  maxItems: 10
                  title: Originals
                  description: >-
                    Design originals (.ai/.psd/.indd). Archived as-is; no
                    derivatives are produced.
                callback_url:
                  anyOf:
                    - type: string
                      maxLength: 2083
                      minLength: 1
                      format: uri
                    - type: 'null'
                  title: Callback Url
                  description: >-
                    Per-stage webhook target. Polling status/latest.json is the
                    fallback.
              type: object
              required:
                - readable
              title: InitUploadRequest
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InitUploadResponse'
        '400':
          description: Invalid input or missing system-token org_id
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          description: Customer organization is unavailable
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '499':
          description: Request cancelled
        '502':
          description: Upload service transport failure
        '503':
          description: Upload service not configured, or upstream unavailable
        '504':
          description: Upload service request timed out after 30 seconds
components:
  schemas:
    UploadFileSpec:
      properties:
        filename:
          type: string
          maxLength: 512
          minLength: 1
          title: Filename
          description: Original filename, preserved in the manifest
        content_type:
          type: string
          minLength: 1
          title: Content Type
          description: MIME type the client will PUT with
        bytes:
          type: integer
          exclusiveMinimum: 0
          title: Bytes
          description: Exact byte length; enforced by the signed URL
        sha256:
          anyOf:
            - type: string
              pattern: ^[0-9a-f]{64}$
            - type: 'null'
          title: Sha256
          description: >-
            SHA-256 of the file. Supplied by the client (which already streams
            the bytes); computed server-side during the previews stage when
            absent.
      type: object
      required:
        - filename
        - content_type
        - bytes
      title: UploadFileSpec
      description: One file the caller intends to upload.
    InitUploadResponse:
      properties:
        asset_id:
          type: string
          format: uuid
          title: Asset Id
        version:
          type: integer
          title: Version
        folder:
          type: string
          title: Folder
          description: Bucket prefix holding this version
        status_url:
          type: string
          title: Status Url
          description: URL of status/latest.json for this version
        uploads:
          items:
            $ref: '#/components/schemas/UploadSlot'
          type: array
          title: Uploads
      type: object
      required:
        - asset_id
        - version
        - folder
        - status_url
        - uploads
      title: InitUploadResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UploadSlot:
      properties:
        role:
          type: string
          enum:
            - readable
            - original
          title: Role
        path:
          type: string
          title: Path
          description: Version-relative path the bytes will live at
        url:
          type: string
          title: Url
          description: >-
            V4 signed PUT URL, optionally relayed through the portal storage
            proxy
        expires_at:
          type: string
          format: date-time
          title: Expires At
        max_bytes:
          type: integer
          title: Max Bytes
        required_headers:
          additionalProperties:
            type: string
          type: object
          title: Required Headers
          description: >-
            Headers the PUT must send verbatim. Includes the content-length
            range and x-goog-if-generation-match: 0, which makes the slot
            single-use.
      type: object
      required:
        - role
        - path
        - url
        - expires_at
        - max_bytes
        - required_headers
      title: UploadSlot
      description: A single-use signed PUT target.
    UnauthorizedError:
      type: object
      properties:
        error:
          type: string
          example: Unauthorized
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  responses:
    UnauthorizedError:
      description: Access token is missing or invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthorizedError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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