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

# Auto-select products



## OpenAPI

````yaml /openapi/buyer.yaml post /api/v2/buyer/campaigns/{id}/auto-select-products
openapi: 3.1.0
info:
  title: Semicola Exchange buyer API
  version: 2.0.0
  description: >-
    Buyer endpoints: advertisers, storefronts and connections, product
    discovery, campaigns, proposals, media buys, creatives and reporting. Every
    write accepts an Idempotency-Key header.
servers:
  - url: https://api.semicola.com
security:
  - bearerAuth: []
  - sessionCookie: []
tags:
  - name: Advertisers
  - name: Storefronts
  - name: Product Discovery
  - name: Campaigns
  - name: Media Buys
  - name: Update Proposals
  - name: Optimization Suggestions
  - name: Creatives
  - name: Catalogs
  - name: Property Lists
  - name: Audiences
  - name: Syndication
  - name: Reporting
  - name: Event Sources
  - name: Webhooks
  - name: Tasks
  - name: Audit Logs
  - name: Activity
paths:
  /api/v2/buyer/campaigns/{id}/auto-select-products:
    post:
      tags:
        - Campaigns
      summary: Auto-select products
      operationId: postBuyerCampaignsByIdAutoSelectProducts
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                refine:
                  maxItems: 50
                  type: array
                  items:
                    oneOf:
                      - type: object
                        properties:
                          scope:
                            type: string
                            const: request
                          ask:
                            type: string
                            minLength: 1
                            maxLength: 500
                        required:
                          - scope
                          - ask
                        additionalProperties: false
                      - type: object
                        properties:
                          scope:
                            type: string
                            const: product
                          id:
                            type: string
                            minLength: 1
                          action:
                            type: string
                            enum:
                              - include
                              - omit
                              - moreLikeThis
                              - more_like_this
                        required:
                          - scope
                          - id
                          - action
                        additionalProperties: false
                maxProducts:
                  type: integer
                  minimum: 1
                  maximum: 50
                minBudgetPerProduct:
                  type: number
                  exclusiveMinimum: 0
              additionalProperties: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    anyOf:
                      - type: object
                        properties:
                          campaignId:
                            type: string
                          discoveryId:
                            type: string
                          selectedProducts:
                            type: array
                            items:
                              type: object
                              properties:
                                productId:
                                  type: string
                                name:
                                  type: string
                                salesAgentId:
                                  type: string
                                groupId:
                                  type: string
                                groupName:
                                  type: string
                                cpm:
                                  type:
                                    - number
                                    - 'null'
                                budget:
                                  type: number
                                pricingOptionId:
                                  type: string
                                channelGroupId:
                                  type:
                                    - string
                                    - 'null'
                              required:
                                - productId
                                - name
                                - salesAgentId
                                - groupId
                                - groupName
                                - cpm
                                - budget
                                - pricingOptionId
                                - channelGroupId
                              additionalProperties: false
                          budgetContext:
                            type: object
                            properties:
                              campaignBudget:
                                type: number
                              totalAllocated:
                                type: number
                              remainingBudget:
                                type: number
                              currency:
                                type: string
                            required:
                              - campaignBudget
                              - totalAllocated
                              - remainingBudget
                              - currency
                            additionalProperties: false
                          productCount:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          previouslySelectedCount:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          selectionRationale:
                            type: string
                          selectionMethod:
                            type: string
                            enum:
                              - scoring
                              - measurability
                              - cpm_heuristic
                        required:
                          - campaignId
                          - discoveryId
                          - selectedProducts
                          - budgetContext
                          - productCount
                          - previouslySelectedCount
                          - selectionRationale
                          - selectionMethod
                        additionalProperties: false
                      - type: 'null'
                  error:
                    anyOf:
                      - type: object
                        properties:
                          code:
                            type: string
                          message:
                            type: string
                          field:
                            type: string
                          details: {}
                        required:
                          - code
                          - message
                        additionalProperties: false
                      - type: 'null'
                required:
                  - data
                  - error
                additionalProperties: false
        default:
          description: >-
            Error envelope `{data: null, error: {code, message, field?,
            details?}}`.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key or OAuth access token.
    sessionCookie:
      type: apiKey
      in: cookie
      name: sc_session

````