openapi: 3.0.3
info:
  title: Everflow Network API - Offers (Additional Endpoints)
  description: >
    Additional offer management endpoints for the Everflow partner marketing
    platform. Includes bulk editing, copying, streaming, payout/revenue config,
    forwarding rules, and more.
  version: 1.0.0
servers:
  - description: Production Server
    url: https://api.eflow.team/v1
tags:
  - name: Offers
    description: Additional endpoints for managing offers.
paths:
  /networks/patch/offers/apply:
    patch:
      summary: Apply Offer Bulk Edit
      tags:
        - Offers
      requestBody:
        required: true
        content:
          application/json:
            examples:
              pause_offers:
                summary: "Pause multiple offers"
                value:
                  network_offer_ids: [1, 2, 3]
                  fields:
                    - field_type: "offer_status"
                      field_value: "paused"
                      operator: "overwrite"
              update_payout_and_revenue:
                summary: "Update payout and revenue"
                value:
                  network_offer_ids: [5, 10]
                  fields:
                    - field_type: "payout"
                      field_value:
                        payout_type: "cpa"
                        payout_amount: 2.50
                        payout_percentage: 0
                      operator: "overwrite"
                    - field_type: "revenue"
                      field_value:
                        revenue_type: "rpa"
                        revenue_amount: 5.00
                        revenue_percentage: 0
                      operator: "overwrite"
              add_labels:
                summary: "Add labels to offers"
                value:
                  network_offer_ids: [1, 2, 3]
                  fields:
                    - field_type: "labels"
                      field_value: ["VIP"]
                      operator: "append"
            schema:
              $ref: '#/components/schemas/OfferPatchRequestBody'
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: boolean
                    description: Whether the bulk edit was successful.
      security:
        - API Key: []

  /networks/offers/{offerId}/copy:
    get:
      summary: Copy Offer
      description: >
        Duplicate an existing offer. Creates a new offer with the same
        configuration as the source offer, including targeting, caps, and
        payout settings. The new offer will be created in a paused state.
      tags:
        - Offers
      parameters:
        - in: path
          name: offerId
          required: true
          schema:
            type: integer
          description: The ID of the offer to copy.
        - in: query
          name: is_copy_custom_settings
          schema:
            type: boolean
          description: Copy custom settings
        - in: query
          name: is_copy_creatives
          schema:
            type: boolean
          description: Copy creatives
        - in: query
          name: is_copy_visibility
          schema:
            type: boolean
          description: Copy visibility settings
        - in: query
          name: is_copy_additional_urls
          schema:
            type: boolean
          description: Copy additional URLs
        - in: query
          name: is_copy_forwarding_rules
          schema:
            type: boolean
          description: Copy forwarding rules
        - in: query
          name: name
          schema:
            type: string
          description: Name for the copied offer
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                description: The newly created offer copy with all fields and relationships.
                properties:
                  network_offer_id:
                    type: integer
                    description: Unique offer ID of the new copy.
                  network_id:
                    type: integer
                  network_advertiser_id:
                    type: integer
                    description: Advertiser that owns this offer.
                  network_offer_group_id:
                    type: integer
                    description: Offer group ID.
                  name:
                    type: string
                    description: Offer name.
                  offer_status:
                    type: string
                    enum:
                      - active
                      - paused
                      - pending
                      - deleted
                  thumbnail_url:
                    type: string
                  visibility:
                    type: string
                    enum:
                      - public
                      - require_approval
                      - private
                  currency_id:
                    type: string
                  destination_url:
                    type: string
                    description: Destination URL for the offer.
                  server_side_url:
                    type: string
                    description: Server-side postback URL.
                  preview_url:
                    type: string
                  html_description:
                    type: string
                    description: HTML description of the offer.
                  internal_notes:
                    type: string
                    description: Internal notes (not visible to affiliates).
                  network_category_id:
                    type: integer
                  project_id:
                    type: string
                  date_live_until:
                    type: string
                    description: Offer expiration date (YYYY-MM-DD).
                  conversion_method:
                    type: string
                    enum:
                      - server_postback
                      - http_image_pixel
                      - https_image_pixel
                      - http_iframe_pixel
                      - https_iframe_pixel
                      - javascript
                      - cookie_based
                      - html_pixel_cookie_based
                  redirect_mode:
                    type: string
                    enum:
                      - standard
                      - single_meta_refresh
                      - double_meta_refresh
                      - seo_friendly
                  session_definition:
                    type: string
                    enum:
                      - cookie
                      - ip
                      - ip_user_agent
                      - google_ad_id
                      - idfa
                  session_duration:
                    type: integer
                    description: Session duration in hours.
                  attribution_method:
                    type: string
                    enum:
                      - first_touch
                      - last_touch
                  is_caps_enabled:
                    type: boolean
                  daily_conversion_cap:
                    type: integer
                  weekly_conversion_cap:
                    type: integer
                  monthly_conversion_cap:
                    type: integer
                  global_conversion_cap:
                    type: integer
                  daily_payout_cap:
                    type: integer
                  weekly_payout_cap:
                    type: integer
                  monthly_payout_cap:
                    type: integer
                  global_payout_cap:
                    type: integer
                  daily_revenue_cap:
                    type: integer
                  weekly_revenue_cap:
                    type: integer
                  monthly_revenue_cap:
                    type: integer
                  global_revenue_cap:
                    type: integer
                  daily_click_cap:
                    type: integer
                  weekly_click_cap:
                    type: integer
                  monthly_click_cap:
                    type: integer
                  global_click_cap:
                    type: integer
                  is_use_scrub_rate:
                    type: boolean
                  scrub_rate_percentage:
                    type: integer
                  is_duplicate_filter_enabled:
                    type: boolean
                  is_block_already_converted:
                    type: boolean
                  is_use_secure_link:
                    type: boolean
                  is_allow_deep_link:
                    type: boolean
                  is_session_tracking_enabled:
                    type: boolean
                  session_tracking_lifespan_hour:
                    type: integer
                  session_tracking_minimum_lifespan_second:
                    type: integer
                  session_tracking_start_on:
                    type: string
                    enum:
                      - null_value
                      - impression
                      - click
                  is_whitelist_check_enabled:
                    type: boolean
                  is_using_suppression_list:
                    type: boolean
                  suppression_list_id:
                    type: integer
                  network_tracking_domain_id:
                    type: integer
                  caps_timezone_id:
                    type: integer
                  app_identifier:
                    type: string
                  is_description_plain_text:
                    type: boolean
                  terms_and_conditions:
                    type: string
                  is_force_terms_and_conditions:
                    type: boolean
                  is_using_explicit_terms_and_conditions:
                    type: boolean
                  redirect_routing_method:
                    type: string
                    enum:
                      - unknown
                      - internal
                      - null_value
                  redirect_internal_routing_type:
                    type: string
                    enum:
                      - unknown
                      - priority
                      - weight
                      - null_value
                      - priority_global
                      - weight_global
                  scrub_rate_status:
                    type: string
                    enum:
                      - rejected
                      - pending
                  duplicate_filter_targeting_action:
                    type: string
                    enum:
                      - unknown
                      - block
                      - fail_traffic
                  already_converted_action:
                    type: string
                    enum:
                      - unknown
                      - block
                      - fail_traffic
                  is_must_approve_conversion:
                    type: boolean
                  is_allow_duplicate_conversion:
                    type: boolean
                  is_use_direct_linking:
                    type: boolean
                  is_seo_friendly:
                    type: boolean
                  is_fail_traffic_enabled:
                    type: boolean
                  is_view_through_enabled:
                    type: boolean
                  is_view_through_session_tracking_enabled:
                    type: boolean
                  view_through_destination_url:
                    type: string
                  view_through_session_tracking_lifespan_minute:
                    type: integer
                  view_through_session_tracking_minimal_lifespan_second:
                    type: integer
                  is_email_attribution_enabled:
                    type: boolean
                  is_email_attribution_window_enabled:
                    type: boolean
                  email_attribution_method:
                    type: string
                    enum:
                      - first_affiliate_attribution
                      - last_affiliate_attribution
                  email_attribution_window_minute:
                    type: integer
                  email_attribution_window_type:
                    type: string
                    enum:
                      - static
                      - dynamic
                  is_soft_cap:
                    type: boolean
                  time_created:
                    type: integer
                    example: 1734455015
                  time_saved:
                    type: integer
                    example: 1734455015
                  relationship:
                    type: object
                    description: Related data returned with the copied offer.
                    properties:
                      advertiser:
                        type: object
                        description: Advertiser that owns this offer.
                        properties:
                          network_advertiser_id:
                            type: integer
                          network_id:
                            type: integer
                          name:
                            type: string
                          account_status:
                            type: string
                          network_employee_id:
                            type: integer
                          internal_notes:
                            type: string
                          sales_manager_id:
                            type: integer
                          default_currency_id:
                            type: string
                          platform_name:
                            type: string
                          platform_url:
                            type: string
                          reporting_timezone_id:
                            type: integer
                          time_created:
                            type: integer
                            example: 1734455015
                          time_saved:
                            type: integer
                            example: 1734455015
                      category:
                        type: object
                        description: Offer category.
                        properties:
                          network_category_id:
                            type: integer
                          network_id:
                            type: integer
                          name:
                            type: string
                          status:
                            type: string
                          time_created:
                            type: integer
                            example: 1734455015
                          time_saved:
                            type: integer
                            example: 1734455015
                      creatives:
                        type: object
                        description: Creatives associated with this offer.
                        properties:
                          total:
                            type: integer
                          entries:
                            type: array
                            items:
                              type: object
                      traffic_filters:
                        type: object
                        description: Traffic filters configured for this offer.
                        properties:
                          total:
                            type: integer
                          entries:
                            type: array
                            items:
                              type: object
                      labels:
                        type: object
                        description: Labels applied to this offer.
                        properties:
                          total:
                            type: integer
                          entries:
                            type: array
                            items:
                              type: object
                      payout_revenue:
                        type: object
                        description: Payout and revenue configurations.
                        properties:
                          total:
                            type: integer
                          entries:
                            type: array
                            items:
                              type: object
                              properties:
                                network_offer_payout_revenue_id:
                                  type: integer
                                network_id:
                                  type: integer
                                network_offer_id:
                                  type: integer
                                entry_name:
                                  type: string
                                payout_type:
                                  type: string
                                payout_amount:
                                  type: number
                                payout_percentage:
                                  type: number
                                revenue_type:
                                  type: string
                                revenue_amount:
                                  type: number
                                revenue_percentage:
                                  type: number
                                is_default:
                                  type: boolean
                                is_private:
                                  type: boolean
                                is_postback_disabled:
                                  type: boolean
                                is_enforce_caps:
                                  type: boolean
                                time_created:
                                  type: integer
                                  example: 1734455015
                                global_advertiser_event_id:
                                  type: integer
                                is_must_approve_conversion:
                                  type: boolean
                                is_allow_duplicate_conversion:
                                  type: boolean
                                is_email_attribution_default_event:
                                  type: boolean
                      custom_cap_settings:
                        type: object
                        description: Custom cap settings per affiliate.
                        properties:
                          total:
                            type: integer
                          entries:
                            type: array
                            items:
                              type: object
                      custom_scrub_rate_settings:
                        type: object
                        description: Custom scrub rate settings per affiliate.
                        properties:
                          total:
                            type: integer
                          entries:
                            type: array
                            items:
                              type: object
                      custom_payout_revenue_settings:
                        type: object
                        description: Custom payout/revenue settings per affiliate.
                        properties:
                          total:
                            type: integer
                          entries:
                            type: array
                            items:
                              type: object
                      reporting:
                        type: object
                        description: Aggregated reporting metrics for this offer.
                        properties:
                          imp:
                            type: integer
                          total_click:
                            type: integer
                          unique_click:
                            type: integer
                          invalid_click:
                            type: integer
                          duplicate_click:
                            type: integer
                          gross_click:
                            type: integer
                          ctr:
                            type: number
                          cv:
                            type: integer
                          invalid_cv_scrub:
                            type: integer
                          view_through_cv:
                            type: integer
                          total_cv:
                            type: integer
                          event:
                            type: integer
                          cvr:
                            type: number
                          evr:
                            type: number
                          cpc:
                            type: number
                          cpm:
                            type: number
                          cpa:
                            type: number
                          epc:
                            type: number
                          rpc:
                            type: number
                          rpa:
                            type: number
                          rpm:
                            type: number
                          payout:
                            type: number
                          revenue:
                            type: number
                          event_revenue:
                            type: number
                          gross_sales:
                            type: number
                          profit:
                            type: number
                          margin:
                            type: number
                          roas:
                            type: number
                          avg_sale_value:
                            type: number
                          media_buying_cost:
                            type: number
                          on_hold_potential_revenue:
                            type: number
                          on_hold_potential_payout:
                            type: number
                          on_hold_conversion_count:
                            type: integer
                          public_events:
                            type: integer
                      audits:
                        type: object
                        description: Audit log entries for this offer.
                        properties:
                          total:
                            type: integer
                          entries:
                            type: array
                            items:
                              type: object
                      visibility:
                        type: object
                        description: Visibility settings controlling which affiliates can see or are blocked from the offer.
                        properties:
                          network_id:
                            type: integer
                          network_offer_id:
                            type: integer
                          network_affiliate_visible_ids:
                            type: array
                            items:
                              type: integer
                          network_affiliate_rejected_ids:
                            type: array
                            items:
                              type: integer
                          network_affiliate_hidden_ids:
                            type: array
                            items:
                              type: integer
                      integrations:
                        type: object
                        description: Third-party integration settings.
                        properties:
                          optizmo:
                            type: object
                            nullable: true
                          twentyfour_metrics:
                            type: object
                            nullable: true
                          offer_demand_partner:
                            type: object
                            nullable: true
                          forensiq:
                            type: object
                            nullable: true
                          ezepo:
                            type: object
                            nullable: true
                          anura:
                            type: object
                            nullable: true
                          invoca:
                            type: object
                            nullable: true
                          ip_quality_score:
                            type: object
                            nullable: true
                          unsubcentral:
                            type: object
                            nullable: true
                          ringba:
                            type: object
                            nullable: true
                          retreaver:
                            type: object
                            nullable: true
                      ruleset:
                        type: object
                        description: Targeting ruleset for this offer.
                        properties:
                          network_id:
                            type: integer
                          network_ruleset_id:
                            type: integer
                          time_created:
                            type: integer
                            example: 1734455015
                          time_saved:
                            type: integer
                            example: 1734455015
                          platforms:
                            type: array
                            items:
                              type: object
                          device_types:
                            type: array
                            items:
                              type: object
                          os_versions:
                            type: array
                            items:
                              type: object
                          browsers:
                            type: array
                            items:
                              type: object
                          languages:
                            type: array
                            items:
                              type: object
                          countries:
                            type: array
                            items:
                              type: object
                          regions:
                            type: array
                            items:
                              type: object
                          cities:
                            type: array
                            items:
                              type: object
                          dmas:
                            type: array
                            items:
                              type: object
                          mobile_carriers:
                            type: array
                            items:
                              type: object
                          connection_types:
                            type: array
                            items:
                              type: object
                          ips:
                            type: array
                            items:
                              type: object
                          is_block_proxy:
                            type: boolean
                          is_use_day_parting:
                            type: boolean
                          day_parting_apply_to:
                            type: string
                          day_parting_timezone_id:
                            type: integer
                          days_parting:
                            type: array
                            items:
                              type: object
                          isps:
                            type: array
                            items:
                              type: object
                          brands:
                            type: array
                            items:
                              type: object
                          postal_codes:
                            type: array
                            items:
                              type: object
                      urls:
                        type: object
                        description: Additional offer URLs.
                        properties:
                          total:
                            type: integer
                          entries:
                            type: array
                            items:
                              type: object
                      encoded_value:
                        type: string
                        description: Encoded offer ID for use in tracking links.
                      remaining_caps:
                        type: object
                        description: Remaining cap values for the offer.
                        properties:
                          remaining_daily_payout_cap:
                            type: number
                          remaining_daily_revenue_cap:
                            type: number
                          remaining_daily_conversion_cap:
                            type: number
                          remaining_daily_click_cap:
                            type: number
                          remaining_weekly_payout_cap:
                            type: number
                          remaining_weekly_revenue_cap:
                            type: number
                          remaining_weekly_conversion_cap:
                            type: number
                          remaining_weekly_click_cap:
                            type: number
                          remaining_monthly_payout_cap:
                            type: number
                          remaining_monthly_revenue_cap:
                            type: number
                          remaining_monthly_conversion_cap:
                            type: number
                          remaining_monthly_click_cap:
                            type: number
                          remaining_global_payout_cap:
                            type: number
                          remaining_global_revenue_cap:
                            type: number
                          remaining_global_conversion_cap:
                            type: number
                          remaining_global_click_cap:
                            type: number
                      is_locked_currency:
                        type: boolean
                        description: Whether the currency is locked for this offer.
                      is_locked_caps_timezone:
                        type: boolean
                        description: Whether the caps timezone is locked for this offer.
                      is_dmo:
                        type: boolean
                        description: Whether this offer is a DMO (Demand Marketplace Offer).
                      custom_creative_settings:
                        type: object
                        description: Custom creative settings per affiliate.
                        properties:
                          total:
                            type: integer
                          entries:
                            type: array
                            items:
                              type: object
                      channels:
                        type: object
                        description: Channels this offer belongs to.
                        properties:
                          total:
                            type: integer
                          entries:
                            type: array
                            items:
                              type: object
                      advertiser_global_events:
                        type: array
                        description: Global events defined by the advertiser.
                        items:
                          type: object
                      email:
                        type: object
                        description: Email settings for this offer.
                      email_optout:
                        type: object
                        description: Email optout settings for this offer.
                      meta:
                        type: object
                        description: App metadata for this offer.
                        properties:
                          network_offer_id:
                            type: integer
                          network_id:
                            type: integer
                          app_id:
                            type: string
                          meta_platform:
                            type: string
                          advertiser_campaign_name:
                            type: string
                          bundle_id:
                            type: string
                          category:
                            type: string
                          store_url:
                            type: string
                          score_rating:
                            type: number
                          total_rating:
                            type: number
                          size:
                            type: number
                          developer:
                            type: string
                          version:
                            type: string
                          is_app_unavailable:
                            type: boolean
                          time_created:
                            type: integer
                            example: 1734455015
                          time_app_data_saved:
                            type: integer
                            example: 1734455015
                          time_saved:
                            type: integer
                            example: 1734455015
                      requirement_kpis:
                        type: object
                        description: KPI requirements for this offer.
                        properties:
                          total:
                            type: integer
                          entries:
                            type: array
                            items:
                              type: object
                      requirement_tracking_parameters:
                        type: object
                        description: Required tracking parameters for this offer.
                        properties:
                          total:
                            type: integer
                          entries:
                            type: array
                            items:
                              type: object
      security:
        - API Key: []

  /networks/offers:
    get:
      summary: List All Offers
      description: >
        Simple paginated list of all offers without table search. Returns
        offers in a lightweight format suitable for dropdowns, selectors,
        and other UI components that need a full offer list.
      tags:
        - Offers
      parameters:
        - in: query
          name: page
          schema:
            type: integer
            default: 1
          description: Page number (1-based).
        - in: query
          name: page_size
          schema:
            type: integer
            default: 50
          description: Number of results per page.
        - in: query
          name: relationship
          schema:
            type: string
          description: Include related data in the response.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  offers:
                    type: array
                    items:
                      type: object
                      description: Offer record.
                  paging:
                    type: object
                    properties:
                      page:
                        type: integer
                      page_size:
                        type: integer
                      total_count:
                        type: integer
      security:
        - API Key: []

  /networks/offers/{offerId}/payoutrevenue:
    get:
      summary: Get Offer Payout/Revenue Config
      tags:
        - Offers
      parameters:
        - in: path
          name: offerId
          required: true
          schema:
            type: integer
          description: The offer ID.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  payout_revenue:
                    type: array
                    items:
                      type: object
      security:
        - API Key: []
    put:
      summary: Update Offer Payout/Revenue
      tags:
        - Offers
      parameters:
        - in: path
          name: offerId
          required: true
          schema:
            type: integer
          description: The offer ID.
      requestBody:
        required: true
        content:
          application/json:
            example:
              - network_offer_payout_revenue_id: 1
                payout_type: "cpa"
                payout_amount: 2.50
                revenue_type: "rpa"
                revenue_amount: 4.00
                is_default: true
            schema:
              type: array
              description: Array of payout/revenue configuration objects to set.
              items:
                type: object
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  payout_revenue:
                    type: array
                    items:
                      type: object
      security:
        - API Key: []

  /networks/forwardingrules:
    get:
      summary: Get All Forwarding Rules
      tags:
        - Offers
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  forwarding_rules:
                    type: array
                    items:
                      $ref: "#/components/schemas/ForwardingRule"
      security:
        - API Key: []

  /networks/forwardingrules/{forwardingRuleId}:
    put:
      summary: Update Forwarding Rule
      tags:
        - Offers
      parameters:
        - in: path
          name: forwardingRuleId
          required: true
          schema:
            type: integer
          description: The forwarding rule ID.
      requestBody:
        required: true
        content:
          application/json:
            example:
              network_offer_id: 1
              name: "Cap Redirect Rule"
              status: "active"
              is_apply_all_affiliates: true
              network_affiliate_ids: []
              forwarding_network_offer_id: 2
              forwarding_network_offer_url_id: 0
              forwarding_network_offer_group_id: 0
              forwarding_network_campaign_id: 0
              forwarding_destination_url: ""
              is_apply_specific_offer_url: false
              incoming_network_offer_url_ids: []
            schema:
              type: object
              required:
                - network_offer_id
                - name
                - status
                - is_apply_all_affiliates
                - network_affiliate_ids
                - forwarding_network_offer_id
                - forwarding_network_offer_url_id
                - forwarding_network_offer_group_id
                - forwarding_network_campaign_id
                - forwarding_destination_url
                - is_apply_specific_offer_url
                - incoming_network_offer_url_ids
              properties:
                network_offer_id:
                  type: integer
                  description: The offer ID this forwarding rule belongs to.
                name:
                  type: string
                  description: Display name for this forwarding rule.
                status:
                  type: string
                  enum:
                    - active
                    - inactive
                  description: Status of the forwarding rule.
                is_apply_all_affiliates:
                  type: boolean
                  description: Whether this rule applies to all affiliates.
                network_affiliate_ids:
                  type: array
                  items:
                    type: integer
                  description: Array of affiliate IDs this rule applies to. Used when `is_apply_all_affiliates` is `false`.
                forwarding_network_offer_id:
                  type: integer
                  description: The offer ID to forward traffic to.
                forwarding_network_offer_url_id:
                  type: integer
                  description: The specific offer URL ID to forward to.
                forwarding_network_offer_group_id:
                  type: integer
                  description: The offer group ID to forward to.
                forwarding_network_campaign_id:
                  type: integer
                  description: The campaign ID to forward to.
                forwarding_destination_url:
                  type: string
                  description: A direct destination URL to forward traffic to.
                is_apply_specific_offer_url:
                  type: boolean
                  description: Whether this rule only applies to specific incoming offer URLs.
                incoming_network_offer_url_ids:
                  type: array
                  items:
                    type: integer
                  description: Array of incoming offer URL IDs this rule applies to. Used when `is_apply_specific_offer_url` is `true`.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ForwardingRule"
      security:
        - API Key: []

  /networks/patch/offers/submit:
    post:
      summary: Offer Bulk Edit Preview
      tags:
        - Offers
      requestBody:
        required: true
        content:
          application/json:
            example:
              network_offer_ids: [1, 2, 3]
              fields:
                - field_type: "offer_status"
                  field_value: "paused"
                  operator: "overwrite"
            schema:
              $ref: '#/components/schemas/OfferPatchRequestBody'
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  changes:
                    type: array
                    items:
                      type: object
                      properties:
                        network_offer:
                          type: object
                          properties:
                            network_offer_id:
                              type: integer
                            network_id:
                              type: integer
                            name:
                              type: string
                            offer_status:
                              type: string
                        change_status:
                          type: string
                          enum:
                            - ok
                            - error
                            - no_change
                        current_field:
                          type: object
                          properties:
                            field_type:
                              type: string
                            field_value: {}
                            operator:
                              type: string
                        changed_field:
                          type: object
                          properties:
                            field_type:
                              type: string
                            field_value: {}
                            operator:
                              type: string
                        error_message:
                          type: string
                        related_changes:
                          type: string
                  resource_errors:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        label:
                          type: string
                        type:
                          type: string
                        message:
                          type: string
      security:
        - API Key: []

  /networks/export/offers:
    post:
      summary: Export Offers
      tags:
        - Offers
      requestBody:
        required: true
        content:
          application/json:
            examples:
              csv_basic:
                summary: "Export basic fields as CSV"
                value:
                  format: "csv"
                  fields:
                    - "network_offer_id"
                    - "name"
                    - "offer_status"
                    - "payout_type"
                    - "payout_amount"
                  query:
                    filters:
                      offer_status: "active"
              json_with_filters:
                summary: "Export as JSON with filters"
                value:
                  format: "json"
                  fields:
                    - "network_offer_id"
                    - "name"
                    - "destination_url"
                    - "visibility"
                  query:
                    search_terms:
                      - search_type: "name"
                        value: "insurance"
                    filters:
                      offer_status: "active"
                      visibilities:
                        - "public"
            schema:
              type: object
              required:
                - format
                - fields
              properties:
                format:
                  type: string
                  enum:
                    - csv
                    - json
                  description: Export format.
                fields:
                  type: array
                  description: Array of field names to include in the export.
                  items:
                    type: string
                    enum:
                      - network_offer_id
                      - name
                      - category
                      - network_advertiser_id
                      - network_offer_group_id
                      - internal_notes
                      - destination_url
                      - server_side_url
                      - is_view_through_enabled
                      - view_through_destination_url
                      - preview_url
                      - offer_status
                      - currency_id
                      - project_id
                      - date_live_until
                      - is_using_explicit_terms_and_conditions
                      - terms_and_conditions
                      - is_caps_enabled
                      - daily_conversion_cap
                      - weekly_conversion_cap
                      - monthly_conversion_cap
                      - global_conversion_cap
                      - daily_payout_cap
                      - weekly_payout_cap
                      - monthly_payout_cap
                      - global_payout_cap
                      - daily_revenue_cap
                      - weekly_revenue_cap
                      - monthly_revenue_cap
                      - global_revenue_cap
                      - daily_click_cap
                      - weekly_click_cap
                      - monthly_click_cap
                      - global_click_cap
                      - redirect_mode
                      - is_must_approve_conversion
                      - is_allow_duplicate_conversion
                      - is_duplicate_filter_enabled
                      - duplicate_filter_targeting_action
                      - network_tracking_domain_id
                      - is_use_secure_link
                      - is_allow_deep_link
                      - is_session_tracking_enabled
                      - session_tracking_lifespan_hour
                      - is_view_through_session_tracking_enabled
                      - view_through_session_tracking_lifespan_minute
                      - is_fail_traffic_enabled
                      - redirect_routing_method
                      - redirect_internal_routing_type
                      - visibility
                      - time_created
                      - time_saved
                      - conversion_method
                      - is_whitelist_check_enabled
                      - is_use_scrub_rate
                      - scrub_rate_status
                      - scrub_rate_percentage
                      - session_definition
                      - session_duration
                      - app_identifier
                      - entry_name
                      - payout_type
                      - payout_amount
                      - payout_percentage
                      - revenue_type
                      - revenue_amount
                      - revenue_percentage
                      - network_advertiser_name
                      - network_advertiser_account_manager
                      - network_advertiser_sales_manager
                      - suppression_file_url
                      - unsubscribe_url
                      - countries
                      - network_tracking_domain_url
                      - category_name
                      - channels
                      - offer_encoded_value
                status:
                  type: string
                  enum:
                    - active
                    - paused
                    - pending
                    - deleted
                  description: Filter by offer status (top-level shortcut).
                query:
                  type: object
                  description: Filter criteria for the export. Uses the same search terms and filters as the offerstable endpoint.
                  properties:
                    search_terms:
                      type: array
                      items:
                        type: object
                        properties:
                          search_type:
                            type: string
                            enum:
                              - name
                              - encoded_value
                              - advertiser_name
                          value:
                            type: string
                      description: Text search filters.
                    filters:
                      type: object
                      description: Structured filters to narrow results.
                      properties:
                        offer_status:
                          type: string
                          enum:
                            - active
                            - paused
                            - pending
                            - deleted
                        visibilities:
                          type: array
                          items:
                            type: string
                            enum:
                              - public
                              - require_approval
                              - private
                        labels:
                          type: array
                          items:
                            type: string
                        network_category_ids:
                          type: array
                          items:
                            type: integer
                        network_advertiser_ids:
                          type: array
                          items:
                            type: integer
                        network_offer_group_id:
                          type: integer
                        payout_types:
                          type: array
                          items:
                            type: string
                        revenue_types:
                          type: array
                          items:
                            type: string
                        country_ids:
                          type: array
                          items:
                            type: integer
                        platform_ids:
                          type: array
                          items:
                            type: integer
                        device_type_ids:
                          type: array
                          items:
                            type: integer
                        business_unit_ids:
                          type: array
                          items:
                            type: integer
                        account_manager_ids:
                          type: array
                          items:
                            type: integer
                        sales_manager_ids:
                          type: array
                          items:
                            type: integer
                        network_tracking_domain_ids:
                          type: array
                          items:
                            type: integer
                        network_channel_ids:
                          type: array
                          items:
                            type: integer
      responses:
        "200":
          description: OK — returns exported data in the requested format. CSV format returns a file with headers as the first row. JSON format returns newline-delimited JSON objects.
        "400":
          description: Bad request — invalid format or parameters.
      security:
        - API Key: []

