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

# Attach an evaluator label to an intelligence-run

> Attach (or replace) an evaluator label on an intelligence-run record. The label body is freeform JSON the eval workflow defines (e.g. `{ "verdict": "good", "grader": "human", "notes": "..." }`).



## OpenAPI

````yaml /v2/storefront-api-v2.yaml put /intelligence-runs/{id}/label
openapi: 3.0.0
info:
  title: Scope3 Storefront API
  version: 2.0.0
  description: |-
    REST API for partners to manage storefronts, inventory sources, and billing.

    ## Authentication

    All endpoints require a Bearer token in the Authorization header:
    ```
    Authorization: Bearer your-api-key
    ```

    ## Base URL

    `https://api.interchange.io/api/v2/storefront`

    ## For AI Agents

    AI agents can use the MCP endpoint at `/mcp/v2/storefront` with three tools:
    - `initialize`: Start an MCP session
    - `api_call`: Make REST API calls
    - `ask_about_capability`: Learn about API features
servers:
  - url: https://api.interchange.io/api/v2/storefront
    description: Production server
security: []
tags:
  - name: Account
    description: Account management, service tokens, and preferences
  - name: Storefront
    description: Manage storefront and inventory sources
  - name: Storefront Agents
    description: List and manage registered sales, signals, and outcomes agents
  - name: Storefront Activity
    description: Audit log of configuration and inventory changes on the storefront
  - name: Storefront Billing
    description: Payout bank details and billing configuration for storefronts
  - name: AI Usage
    description: Storefront AI token usage visibility by model
  - name: MCP
    description: Model Context Protocol endpoints
