openapi: 3.0.3
info:
  title: Everflow Network API - Conversion Domains
  description: >
    Endpoint for listing conversion domains configured for the network.
    Conversion domains are used for postback URLs and server-to-server
    conversion tracking — they are the domains that receive the signal when
    a conversion occurs on the advertiser's side.
    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: Conversion Domains
paths:
  /networks/domains/conversion:
    get:
      summary: List Conversion Domains
      tags:
        - Conversion Domains
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/ConversionDomain"
      security:
        - API Key: []
    post:
      summary: Create Conversion Domain
      description: >
        Create a new conversion domain for the network.
      tags:
        - Conversion Domains
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                domain:
                  type: string
                  description: The conversion domain URL.
                is_default:
                  type: boolean
                  description: Whether this is the default conversion domain.
            example:
              domain: "conversions.example.com"
              is_default: false
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ConversionDomain"
      security:
        - API Key: []

  /networks/domains/conversion/{domainId}:
    get:
      summary: Get Conversion Domain
      description: >
        Retrieve a specific conversion domain by its ID.
      tags:
        - Conversion Domains
      parameters:
        - in: path
          name: domainId
          required: true
          schema:
            type: integer
          description: The conversion domain ID.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ConversionDomain"
      security:
        - API Key: []
    put:
      summary: Update Conversion Domain
      description: >
        Update an existing conversion domain.
      tags:
        - Conversion Domains
      parameters:
        - in: path
          name: domainId
          required: true
          schema:
            type: integer
          description: The conversion domain ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                domain:
                  type: string
                  description: The conversion domain URL.
                is_default:
                  type: boolean
                  description: Whether this is the default conversion domain.
            example:
              domain: "conversions-updated.example.com"
              is_default: false
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ConversionDomain"
      security:
        - API Key: []
    delete:
      summary: Delete Conversion Domain
      description: >
        Delete a conversion domain by its ID.
      tags:
        - Conversion Domains
      parameters:
        - in: path
          name: domainId
          required: true
          schema:
            type: integer
          description: The conversion domain ID.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: boolean
                    description: Whether the deletion was successful.
      security:
        - API Key: []
components:
  schemas:
    ConversionDomain:
      type: object
      properties:
        conversion_domain_id:
          type: integer
          description: Unique conversion domain ID.
        network_id:
          type: integer
          description: Network ID.
        domain:
          type: string
          description: The conversion domain URL.
        status:
          type: string
          description: Domain status.
        is_default:
          type: boolean
          description: Whether this is the default conversion domain.
        time_created:
          type: integer
          example: 1734455015
          description: Unix timestamp of creation.
        time_saved:
          type: integer
          example: 1734455015
          description: Unix timestamp of last update.
  securitySchemes:
    API Key:
      description: The Everflow API key generated from the Control Center > Security.
      in: header
      name: X-Eflow-Api-Key
      type: apiKey
