openapi: 3.0.3
info:
  title: Everflow Network API - Offer Visibility
  description: >
    Endpoints for managing offer visibility settings in the Everflow network.
    Visibility settings control which partners can see and access an offer —
    use them to protect high-value offers, prevent fraud, and ensure the
    right partners promote the right campaigns. For setup, see the
    [Offer Visibility guide](https://helpdesk.everflow.io/customer/managing-offer-visibility-partner-access).
  version: 1.0.0
servers:
  - url: https://api.eflow.team/v1
tags:
  - name: Offer Visibility
paths:
  /networks/offers/{offerId}/visibility:
    get:
      summary: Get Offer Visibility
      tags:
        - Offer Visibility
      parameters:
        - in: path
          name: offerId
          required: true
          schema:
            type: integer
          description: The offer ID.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  network_id:
                    type: integer
                    description: Network ID.
                  network_offer_id:
                    type: integer
                    description: Offer ID.
                  network_affiliate_visible_ids:
                    type: array
                    items:
                      type: integer
                    description: Affiliate IDs with visible access to the offer.
                  network_affiliate_rejected_ids:
                    type: array
                    items:
                      type: integer
                    description: Affiliate IDs with rejected access to the offer.
                  network_affiliate_hidden_ids:
                    type: array
                    items:
                      type: integer
                    description: Affiliate IDs with hidden access to the offer.
      security:
        - API Key: []
    put:
      summary: Set Offer Visibility
      tags:
        - Offer Visibility
      parameters:
        - in: path
          name: offerId
          required: true
          schema:
            type: integer
          description: The offer ID.
      requestBody:
        required: true
        content:
          application/json:
            example:
              network_affiliate_ids:
                - 7
                - 14
              set_type: "visible"
            schema:
              type: object
              required:
                - network_affiliate_ids
                - set_type
              properties:
                network_affiliate_ids:
                  type: array
                  items:
                    type: integer
                  description: List of affiliate IDs whose visibility will be set to the target `set_type`.
                set_type:
                  type: string
                  enum:
                    - visible
                    - hidden
                    - rejected
                  description: The type of visibility to apply to the specified affiliates. Values are `visible`, `hidden`, and `rejected`.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  network_id:
                    type: integer
                    description: Network ID.
                  network_offer_id:
                    type: integer
                    description: Offer ID.
                  network_affiliate_visible_ids:
                    type: array
                    items:
                      type: integer
                    description: Updated list of affiliate IDs with visible access.
                  network_affiliate_rejected_ids:
                    type: array
                    items:
                      type: integer
                    description: Updated list of affiliate IDs with rejected access.
                  network_affiliate_hidden_ids:
                    type: array
                    items:
                      type: integer
                    description: Updated list of affiliate IDs with hidden access.
      security:
        - API Key: []
  /networks/affiliates/{affiliateId}/offers/visibility:
    patch:
      summary: Update Affiliate Offer Visibility
      tags:
        - Offer Visibility
      parameters:
        - in: path
          name: affiliateId
          required: true
          schema:
            type: integer
          description: The affiliate ID.
      requestBody:
        required: true
        content:
          application/json:
            example:
              network_offer_ids: [1, 2, 3]
              visibility_type: "visible"
            schema:
              type: object
              required:
                - network_offer_ids
                - visibility_type
              properties:
                network_offer_ids:
                  type: array
                  items:
                    type: integer
                  description: List of offer IDs on which to set the target `visibility_type` for the affiliate.
                visibility_type:
                  type: string
                  enum:
                    - visible
                    - hidden
                    - rejected
                  description: The type of visibility to apply for the affiliate on the specified offers. Values are `visible`, `hidden`, and `rejected`.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: boolean
                    description: Whether the update was successful.
      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
