openapi: 3.0.3
info:
  title: Everflow Network API - Meta/Search
  description: Meta and global search endpoints for the Everflow network.
  version: 1.0.0
servers:
  - description: Production Server
    url: https://api.eflow.team/v1
tags:
  - name: Meta
    description: Global search and meta endpoints.
paths:
  /networks/search/meta:
    get:
      summary: Global Search
      tags:
        - Meta
      parameters:
        - in: query
          name: q
          required: true
          schema:
            type: string
          description: Search query string.
          example: "test"
      responses:
        "200":
          description: ""
          content:
            application/json:
              example:
                results:
                  - resource_type: "offer"
                    resource_id: 1537
                    resource_id_string: ""
                    resource_label: "My Test Offer (JSSDK)"
                    search_score: 67.302216
                    match_context_field: "Project ID"
                    match_context_value: "<mark>Test</mark>"
                    resource_url: ""
                    resource_status: "active"
                  - resource_type: "affiliate"
                    resource_id: 20736
                    resource_id_string: ""
                    resource_label: "Partner ABC"
                    search_score: 5.246439
                    match_context_field: "Label"
                    match_context_value: "<mark>test</mark>"
                    resource_url: ""
                    resource_status: "active"
                  - resource_type: "coupon_code"
                    resource_id: 24
                    resource_id_string: ""
                    resource_label: "test"
                    search_score: 6.591834
                    match_context_field: "Coupon Code"
                    match_context_value: "<mark>test</mark>"
                    resource_url: ""
                    resource_status: "active"
              schema:
                type: object
                properties:
                  results:
                    type: array
                    description: >
                      A flat list of search results ranked by relevance score.
                      Results can span multiple resource types.
                    items:
                      type: object
                      properties:
                        resource_type:
                          type: string
                          description: >
                            The type of resource matched. Possible values include:
                            `offer`, `offer_group`, `affiliate`, `advertiser`,
                            `creative`, `campaign`, `pixel`, `traffic_blocking`,
                            `coupon_code`, `network_employee`, `affiliate_user`,
                            `advertiser_user`, `click_raw`, `conversion_raw`,
                            `event_raw`, `impression_raw`, `on_hold_conversion_raw`,
                            `on_hold_event_raw`.
                          enum:
                            - offer
                            - offer_group
                            - affiliate
                            - advertiser
                            - creative
                            - campaign
                            - pixel
                            - traffic_blocking
                            - coupon_code
                            - network_employee
                            - affiliate_user
                            - advertiser_user
                            - click_raw
                            - conversion_raw
                            - event_raw
                            - impression_raw
                            - on_hold_conversion_raw
                            - on_hold_event_raw
                        resource_id:
                          type: integer
                          description: The unique ID of the matched resource.
                        resource_id_string:
                          type: string
                          description: >
                            A string representation of the resource ID, if applicable.
                            Empty string when not used.
                        resource_label:
                          type: string
                          description: The display name or label of the matched resource.
                        search_score:
                          type: number
                          format: float
                          description: >
                            Relevance score from the search engine. Higher values
                            indicate a stronger match.
                        match_context_field:
                          type: string
                          description: >
                            The field name where the match was found
                            (e.g., "Name", "Label", "Coupon Code", "Project ID").
                        match_context_value:
                          type: string
                          description: >
                            The matched value with HTML `<mark>` tags highlighting
                            the matching portions of the text.
                        resource_url:
                          type: string
                          description: >
                            A URL for the resource, if applicable. Empty string
                            when not used.
                        resource_status:
                          type: string
                          description: The current status of the matched resource (e.g., "active", "inactive").
      security:
        - API Key: []

components:
  securitySchemes:
    API Key:
      description: The Everflow API key generated from the Control Center > Security.
      in: header
      name: X-Eflow-Api-Key
      type: apiKey