paths:
  /intelligence-runs/{id}/label:
    put:
      tags:
        - Storefront
      summary: Attach an evaluator label to an intelligence-run
      description: >-
        Attach (or replace) an evaluator label on an intelligence-run record.
        The label body is freeform JSON the eval workflow defines (e.g. `{
        "verdict": "good", "grader": "human", "notes": "..." }`).
      operationId: labelIntelligenceRun
      parameters:
        - in: path
          name: id
          schema:
            description: Surrogate id of the intelligence-run row.
            example: 42
            type: integer
            maximum: 9007199254740991
            minimum: 1
          required: true
          description: Surrogate id of the intelligence-run row.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabelIntelligenceRunBody'
      responses:
        '200':
          description: Attach an evaluator label to an intelligence-run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntelligenceRunResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    LabelIntelligenceRunBody:
      description: >-
        Attach (or replace) an evaluator label on an intelligence-run row. The
        label is freeform JSON the eval workflow defines.
      type: object
      properties:
        label:
          type: object
          additionalProperties: {}
      required:
        - label
    IntelligenceRunResponse:
      description: >-
        A single storefront intelligence run: inputs, prompt, raw + parsed LLM
        output, persisted product ids, and result envelope.
      type: object
      properties:
        id:
          type: string
        storefrontId:
          type: string
        buyerCustomerId:
          nullable: true
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        operatingInstructionsVersion:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        buyerScope:
          $ref: '#/components/schemas/IntelligenceRunBuyerScope'
        buyerInstructions:
          $ref: '#/components/schemas/IntelligenceRunBuyerInstructions'
        brief:
          nullable: true
          type: string
        buyingMode:
          type: string
        inventorySnapshot: {}
        prompt:
          type: string
        rawLlmOutput: {}
        parsedOutput: {}
        runRationale:
          nullable: true
          type: string
        explanation:
          $ref: '#/components/schemas/IntelligenceRunExplanation'
        composedProductIds:
          type: array
          items:
            type: string
        result:
          $ref: '#/components/schemas/IntelligenceRunResult'
        modelProvider:
          nullable: true
          type: string
        modelName:
          type: string
        durationMs:
          nullable: true
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        refineSnapshot: {}
        refinementAppliedSnapshot: {}
        requestAsks:
          type: array
          items:
            type: string
        shownProductsSnapshot: {}
        pricingSummary: {}
        negotiationSummary:
          $ref: '#/components/schemas/IntelligenceRunNegotiationAnalytics'
        commercialOutcome: {}
        evalLabel: {}
        createdAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      required:
        - id
        - storefrontId
        - buyerCustomerId
        - operatingInstructionsVersion
        - buyerScope
        - buyerInstructions
        - brief
        - buyingMode
        - inventorySnapshot
        - prompt
        - rawLlmOutput
        - parsedOutput
        - runRationale
        - explanation
        - composedProductIds
        - result
        - modelProvider
        - modelName
        - durationMs
        - refineSnapshot
        - refinementAppliedSnapshot
        - requestAsks
        - shownProductsSnapshot
        - pricingSummary
        - negotiationSummary
        - commercialOutcome
        - evalLabel
        - createdAt
      additionalProperties: false
    ErrorResponse:
      description: Standard error response
      type: object
      properties:
        data:
          type: string
          nullable: true
          enum:
            - null
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - data
        - error
      additionalProperties: false
    IntelligenceRunBuyerScope:
      description: >-
        Buyer scope extracted from the AdCP get_products request that drove this
        run.
      type: object
      properties:
        operatorDomain:
          nullable: true
          type: string
        brandDomain:
          nullable: true
          type: string
        country:
          nullable: true
          type: string
      required:
        - operatorDomain
        - brandDomain
        - country
      additionalProperties: false
    IntelligenceRunBuyerInstructions:
      description: >-
        Resolver output: which buyer-instructions rows matched and the effective
        discount + notes applied.
      type: object
      properties:
        matchedRowIds:
          type: array
          items:
            type: string
        effectiveDiscountPercent:
          nullable: true
          type: number
        notes:
          type: array
          items:
            type: string
      required:
        - matchedRowIds
        - effectiveDiscountPercent
        - notes
      additionalProperties: false
    IntelligenceRunExplanation:
      description: >-
        Sanitized, user-facing explanation derived from the persisted run
        record: selected products, reasoning, pricing notes, buyer-instruction
        effects, and failures.
      type: object
      properties:
        summary:
          type: string
        selectedProducts:
          type: array
          items:
            $ref: '#/components/schemas/IntelligenceRunProductExplanation'
        unpricedProducts:
          type: array
          items:
            $ref: '#/components/schemas/IntelligenceRunUnpricedProductExplanation'
        buyerInstructionNotes:
          type: array
          items:
            type: string
        pricingNotes:
          type: array
          items:
            type: string
        failure:
          nullable: true
          type: object
          properties:
            code:
              nullable: true
              type: string
            message:
              nullable: true
              type: string
          required:
            - code
            - message
          additionalProperties: false
      required:
        - summary
        - selectedProducts
        - unpricedProducts
        - buyerInstructionNotes
        - pricingNotes
        - failure
      additionalProperties: false
    IntelligenceRunResult:
      description: >-
        Outcome envelope: ok on success, error with code/message on failure,
        skipped when the pipeline short-circuited.
      type: object
      properties:
        kind:
          type: string
          enum:
            - ok
            - error
            - skipped
        code:
          nullable: true
          type: string
        message:
          nullable: true
          type: string
      required:
        - kind
        - code
        - message
      additionalProperties: false
    IntelligenceRunNegotiationAnalytics:
      description: >-
        Compact seller-facing analytics derived from the buyer request and
        storefront response: refine counts, ask categories, product ids shown,
        and acknowledgement counts.
    ApiError:
      description: Structured error object
      type: object
      properties:
        code:
          description: Machine-readable error code
          type: string
        message:
          description: Human-readable error message
          type: string
        field:
          description: Field path associated with the error
          type: string
        details:
          description: Additional error context
          type: object
          additionalProperties: {}
      required:
        - code
        - message
      additionalProperties: false
    IntelligenceRunProductExplanation:
      description: >-
        Buyer-safe explanation of one product selected for the storefront
        response.
      type: object
      properties:
        productId:
          nullable: true
          type: string
        name:
          nullable: true
          type: string
        description:
          nullable: true
          type: string
        reasoning:
          nullable: true
          type: string
        pricing:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/IntelligenceRunProductPricingExplanation'
        bundleIds:
          type: array
          items:
            type: string
        signalIds:
          type: array
          items:
            type: string
        formatIds:
          type: array
          items:
            $ref: '#/components/schemas/IntelligenceRunProductFormatExplanation'
      required:
        - productId
        - name
        - description
        - reasoning
        - pricing
        - bundleIds
        - signalIds
        - formatIds
      additionalProperties: false
    IntelligenceRunUnpricedProductExplanation:
      description: >-
        Composition the model considered but the platform omitted because it
        could not be priced authoritatively.
      type: object
      properties:
        name:
          nullable: true
          type: string
        reasoning:
          nullable: true
          type: string
        reason:
          type: string
        bundleIds:
          type: array
          items:
            type: string
        signalIds:
          type: array
          items:
            type: string
      required:
        - name
        - reasoning
        - reason
        - bundleIds
        - signalIds
      additionalProperties: false
    IntelligenceRunProductPricingExplanation:
      description: Server-computed CPM pricing summary for a selected composition.
      type: object
      properties:
        baseCpm:
          nullable: true
          type: number
        currency:
          nullable: true
          type: string
        operatorDiscount:
          nullable: true
          type: number
        finalCpm:
          nullable: true
          type: number
      required:
        - baseCpm
        - currency
        - operatorDiscount
        - finalCpm
      additionalProperties: false
    IntelligenceRunProductFormatExplanation:
      description: Creative format selected for an explained product.
      type: object
      properties:
        agentUrl:
          nullable: true
          type: string
        id:
          nullable: true
          type: string
      required:
        - agentUrl
        - id
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key or access token

````