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

# Process an uploaded version for an intent, or answer its steering question

> Supply asset_current_version in the JSON body. Omit ctx for a review upload (ctx.operation asset_for_review: previews, classification, panels where applicable, content). Send ctx {operation: inspector_extraction, inspector_type, on_question} to draft inspectors from a brief, master label, brand guidelines or safety data sheet, {operation: reference_asset} for previews and classification only, or {operation: answer_question, run_id, question_id, option_id} to resume a run that paused with status awaiting_input. The backend validates ctx strictly: a null ctx, an unknown operation or an extra field returns 422 before any work. The 202 response keeps the start fields (status, deduplicated, stages) and adds run_id, operation and question; follow the returned version when deduplicated, and answer a question through this same route for that version. A repeated accepted intent returns the current state; a stale or conflicting answer returns 409 and an option the question does not offer 400. Customer org_id comes from authentication and overrides supplied values; system tokens require explicit org_id in the body. Upload operations consume no review credits. Requests propagate cancellation and time out after 30 seconds. Replaces the retired /start route.



## OpenAPI

````yaml https://app.inspack.com/api/v1/docs/json post /api/v1/upload/asset/{asset_id}/process
openapi: 3.1.0
info:
  title: GetGenAI API
  version: 1.38.0
servers: []
security:
  - bearerAuth: []
tags: []
paths:
  /api/v1/upload/asset/{asset_id}/process:
    post:
      tags:
        - Upload
      summary: >-
        Process an uploaded version for an intent, or answer its steering
        question
      description: >-
        Supply asset_current_version in the JSON body. Omit ctx for a review
        upload (ctx.operation asset_for_review: previews, classification, panels
        where applicable, content). Send ctx {operation: inspector_extraction,
        inspector_type, on_question} to draft inspectors from a brief, master
        label, brand guidelines or safety data sheet, {operation:
        reference_asset} for previews and classification only, or {operation:
        answer_question, run_id, question_id, option_id} to resume a run that
        paused with status awaiting_input. The backend validates ctx strictly: a
        null ctx, an unknown operation or an extra field returns 422 before any
        work. The 202 response keeps the start fields (status, deduplicated,
        stages) and adds run_id, operation and question; follow the returned
        version when deduplicated, and answer a question through this same route
        for that version. A repeated accepted intent returns the current state;
        a stale or conflicting answer returns 409 and an option the question
        does not offer 400. Customer org_id comes from authentication and
        overrides supplied values; system tokens require explicit org_id in the
        body. Upload operations consume no review credits. Requests propagate
        cancellation and time out after 30 seconds. Replaces the retired /start
        route.
      parameters:
        - in: path
          name: asset_id
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - asset_current_version
              properties:
                asset_current_version:
                  type: integer
                  minimum: 1
                  maximum: 9007199254740991
                org_id:
                  type: integer
                  minimum: 1
                  maximum: 9007199254740991
                  description: >-
                    Required for system tokens; customer organization comes from
                    authentication.
                ctx:
                  description: >-
                    Processing intent, discriminated on operation;
                    asset_for_review when omitted. Unknown operations and extra
                    fields are rejected.
                  discriminator:
                    propertyName: operation
                  oneOf:
                    - type: object
                      title: AssetForReviewContext
                      description: Full extraction for a review (the default).
                      required:
                        - operation
                      additionalProperties: false
                      properties:
                        operation:
                          type: string
                          enum:
                            - asset_for_review
                    - type: object
                      title: InspectorExtractionContext
                      description: >-
                        Draft inspectors from a source document; pauses with a
                        question when the detected asset type does not fit,
                        unless on_question pre-answers it.
                      required:
                        - operation
                        - inspector_type
                      additionalProperties: false
                      properties:
                        operation:
                          type: string
                          enum:
                            - inspector_extraction
                        inspector_type:
                          type: string
                          enum:
                            - brief
                            - master_label
                            - brand_guidelines
                            - safety_data_sheet
                        additional_context:
                          type: string
                          nullable: true
                          description: >-
                            Optional extraction instructions. Blank text is
                            absent; other text is preserved verbatim. Different
                            instructions request a new draft. Accepted but
                            ignored by master-label extraction.
                        on_question:
                          type: string
                          enum:
                            - ask
                            - proceed
                            - stop
                          default: ask
                          description: >-
                            ask pauses on an incompatible verdict; proceed
                            extracts anyway; stop cancels after classification.
                    - type: object
                      title: ReferenceAssetContext
                      description: Store a reference with previews and classification only.
                      required:
                        - operation
                      additionalProperties: false
                      properties:
                        operation:
                          type: string
                          enum:
                            - reference_asset
                    - type: object
                      title: AnswerQuestionContext
                      description: >-
                        Resume the paused run with one of its question's
                        options.
                      required:
                        - operation
                        - run_id
                        - question_id
                        - option_id
                      additionalProperties: false
                      properties:
                        operation:
                          type: string
                          enum:
                            - answer_question
                        run_id:
                          type: integer
                          minimum: 1
                        question_id:
                          type: string
                          minLength: 1
                        option_id:
                          type: string
                          minLength: 1
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessUploadResponse'
        '400':
          description: Invalid input or missing system-token org_id
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          description: Customer organization is unavailable
        '404':
          description: Unknown asset or version for this organization
        '409':
          description: Upload incomplete, stale question, or conflicting answer
        '422':
          description: >-
            Invalid processing context (null ctx, unknown operation, or extra
            fields)
        '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:
    ProcessUploadResponse:
      properties:
        asset_id:
          type: string
          format: uuid
          title: Asset Id
        version:
          type: integer
          title: Version
          description: Version the pipeline runs for; the previous one when deduplicated
        folder:
          type: string
          title: Folder
        status_url:
          type: string
          title: Status Url
        status:
          $ref: '#/components/schemas/VersionStatus'
        deduplicated:
          type: boolean
          title: Deduplicated
          description: >-
            True when matching bytes reuse the previous source version;
            processing may ask how to proceed
          default: false
        stages:
          items:
            $ref: '#/components/schemas/Stage'
          type: array
          title: Stages
          description: Stages enqueued by this call
        run_id:
          type: integer
          title: Run Id
        operation:
          $ref: '#/components/schemas/UploadOperation'
        question:
          anyOf:
            - $ref: '#/components/schemas/ProcessingQuestion'
            - type: 'null'
          description: Open or answered question of the run, if any
      type: object
      required:
        - asset_id
        - version
        - folder
        - status_url
        - status
        - run_id
        - operation
      title: ProcessUploadResponse
    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.
    Stage:
      type: string
      enum:
        - previews
        - classification
        - structure
        - content
        - inspectors
      title: Stage
      description: Pipeline stages, one Cloud Task each.
    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'
    UnauthorizedError:
      type: object
      properties:
        error:
          type: string
          example: Unauthorized
    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.
    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``).
    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
    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.
    ArtifactKind:
      type: string
      enum:
        - manifest
        - render
        - preview
        - classification
        - structure
        - content
        - inspectors
      title: ArtifactKind
      description: Artifact families, each versioned independently within an asset version.
  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.