components:
  schemas:
    OfferPatchRequestBody:
      type: object
      required:
        - network_offer_ids
        - fields
      properties:
        network_offer_ids:
          type: array
          items:
            type: integer
          description: Array of offer IDs to update.
        fields:
          type: array
          items:
            type: object
            required:
              - field_type
              - field_value
              - operator
            properties:
              field_type:
                type: string
                description: The offer field to update.
                enum:
                  - offer_status
                  - network_advertiser_id
                  - network_offer_group_id
                  - network_category_id
                  - currency_id
                  - labels
                  - app_identifier
                  - internal_notes
                  - project_id
                  - channels
                  - date_live_until
                  - html_description
                  - is_offer_description_plaintext
                  - destination_url
                  - destination_url_replace
                  - offer_name
                  - preview_url
                  - preview_url_replace
                  - invoca_enabled
                  - payout_revenue_name
                  - revenue
                  - payout
                  - is_must_approve_conversion
                  - is_allow_duplicate_conversion
                  - is_postback_disabled
                  - additional_events
                  - network_tracking_domain_id
                  - conversion_method
                  - is_use_secure_link
                  - is_allow_deep_link
                  - is_use_direct_linking
                  - is_caps_enabled
                  - is_soft_cap
                  - daily_click_cap
                  - weekly_click_cap
                  - monthly_click_cap
                  - global_click_cap
                  - daily_conversion_cap
                  - weekly_conversion_cap
                  - monthly_conversion_cap
                  - global_conversion_cap
                  - daily_payout_cap
                  - weekly_payout_cap
                  - monthly_payout_cap
                  - global_payout_cap
                  - daily_revenue_cap
                  - weekly_revenue_cap
                  - monthly_revenue_cap
                  - global_revenue_cap
                  - visibility
                  - is_using_explicit_terms_and_conditions
                  - is_force_terms_and_conditions
                  - terms_and_conditions
                  - is_whitelist_check_enabled
                  - session_definition
                  - session_duration
                  - is_duplicate_filter_enabled
                  - duplicate_filter_targeting_action
                  - redirect_mode
                  - requirement_kpis
                  - requirement_tracking_parameters
                  - is_block_already_converted
                  - already_converted_action
                  - is_use_scrub_rate
                  - scrub_rate_status
                  - scrub_rate_percentage
                  - is_session_tracking_enabled
                  - session_tracking_lifespan_hour
                  - session_tracking_minimum_lifespan_second
                  - attribution_method
                  - is_view_through_enabled
                  - is_view_through_session_tracking_enabled
                  - view_through_session_tracking_lifespan_minute
                  - view_through_session_tracking_minimal_lifespan_second
                  - twentyfour_metrics_network_integration_twentyfour_metrics_tracker_id
                  - forensiq_is_forensiq_click_threshold_enabled
                  - forensiq_click_threshold
                  - forensiq_action
                  - forensiq_is_forensiq_conversion_threshold_enabled
                  - forensiq_conversion_threshold
                  - forensiq_conversion_status
                  - anura_enabled
                  - ip_quality_score_enabled
                  - ip_quality_score_min_fraud_score
                  - ip_quality_score_min_fraud_score_mobile
                  - ip_quality_score_action
                  - server_side_url
                  - server_side_url_replace
                  - view_through_destination_url
                  - view_through_destination_url_replace
                  - ruleset_platforms
                  - ruleset_device_types
                  - ruleset_browsers
                  - ruleset_os_versions
                  - ruleset_languages
                  - ruleset_countries
                  - ruleset_regions
                  - ruleset_cities
                  - ruleset_dmas
                  - ruleset_mobile_carriers
                  - ruleset_isps
                  - ruleset_connection_types
                  - ruleset_ips
                  - ruleset_is_block_proxy
                  - ruleset_brands
                  - ruleset_postal_codes
                  - traffic_filters
                  - ruleset_is_use_day_parting
                  - ruleset_day_parting_apply_to
                  - ruleset_day_parting_timezone_id
                  - ruleset_days_parting
                  - is_fail_traffic_enabled
                  - redirect_internal_routing_type
                  - email_is_enabled
                  - email_subject_lines
                  - email_from_lines
                  - email_optout_is_enabled
                  - email_optout_suppression_file_link
                  - email_optout_unsub_link
                  - email_suppression_file
                  - ezepo_enabled
                  - optizmo_optoutlist_id
                  - unsubcentral_list_id
              field_value:
                description: The new value for the field. Type depends on the field being updated (string, integer, boolean, float, array, or object).
              operator:
                type: string
                enum:
                  - overwrite
                  - append
                  - delete
                  - clear
                description: >
                  How to apply the value. `overwrite` replaces the current value,
                  `append` adds to existing values (for list fields like labels),
                  `delete` removes specific values, `clear` resets the field.
          description: Array of field changes to apply.
    ForwardingRule:
      type: object
      properties:
        network_offer_forwarding_rule_id:
          type: integer
          description: Unique forwarding rule ID.
          readOnly: true
        network_id:
          type: integer
          description: Network ID.
          readOnly: true
        network_offer_id:
          type: integer
          description: The offer ID this forwarding rule belongs to.
        name:
          type: string
          description: Display name for this forwarding rule.
        status:
          type: string
          enum:
            - active
            - inactive
          description: Status of the forwarding rule.
        is_apply_all_affiliates:
          type: boolean
          description: Whether this rule applies to all affiliates.
        network_affiliate_ids:
          type: array
          items:
            type: integer
          description: Array of affiliate IDs this rule applies to.
        forwarding_network_offer_id:
          type: integer
          description: The offer ID to forward traffic to.
        forwarding_network_offer_url_id:
          type: integer
          description: The specific offer URL ID to forward to.
        forwarding_network_offer_group_id:
          type: integer
          description: The offer group ID to forward to.
        forwarding_network_campaign_id:
          type: integer
          description: The campaign ID to forward to.
        forwarding_destination_url:
          type: string
          description: A direct destination URL to forward traffic to.
        is_apply_specific_offer_url:
          type: boolean
          description: Whether this rule only applies to specific incoming offer URLs.
        incoming_network_offer_url_ids:
          type: array
          items:
            type: integer
          description: Array of incoming offer URL IDs this rule applies to.
        time_created:
          type: integer
          example: 1734455015
          description: Unix timestamp of creation.
          readOnly: true
        time_saved:
          type: integer
          example: 1734455015
          description: Unix timestamp of last update.
          readOnly: true
        time_deleted:
          type: integer
          example: 0
          description: Unix timestamp of deletion.
          readOnly: true
        relationship:
          type: object
          description: Related data for this forwarding rule.
  securitySchemes:
    API Key:
      description: The Everflow API key generated from the Control Center > Security.
      in: header
      name: X-Eflow-Api-Key
      type: apiKey
