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

# Post apiv1campaignsmatch channels by prompt



## OpenAPI

````yaml https://backend.aflux.ai/openapi post /api/v1/campaigns/match-channels-by-prompt
openapi: 3.0.3
info:
  title: AdFlux Backend API
  version: v1
servers:
  - url: /
security: []
tags:
  - name: auth
  - name: users
  - name: uploads
  - name: projects
  - name: campaigns
  - name: placements
  - name: billing
  - name: payments
  - name: image-generations
paths:
  /api/v1/campaigns/match-channels-by-prompt:
    post:
      tags:
        - campaigns
      operationId: campaignsMatchChannelsByPrompt
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignMatchChannelsByPromptRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignChannelCandidateListResponse'
        default:
          $ref: '#/components/responses/DefaultError'
      security:
        - Bearer: []
components:
  schemas:
    CampaignMatchChannelsByPromptRequest:
      type: object
      required:
        - projectId
        - platform
        - prompt
      properties:
        projectId:
          type: string
          format: uuid
        platform:
          $ref: '#/components/schemas/CampaignPlatform'
        prompt:
          type: string
          minLength: 1
          maxLength: 2000
          description: >-
            The advertiser's own words for the channels he wants, e.g. "TON and
            DeFI channels, 20K+ subscribers, English-speaking traders, no
            giveaway posts". One sentence like this carries three different
            kinds of requirement, and each is routed to where it can actually be
            enforced: the subject matter becomes the semantic query, the
            audience language becomes the parser's language filter, the stated
            numbers become audience filters (reported back in `filters`), and
            the negations become instructions to the relevance classifier, which
            is the only step that can honour a "no ...". Unlike match-channels
            this needs no project AI context: the prompt says everything.
            `projectId` is still required because the returned matchToken is
            bound to it.
        objective:
          $ref: '#/components/schemas/CampaignObjective'
          nullable: true
    CampaignChannelCandidateListResponse:
      type: object
      required:
        - matchToken
        - channels
      properties:
        matchToken:
          type: string
        channels:
          type: array
          items:
            $ref: '#/components/schemas/CampaignChannelCandidate'
        filters:
          $ref: '#/components/schemas/CampaignFilters'
          nullable: true
          description: >-
            Present only for match-channels-by-prompt, which is the only search
            that INFERS its filters instead of being told them: it reports back
            what it read out of the prompt. The ad-copy and look-alike searches
            take no filters from the caller, so they leave this absent.
    CampaignPlatform:
      type: string
      enum:
        - TELEGRAM
    CampaignObjective:
      type: string
      enum:
        - AWARENESS
        - TRAFFIC
        - CONVERSIONS
        - APP_INSTALLS
    CampaignChannelCandidate:
      type: object
      required:
        - channelId
        - platform
        - relevancy
        - score
        - avgReach
        - fraudScore
      properties:
        channelId:
          type: integer
          format: int64
        platform:
          $ref: '#/components/schemas/CampaignPlatform'
        channelUsername:
          type: string
          nullable: true
        channelTitle:
          type: string
          nullable: true
        subscribers:
          type: integer
          format: int32
          nullable: true
        relevancy:
          type: number
          format: double
        score:
          type: number
          format: double
        avgReach:
          type: integer
          format: int64
        fraudScore:
          type: number
          format: double
        managerUsername:
          type: string
          nullable: true
    CampaignFilters:
      type: object
      description: >-
        The channel filters a search actually applied. Reported back by
        match-channels-by-prompt so the advertiser can see how his own words
        were read — "20K+ subscribers" comes back as minSubscribers=20000 — and
        correct them if they were read wrong. Every field is optional on
        purpose: only what the prompt actually stated is filled, and an absent
        field means no such filter narrowed the search. `ranking` and
        `minManagerContactConfidence` always come back, because the search
        always ranks somehow and always applies a contact requirement.
      properties:
        minSubscribers:
          type: integer
          format: int64
          nullable: true
        maxSubscribers:
          type: integer
          format: int64
          nullable: true
        maxFraudScore:
          type: number
          format: double
          nullable: true
        minAvgReach:
          type: integer
          format: int64
          nullable: true
        language:
          type: string
          nullable: true
          description: >-
            ISO 639-1 code of the audience language the search filtered on
            ("English-speaking traders" comes back as "en"). Absent when the
            language was not pinned by us and the search instead filtered on the
            language of the query text itself.
        ranking:
          type: string
          enum:
            - balanced
            - max_reach
            - max_engagement
          nullable: true
        minManagerContactConfidence:
          type: string
          enum:
            - any
            - low
            - medium
            - high
          nullable: true
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
  responses:
    DefaultError:
      description: Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````