openapi: 3.0.3
info:
  title: Everflow Network API - Tracking Domains
  description: >
    Endpoints for managing tracking domains and affiliate tracking domain
    assignments. Tracking domains are the custom domains used to construct
    tracking links and impression URLs for offers. Affiliate tracking domain
    assignments control which tracking domain a specific partner uses when
    generating links.
    For more detail, see [Tracking & Conversion Domain Management](https://helpdesk.everflow.io/customer/tracking-conversion-domain-management) in the Help Center.
  version: 1.0.0
servers:
  - url: https://api.eflow.team/v1
tags:
  - name: Tracking Domains
paths:
  /networks/domains/tracking:
    get:
      summary: List Tracking Domains
      tags:
        - Tracking Domains
      responses:
        "200":
          description: ""
          content:
            application/json:
              example:
                domains:
                  - network_tracking_domain_id: 1
                    network_id: 1
                    url: "www.testtracking.com"
                    is_primary_domain: true
                    domain_status: "active"
                    is_unassignable: false
                    ownership: "internal"
                    is_ssl_enabled: false
                    html_static_redirect: ""
                    url_redirect: ""
                    public_notes: ""
                    time_created: 1774296114
                    time_saved: 1774296114
              schema:
                type: object
                properties:
                  domains:
                    type: array
                    description: List of tracking domains.
                    items:
                      $ref: "#/components/schemas/TrackingDomain"
      security:
        - API Key: []
  /networks/domains/tracking/{domainId}:
    get:
      summary: Get Tracking Domain
      description: >
        Retrieve a single tracking domain by its ID.
      tags:
        - Tracking Domains
      parameters:
        - in: path
          name: domainId
          required: true
          schema:
            type: integer
          description: The unique tracking domain ID.
      responses:
        "200":
          description: ""
          content:
            application/json:
              example:
                network_tracking_domain_id: 1
                network_id: 1
                url: "www.testtracking.com"
                is_primary_domain: true
                domain_status: "active"
                is_unassignable: false
                ownership: "internal"
                is_ssl_enabled: false
                html_static_redirect: ""
                url_redirect: ""
                public_notes: ""
                time_created: 1774296114
                time_saved: 1774296114
              schema:
                $ref: "#/components/schemas/TrackingDomain"
        "404":
          description: Tracking domain not found.
      security:
        - API Key: []
  /networks/affiliates/{affiliateId}/trackingdomains:
    get:
      summary: List Affiliate Tracking Domains
      tags:
        - Tracking Domains
      parameters:
        - in: path
          name: affiliateId
          required: true
          schema:
            type: integer
          description: The unique affiliate ID.
      responses:
        "200":
          description: ""
          content:
            application/json:
              example:
                tracking_domains:
                  - network_affiliate_tracking_domain_id: 1
                    network_id: 1
                    network_affiliate_id: 7
                    network_tracking_domain_id: 1
                    is_apply_all_offers: true
                    network_offer_id: 0
                    relationship:
                      affiliate:
                        network_affiliate_id: 7
                        network_id: 1
                        name: "Partner A"
                        account_status: "active"
                        network_traffic_source_id: 0
                      tracking_domain:
                        network_tracking_domain_id: 1
                        network_id: 1
                        url: "www.testtracking.com"
                        is_primary_domain: true
                        domain_status: "active"
                        is_unassignable: false
                        ownership: "internal"
                        is_ssl_enabled: false
                        html_static_redirect: ""
                        url_redirect: ""
                        public_notes: ""
                        time_created: 1774296114
                        time_saved: 1774296114
              schema:
                type: object
                properties:
                  tracking_domains:
                    type: array
                    description: List of affiliate tracking domain assignments.
                    items:
                      $ref: "#/components/schemas/AffiliateTrackingDomain"
      security:
        - API Key: []
    post:
      summary: Create Affiliate Tracking Domain
      tags:
        - Tracking Domains
      parameters:
        - in: path
          name: affiliateId
          required: true
          schema:
            type: integer
          description: The unique affiliate ID.
      requestBody:
        required: true
        content:
          application/json:
            example:
              network_affiliate_id: 7
              network_tracking_domain_id: 1
              is_apply_all_offers: false
              network_offer_ids: [1, 25]
            schema:
              $ref: "#/components/schemas/AffiliateTrackingDomainInput"
      responses:
        "200":
          description: ""
          content:
            application/json:
              example:
                tracking_domains:
                  - network_affiliate_tracking_domain_id: 4
                    network_id: 1
                    network_affiliate_id: 7
                    network_tracking_domain_id: 1
                    is_apply_all_offers: false
                    network_offer_id: 1
                    relationship:
                      affiliate:
                        network_affiliate_id: 7
                        network_id: 1
                        name: "Partner A"
                        account_status: "active"
                        network_traffic_source_id: 0
                      tracking_domain:
                        network_tracking_domain_id: 1
                        network_id: 1
                        url: "www.testtracking.com"
                        is_primary_domain: true
                        domain_status: "active"
                        is_unassignable: false
                        ownership: "internal"
                        is_ssl_enabled: false
                        html_static_redirect: ""
                        url_redirect: ""
                        public_notes: ""
                        time_created: 1774296114
                        time_saved: 1774296114
                      offer:
                        network_offer_id: 1
                        network_id: 1
                        network_advertiser_id: 13
                        network_offer_group_id: 0
                        name: "Auto Game"
                        offer_status: "active"
                        network_tracking_domain_id: 1
                        visibility: "public"
                        currency_id: "USD"
                  - network_affiliate_tracking_domain_id: 5
                    network_id: 1
                    network_affiliate_id: 7
                    network_tracking_domain_id: 1
                    is_apply_all_offers: false
                    network_offer_id: 25
                    relationship:
                      affiliate:
                        network_affiliate_id: 7
                        network_id: 1
                        name: "Partner A"
                        account_status: "active"
                        network_traffic_source_id: 0
                      tracking_domain:
                        network_tracking_domain_id: 1
                        network_id: 1
                        url: "www.testtracking.com"
                        is_primary_domain: true
                        domain_status: "active"
                        is_unassignable: false
                        ownership: "internal"
                        is_ssl_enabled: false
                        html_static_redirect: ""
                        url_redirect: ""
                        public_notes: ""
                        time_created: 1774296114
                        time_saved: 1774296114
                      offer:
                        network_offer_id: 25
                        network_id: 1
                        network_advertiser_id: 13
                        network_offer_group_id: 0
                        name: "Travel Daily"
                        offer_status: "active"
                        network_tracking_domain_id: 1
                        visibility: "private"
                        currency_id: "USD"
              schema:
                type: object
                properties:
                  tracking_domains:
                    type: array
                    description: List of created affiliate tracking domain assignments.
                    items:
                      $ref: "#/components/schemas/AffiliateTrackingDomain"
      security:
        - API Key: []
    put:
      summary: Update Affiliate Tracking Domain
      tags:
        - Tracking Domains
      parameters:
        - in: path
          name: affiliateId
          required: true
          schema:
            type: integer
          description: The unique affiliate ID.
      requestBody:
        required: true
        content:
          application/json:
            example:
              network_affiliate_id: 7
              network_tracking_domain_id: 1
              network_affiliate_tracking_domain_id: 4
              is_apply_all_offers: false
              network_offer_id: 1
            schema:
              type: object
              required:
                - network_affiliate_id
                - network_tracking_domain_id
                - network_affiliate_tracking_domain_id
                - is_apply_all_offers
                - network_offer_id
              properties:
                network_affiliate_id:
                  type: integer
                  description: The affiliate ID.
                network_tracking_domain_id:
                  type: integer
                  description: The tracking domain ID to assign.
                network_affiliate_tracking_domain_id:
                  type: integer
                  description: The ID of the affiliate tracking domain assignment to update.
                is_apply_all_offers:
                  type: boolean
                  description: Whether to apply this tracking domain to all offers.
                network_offer_id:
                  type: integer
                  description: The offer ID to apply this tracking domain to.
      responses:
        "200":
          description: ""
          content:
            application/json:
              example:
                network_affiliate_tracking_domain_id: 4
                network_id: 1
                network_affiliate_id: 7
                network_tracking_domain_id: 1
                is_apply_all_offers: false
                network_offer_id: 1
                relationship:
                  affiliate:
                    network_affiliate_id: 7
                    network_id: 1
                    name: "Partner A"
                    account_status: "active"
                    network_traffic_source_id: 0
                  tracking_domain:
                    network_tracking_domain_id: 1
                    network_id: 1
                    url: "www.testtracking.com"
                    is_primary_domain: true
                    domain_status: "active"
                    is_unassignable: false
                    ownership: "internal"
                    is_ssl_enabled: false
                    html_static_redirect: ""
                    url_redirect: ""
                    public_notes: ""
                    time_created: 1774296114
                    time_saved: 1774296114
                  offer:
                    network_offer_id: 1
                    network_id: 1
                    network_advertiser_id: 13
                    network_offer_group_id: 0
                    name: "Auto Game"
                    offer_status: "active"
                    network_tracking_domain_id: 1
                    visibility: "public"
                    currency_id: "USD"
              schema:
                $ref: "#/components/schemas/AffiliateTrackingDomain"
      security:
        - API Key: []
  /networks/affiliates/{affiliateId}/trackingdomains/{affiliateTrackingDomainId}:
    get:
      summary: Get Affiliate Tracking Domain
      description: >
        Retrieve a single affiliate tracking domain assignment by its ID.
      tags:
        - Tracking Domains
      parameters:
        - in: path
          name: affiliateId
          required: true
          schema:
            type: integer
          description: The unique affiliate ID.
        - in: path
          name: affiliateTrackingDomainId
          required: true
          schema:
            type: integer
          description: The unique affiliate tracking domain ID.
      responses:
        "200":
          description: ""
          content:
            application/json:
              example:
                network_affiliate_tracking_domain_id: 1
                network_id: 1
                network_affiliate_id: 7
                network_tracking_domain_id: 1
                is_apply_all_offers: true
                network_offer_id: 0
                relationship:
                  affiliate:
                    network_affiliate_id: 7
                    network_id: 1
                    name: "Partner A"
                    account_status: "active"
                    network_traffic_source_id: 0
                  tracking_domain:
                    network_tracking_domain_id: 1
                    network_id: 1
                    url: "www.testtracking.com"
                    is_primary_domain: true
                    domain_status: "active"
                    is_unassignable: false
                    ownership: "internal"
                    is_ssl_enabled: false
                    html_static_redirect: ""
                    url_redirect: ""
                    public_notes: ""
                    time_created: 1774296114
                    time_saved: 1774296114
              schema:
                $ref: "#/components/schemas/AffiliateTrackingDomain"
        "400":
          description: Could not fetch the affiliate tracking domain from the database.
        "404":
          description: Affiliate tracking domain not found.
      security:
        - API Key: []
    delete:
      summary: Delete Affiliate Tracking Domain
      description: >
        Remove a tracking domain assignment from an affiliate.
      tags:
        - Tracking Domains
      parameters:
        - in: path
          name: affiliateId
          required: true
          schema:
            type: integer
          description: The unique affiliate ID.
        - in: path
          name: affiliateTrackingDomainId
          required: true
          schema:
            type: integer
          description: The unique affiliate tracking domain ID.
      responses:
        "200":
          description: ""
          content:
            application/json:
              example:
                result: true
              schema:
                type: object
                properties:
                  result:
                    type: boolean
                    description: Whether the deletion was successful.
      security:
        - API Key: []
components:
  schemas:
    TrackingDomain:
      type: object
      properties:
        network_tracking_domain_id:
          type: integer
          description: Unique tracking domain ID.
        network_id:
          type: integer
          description: Network ID this domain belongs to.
        url:
          type: string
          description: The tracking domain URL.
        is_primary_domain:
          type: boolean
          description: Whether this is the primary tracking domain.
        domain_status:
          type: string
          enum:
            - active
            - deleted
          description: Domain status.
        is_ssl_enabled:
          type: boolean
          description: Whether SSL is enabled for this domain.
        is_unassignable:
          type: boolean
          description: Whether the domain cannot be assigned to offers.
        public_notes:
          type: string
          description: Public-facing notes for this domain.
        time_created:
          type: integer
          example: 1734455015
          description: Unix timestamp of creation.
        time_saved:
          type: integer
          example: 1734455015
          description: Unix timestamp of last update.
        ownership:
          type: string
          description: Domain ownership information.
        html_static_redirect:
          type: string
          description: HTML static redirect content.
        url_redirect:
          type: string
          description: URL redirect value.
    AffiliateTrackingDomain:
      type: object
      properties:
        network_affiliate_tracking_domain_id:
          type: integer
          description: Unique affiliate tracking domain assignment ID.
        network_id:
          type: integer
          description: Network ID.
        network_affiliate_id:
          type: integer
          description: Affiliate ID.
        network_tracking_domain_id:
          type: integer
          description: Tracking domain ID.
        is_apply_all_offers:
          type: boolean
          description: Whether this tracking domain applies to all offers.
        network_offer_id:
          type: integer
          description: The specific offer ID this domain is applied to.
        relationship:
          type: object
          description: >
            Related data for this affiliate tracking domain assignment. Includes
            affiliate, tracking domain, and optionally offer details.
          properties:
            affiliate:
              type: object
              description: Related affiliate details.
              properties:
                network_affiliate_id:
                  type: integer
                  description: The affiliate ID.
                network_id:
                  type: integer
                  description: The network ID.
                name:
                  type: string
                  description: The affiliate name.
                account_status:
                  type: string
                  description: The affiliate account status.
                network_traffic_source_id:
                  type: integer
                  description: The traffic source ID associated with the affiliate.
            tracking_domain:
              type: object
              description: Related tracking domain details.
              properties:
                network_tracking_domain_id:
                  type: integer
                  description: The tracking domain ID.
                network_id:
                  type: integer
                  description: The network ID.
                url:
                  type: string
                  description: The tracking domain URL.
                is_primary_domain:
                  type: boolean
                  description: Whether this is the primary tracking domain.
                domain_status:
                  type: string
                  description: Domain status.
                is_unassignable:
                  type: boolean
                  description: Whether the domain cannot be assigned to offers.
                ownership:
                  type: string
                  description: Domain ownership information.
                is_ssl_enabled:
                  type: boolean
                  description: Whether SSL is enabled for this domain.
                html_static_redirect:
                  type: string
                  description: HTML static redirect content.
                url_redirect:
                  type: string
                  description: URL redirect value.
                public_notes:
                  type: string
                  description: Public-facing notes for this domain.
                time_created:
                  type: integer
                  example: 1734455015
                  description: Unix timestamp of creation.
                time_saved:
                  type: integer
                  example: 1734455015
                  description: Unix timestamp of last update.
            offer:
              type: object
              description: Related offer details. Present when `is_apply_all_offers` is false.
              properties:
                network_offer_id:
                  type: integer
                  description: The offer ID.
                network_id:
                  type: integer
                  description: The network ID.
                network_advertiser_id:
                  type: integer
                  description: The advertiser ID that owns the offer.
                network_offer_group_id:
                  type: integer
                  description: The offer group ID, 0 if not part of a group.
                name:
                  type: string
                  description: The offer name.
                offer_status:
                  type: string
                  description: The offer status.
                network_tracking_domain_id:
                  type: integer
                  description: The tracking domain ID assigned to the offer.
                visibility:
                  type: string
                  description: The offer visibility.
                  enum:
                    - public
                    - private
                    - require_approval
                currency_id:
                  type: string
                  description: The offer currency.
    AffiliateTrackingDomainInput:
      type: object
      required:
        - network_affiliate_id
        - network_tracking_domain_id
        - is_apply_all_offers
        - network_offer_ids
      properties:
        network_affiliate_id:
          type: integer
          description: The affiliate ID.
        network_tracking_domain_id:
          type: integer
          description: The tracking domain ID to assign.
        is_apply_all_offers:
          type: boolean
          description: Whether to apply this tracking domain to all offers.
        network_offer_ids:
          type: array
          items:
            type: integer
          description: List of offer IDs to apply this tracking domain to.
  securitySchemes:
    API Key:
      description: The Everflow API key generated from the Control Center > Security.
      in: header
      name: X-Eflow-Api-Key
      type: apiKey
