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

# Read upload status once and retrieve latest artifacts

> Supply asset_current_version in the query. Customer org_id comes from authentication and overrides supplied values. System tokens require explicit org_id in the query. Backend response bodies, status codes, and URLs are preserved. Upload operations consume no review credits. The portal adapts this route to the current backend versioned path. Status reports the newest run's operation, original_ctx and effective_ctx, its run_id, a waiting_for_run_id while it is parked behind an earlier run, and its steering question with any answer; latest is scoped to that run. A status of awaiting_input is answered through POST /api/v1/upload/asset/{asset_id}/process; cancelled is terminal. 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 get /api/v1/upload/asset/{asset_id}
openapi: 3.1.0
info:
  title: GetGenAI API
  version: 1.38.0
servers: []
security:
  - bearerAuth: []
tags: []
paths:
  /api/v1/upload/asset/{asset_id}:
    get:
      tags:
        - Upload
      summary: Read upload status once and retrieve latest artifacts
      description: >-
        Supply asset_current_version in the query. Customer org_id comes from
        authentication and overrides supplied values. System tokens require
        explicit org_id in the query. Backend response bodies, status codes, and
        URLs are preserved. Upload operations consume no review credits. The
        portal adapts this route to the current backend versioned path. Status
        reports the newest run's operation, original_ctx and effective_ctx, its
        run_id, a waiting_for_run_id while it is parked behind an earlier run,
        and its steering question with any answer; latest is scoped to that run.
        A status of awaiting_input is answered through POST
        /api/v1/upload/asset/{asset_id}/process; cancelled is terminal. Artifact
        reads use bearer authentication at /storage. Requests propagate
        cancellation and time out after 30 seconds.
      parameters:
        - in: path
          name: asset_id
          required: true
          schema:
            type: string
            format: uuid
        - in: query
          name: asset_current_version
          required: true
          schema:
            type: integer
            minimum: 1
            maximum: 9007199254740991
        - in: query
          name: org_id
          required: false
          description: >-
            Required for system tokens; customer organization comes from
            authentication and overrides this value.
          schema:
            type: integer
            minimum: 1
            maximum: 9007199254740991
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionStatusView'
        '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:
    VersionStatusView:
      properties:
        asset_id:
          type: string
          format: uuid
          title: Asset Id
        org_id:
          type: integer
          title: Org Id
        version:
          type: integer
          title: Version
        status:
          $ref: '#/components/schemas/VersionStatus'
        folder:
          type: string
          title: Folder
        run_id:
          type: integer
          title: Run Id
        operation:
          anyOf:
            - $ref: '#/components/schemas/UploadOperation'
            - type: 'null'
          description: Intent of the newest run
        original_ctx:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Original Ctx
          description: The context the newest run was asked for
        effective_ctx:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Effective Ctx
          description: >-
            The context the newest run executes; differs from original_ctx after
            an answer
        waiting_for_run_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Waiting For Run Id
          description: >-
            Set while the newest run is parked behind an earlier one still
            classifying
        question:
          anyOf:
            - $ref: '#/components/schemas/ProcessingQuestion'
            - type: 'null'
          description: >-
            The newest run's steering question, open or answered; null when it
            never asked
        updated_at:
          type: string
          format: date-time
          title: Updated At
        stages:
          items:
            $ref: '#/components/schemas/StageView'
          type: array
          title: Stages
        root_dispatches:
          items:
            $ref: '#/components/schemas/RootDispatchView'
          type: array
          title: Root Dispatches
          description: >-
            Durable root-task dispatch state; pending entries are awaiting
            reconciliation
        latest:
          additionalProperties:
            $ref: '#/components/schemas/ArtifactView'
          type: object
          title: Latest
          description: >-
            Latest artifact of each kind in the newest run's scope, keyed by
            kind, with a full URL: the run's own outputs, the inputs it reused,
            corrections made since, and the version's previews
      type: object
      required:
        - asset_id
        - org_id
        - version
        - status
        - folder
        - run_id
        - updated_at
        - stages
      title: VersionStatusView
      description: >-
        The status projection, served by ``GET`` and mirrored to
        ``status/latest.json``.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    VersionStatus:
      type: string
      enum:
        - awaiting_upload
        - running
        - awaiting_input
        - completed
        - partial
        - failed
        - cancelled
        - abandoned
      title: VersionStatus
      description: >-
        Lifecycle of a source version; the newest run owns it once processing
        starts.
    UploadOperation:
      type: string
      enum:
        - asset_for_review
        - inspector_extraction
        - reference_asset
        - attachment
      title: UploadOperation
      description: >-
        What a run is processed for.


        Public intents arrive in ``ctx.operation`` and the service derives the
        pipeline from them.

        ``attachment`` is the internal preview-only policy of imported Bynder
        originals; it is recorded

        on their runs but never accepted from a caller.
    ProcessingQuestion:
      oneOf:
        - $ref: '#/components/schemas/Question'
        - $ref: '#/components/schemas/ExistingExtractionQuestion'
      discriminator:
        propertyName: code
        mapping:
          asset_type_mismatch: '#/components/schemas/Question'
          asset_type_uncertain: '#/components/schemas/Question'
          existing_extraction: '#/components/schemas/ExistingExtractionQuestion'
    StageView:
      properties:
        stage:
          $ref: '#/components/schemas/Stage'
        status:
          $ref: '#/components/schemas/StageStatus'
        run_id:
          type: integer
          title: Run Id
        attempt:
          type: integer
          title: Attempt
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        finished_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Finished At
        error:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Error
      type: object
      required:
        - stage
        - status
        - run_id
        - attempt
      title: StageView
    RootDispatchView:
      properties:
        stage:
          $ref: '#/components/schemas/Stage'
        status:
          type: string
          enum:
            - pending
            - dispatched
          title: Status
        attempt:
          type: integer
          title: Attempt
        last_error:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Last Error
        dispatched_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Dispatched At
      type: object
      required:
        - stage
        - status
        - attempt
      title: RootDispatchView
      description: Observable state of one durable root-task creation intent.
    ArtifactView:
      properties:
        kind:
          $ref: '#/components/schemas/ArtifactKind'
        artifact_version:
          type: integer
          title: Artifact Version
        url:
          type: string
          title: Url
        source:
          type: string
          enum:
            - pipeline
            - user
          title: Source
          default: pipeline
      type: object
      required:
        - kind
        - artifact_version
        - url
      title: ArtifactView
    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
    Question:
      properties:
        id:
          type: string
          title: Id
        message:
          type: string
          title: Message
        expected:
          $ref: '#/components/schemas/ExpectedIntent'
        observed:
          $ref: '#/components/schemas/ObservedClassification'
        options:
          items:
            $ref: '#/components/schemas/QuestionOption'
          type: array
          title: Options
        asked_at:
          type: string
          format: date-time
          title: Asked At
        code:
          $ref: '#/components/schemas/ClassificationQuestionCode'
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          description: The classifier's own reason
        answer:
          anyOf:
            - $ref: '#/components/schemas/QuestionAnswer'
            - type: 'null'
      type: object
      required:
        - id
        - message
        - expected
        - observed
        - options
        - asked_at
        - code
      title: Question
      description: An asset-type question with its recorded resolution.
    ExistingExtractionQuestion:
      properties:
        id:
          type: string
          title: Id
        message:
          type: string
          title: Message
        expected:
          $ref: '#/components/schemas/AssetForReviewContext'
        observed:
          $ref: '#/components/schemas/ObservedExtraction'
        options:
          items:
            $ref: '#/components/schemas/QuestionOption'
          type: array
          title: Options
        asked_at:
          type: string
          format: date-time
          title: Asked At
        code:
          type: string
          const: existing_extraction
          title: Code
          default: existing_extraction
        answer:
          anyOf:
            - $ref: '#/components/schemas/QuestionAnswer'
            - type: 'null'
      type: object
      required:
        - id
        - message
        - expected
        - observed
        - options
        - asked_at
      title: ExistingExtractionQuestion
      description: >-
        Choice of keeping the old document (cancel), content extraction, or full
        processing.
    Stage:
      type: string
      enum:
        - previews
        - classification
        - structure
        - content
        - inspectors
      title: Stage
      description: Pipeline stages, one Cloud Task each.
    StageStatus:
      type: string
      enum:
        - pending
        - running
        - succeeded
        - failed
        - skipped
      title: StageStatus
    ArtifactKind:
      type: string
      enum:
        - manifest
        - render
        - preview
        - classification
        - structure
        - content
        - inspectors
      title: ArtifactKind
      description: Artifact families, each versioned independently within an asset version.
    ExpectedIntent:
      properties:
        operation:
          $ref: '#/components/schemas/UploadOperation'
        inspector_type:
          $ref: '#/components/schemas/InspectorType'
      type: object
      required:
        - operation
        - inspector_type
      title: ExpectedIntent
      description: The gated intent the question was asked for.
    ObservedClassification:
      properties:
        asset_type:
          $ref: '#/components/schemas/AssetType'
        needs_review:
          type: boolean
          title: Needs Review
        candidates:
          items:
            $ref: '#/components/schemas/AssetType'
          type: array
          title: Candidates
        classification:
          $ref: '#/components/schemas/ArtifactView'
      type: object
      required:
        - asset_type
        - needs_review
        - candidates
        - classification
      title: ObservedClassification
      description: What the classifier saw, with the verdict artifact resolved to a URL.
    QuestionOption:
      properties:
        id:
          type: string
          title: Id
        label:
          type: string
          title: Label
          description: Human wording; render as given
        ctx:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Ctx
          description: The context the run continues with; null stops it
      type: object
      required:
        - id
        - label
      title: QuestionOption
      description: >-
        An offered answer and the intent it selects; a null context stops
        processing.
    ClassificationQuestionCode:
      type: string
      enum:
        - asset_type_mismatch
        - asset_type_uncertain
    QuestionAnswer:
      properties:
        option_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Option Id
          description: Null when a correction or a newer intent resolved it
        answered_by:
          $ref: '#/components/schemas/AnsweredBy'
        answered_at:
          type: string
          format: date-time
          title: Answered At
      type: object
      required:
        - answered_by
        - answered_at
      title: QuestionAnswer
    AssetForReviewContext:
      properties:
        operation:
          type: string
          const: asset_for_review
          title: Operation
      additionalProperties: false
      type: object
      required:
        - operation
      title: AssetForReviewContext
      description: >-
        Full extraction for a review: previews, classification, panels where
        applicable, content.
    ObservedExtraction:
      properties:
        document:
          $ref: '#/components/schemas/DocumentArtifactView'
        expected_schema_version:
          type: integer
          title: Expected Schema Version
      type: object
      required:
        - document
      title: ObservedExtraction
      description: >-
        The existing document and the schema version a new extraction would
        produce.
    InspectorType:
      type: string
      enum:
        - brief
        - master_label
        - brand_guidelines
        - safety_data_sheet
    AssetType:
      type: string
      enum:
        - ads_social_media
        - video_multimedia
        - print_materials
        - ads_promo_other
        - web_seo_content
        - email_crm
        - product_description
        - brief
        - owned_digital_product_other
        - packaging
        - labeling
        - master_label
        - retail_in_store
        - product_packaging_retail_other
        - pr_press_releases
        - legal_regulatory
        - brand_guidelines
        - safety_data_sheet
        - corporate_legal_brand_other
        - other
      title: AssetType
      description: >-
        Closed leaf taxonomy of asset types a precheck can classify.


        Values are identical to the DB ``asset_type.name`` so the classifier
        output

        resolves to a row with no translation. Extend by adding a member here
        and

        describing it in the classify prompt. Callers gate flows by comparing
        against

        a specific member (e.g. extract routes grounded extraction on

        ``packaging``/``labeling``).
    AnsweredBy:
      type: string
      enum:
        - user
        - policy
        - correction
        - superseded
    DocumentArtifactView:
      properties:
        kind:
          $ref: '#/components/schemas/ArtifactKind'
        artifact_version:
          type: integer
          title: Artifact Version
        url:
          type: string
          title: Url
        source:
          type: string
          enum:
            - pipeline
            - user
          title: Source
          default: pipeline
        run_id:
          type: integer
          title: Run Id
        schema_version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Schema Version
          description: >-
            Declared document schema version; null for unversioned legacy
            content
      type: object
      required:
        - kind
        - artifact_version
        - url
        - run_id
        - schema_version
      title: DocumentArtifactView
      description: >-
        An existing document's original producer and format, never relabeled as
        a new output.
  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.