openapi: 3.0.3
info:
  title: Everflow Network API - Postback and Pixel Reporting
  description: >
    Partner postback and advertiser pixel log endpoints for the Everflow
    partner marketing platform.
  version: 1.0.0
servers:
  - description: Production Server
    url: https://api.eflow.team/v1
tags:
  - name: Reporting
    description: Postback and pixel log reporting endpoints.
paths:
  /networks/reporting/advertiser/pixels/bq:
    post:
      summary: Get Advertiser Pixel Log
      tags:
        - Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              from: "2024-01-01"
              to: "2024-01-31"
              timezone_id: 90
            schema:
              type: object
              required:
                - from
                - to
                - timezone_id
              properties:
                from:
                  type: string
                  description: "Start date (format: YYYY-MM-DD)."
                to:
                  type: string
                  description: "End date (format: YYYY-MM-DD)."
                timezone_id:
                  type: integer
                  description: Timezone ID for the report.
                query:
                  type: object
                  description: Optional filters to narrow results.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  pixels:
                    type: array
                    items:
                      type: object
                      description: Pixel log entry.
      security:
        - API Key: []

  /networks/reporting/affiliate/pixels:
    post:
      summary: Get Partner Pixel Log
      tags:
        - Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              from: "2024-01-01"
              to: "2024-01-31"
              timezone_id: 90
              query:
                filters:
                  - resource_type: "offer"
                    filter_id_value: "1"
            schema:
              type: object
              required:
                - from
                - to
                - timezone_id
                - query
              properties:
                from:
                  type: string
                  description: "Start date (format: YYYY-MM-DD)."
                to:
                  type: string
                  description: "End date (format: YYYY-MM-DD)."
                timezone_id:
                  type: integer
                  description: Timezone ID for the report.
                query:
                  type: object
                  required:
                    - filters
                  description: >
                    Must include at least one filter with a `resource_type`. Without
                    a filter, the endpoint returns an empty list.
                  properties:
                    filters:
                      type: array
                      description: >
                        Array of filter objects. At least one is required. Each
                        filter must specify a `resource_type` and a `filter_id_value`.
                      items:
                        type: object
                        required:
                          - resource_type
                          - filter_id_value
                        properties:
                          resource_type:
                            type: string
                            enum:
                              - offer
                              - affiliate
                              - delivery_status
                            description: >
                              The type of resource to filter by. For `delivery_status`,
                              use `success` or `failure` as the `filter_id_value`.
                          filter_id_value:
                            type: string
                    search_terms:
                      type: array
                      description: Text search terms to match pixel log entries.
                      items:
                        type: object
                        properties:
                          search_type:
                            type: string
                            enum:
                              - transaction_id
                              - conversion_id
                              - payload
                              - pixel_id
                          value:
                            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  pixels:
                    type: array
                    items:
                      type: object
                      properties:
                        pixel_id:
                          type: integer
                        network_id:
                          type: integer
                        network_offer_id:
                          type: integer
                        affiliate_id:
                          type: integer
                        network_offer_payout_revenue_id:
                          type: integer
                        transaction_id:
                          type: string
                        conversion_id:
                          type: string
                        timestamp:
                          type: integer
                          description: Unix timestamp when the pixel was fired.
                        is_success:
                          type: boolean
                          description: Whether the pixel fired successfully.
                        failed_attempts:
                          type: integer
                        last_attempt:
                          type: integer
                          description: Unix timestamp of the last retry attempt. 0 if no retries.
                        payload:
                          type: string
                          description: The pixel URL or HTML content that was fired.
                        debug_information:
                          type: string
                        delivery_method:
                          type: string
                          description: How the pixel was delivered.
                        pixel_level:
                          type: string
                          description: The scope of the pixel.
                        pixel_status:
                          type: string
                        pixel_type:
                          type: string
                          description: Whether this is a conversion or post-conversion event pixel.
                        relationship:
                          type: object
                          properties:
                            offer:
                              type: object
                              properties:
                                network_offer_id:
                                  type: integer
                                network_id:
                                  type: integer
                                network_advertiser_id:
                                  type: integer
                                network_offer_group_id:
                                  type: integer
                                network_tracking_domain_id:
                                  type: integer
                                name:
                                  type: string
                                offer_status:
                                  type: string
                                visibility:
                                  type: string
                                currency_id:
                                  type: string
                            affiliate:
                              type: object
                              properties:
                                network_affiliate_id:
                                  type: integer
                                network_id:
                                  type: integer
                                network_traffic_source_id:
                                  type: integer
                                name:
                                  type: string
                                account_status:
                                  type: string
                            campaign:
                              type: object
                              properties:
                                network_campaign_id:
                                  type: integer
                                network_id:
                                  type: integer
                                campaign_name:
                                  type: string
                                campaign_status:
                                  type: string
                            offer_group:
                              type: object
                              properties:
                                network_offer_group_id:
                                  type: integer
                                network_id:
                                  type: integer
                                network_advertiser_id:
                                  type: integer
                                name:
                                  type: string
                                offer_group_status:
                                  type: string
                                offer_count:
                                  type: integer
      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
