openapi: 3.0.3
info:
  title: Everflow Network API - Cap Reporting
  description: >
    Offer cap, offer group cap, and custom setting cap reporting endpoints
    for the Everflow partner marketing platform.
  version: 1.0.0
servers:
  - description: Production Server
    url: https://api.eflow.team/v1
tags:
  - name: Reporting
    description: Cap reporting endpoints.
paths:
  /networks/reporting/caps/offer:
    post:
      summary: Get Offer Caps Report
      tags:
        - Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              timezone_id: 67
            schema:
              type: object
              required:
                - timezone_id
              properties:
                offer_ids:
                  type: array
                  items:
                    type: integer
                  description: >
                    Optional. Array of offer IDs. Note: this field does not
                    currently filter results — all offer caps are returned
                    regardless of the IDs provided.
                timezone_id:
                  type: integer
                  description: Timezone ID for cap calculations.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  caps:
                    type: array
                    items:
                      type: object
                      properties:
                        network_offer_id:
                          type: integer
                        network_id:
                          type: integer
                        unix_timestamp:
                          type: integer
                          example: 1734455015
                        daily_conversion_cap:
                          type: integer
                        weekly_conversion_cap:
                          type: integer
                        monthly_conversion_cap:
                          type: integer
                        global_conversion_cap:
                          type: integer
                        daily_payout_cap:
                          type: number
                        weekly_payout_cap:
                          type: number
                        monthly_payout_cap:
                          type: number
                        global_payout_cap:
                          type: number
                        daily_revenue_cap:
                          type: number
                        weekly_revenue_cap:
                          type: number
                        monthly_revenue_cap:
                          type: number
                        global_revenue_cap:
                          type: number
                        daily_click_cap:
                          type: integer
                        weekly_click_cap:
                          type: integer
                        monthly_click_cap:
                          type: integer
                        global_click_cap:
                          type: integer
                        daily_conversion_cap_used:
                          type: integer
                        weekly_conversion_cap_used:
                          type: integer
                        monthly_conversion_cap_used:
                          type: integer
                        global_conversion_cap_used:
                          type: integer
                        daily_payout_cap_used:
                          type: number
                        weekly_payout_cap_used:
                          type: number
                        monthly_payout_cap_used:
                          type: number
                        global_payout_cap_used:
                          type: number
                        daily_revenue_cap_used:
                          type: number
                        weekly_revenue_cap_used:
                          type: number
                        monthly_revenue_cap_used:
                          type: number
                        global_revenue_cap_used:
                          type: number
                        daily_click_cap_used:
                          type: integer
                        weekly_click_cap_used:
                          type: integer
                        monthly_click_cap_used:
                          type: integer
                        global_click_cap_used:
                          type: integer
                        last_run_daily_conversion:
                          type: integer
                        last_run_weekly_conversion:
                          type: integer
                        last_run_monthly_conversion:
                          type: integer
                        last_run_global_conversion:
                          type: integer
                        last_run_daily_payout:
                          type: integer
                        last_run_weekly_payout:
                          type: integer
                        last_run_monthly_payout:
                          type: integer
                        last_run_global_payout:
                          type: integer
                        last_run_daily_revenue:
                          type: integer
                        last_run_weekly_revenue:
                          type: integer
                        last_run_monthly_revenue:
                          type: integer
                        last_run_global_revenue:
                          type: integer
                        last_run_daily_click:
                          type: integer
                        last_run_weekly_click:
                          type: integer
                        last_run_monthly_click:
                          type: integer
                        last_run_global_click:
                          type: integer
                        relationship:
                          type: object
                          properties:
                            offer:
                              type: object
                  paging:
                    type: object
                    properties:
                      page:
                        type: integer
                      page_size:
                        type: integer
                      total_count:
                        type: integer
      security:
        - API Key: []

  /networks/reporting/caps/offer/summary:
    post:
      summary: Get Offer Caps Summary
      tags:
        - Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              timezone_id: 90
            schema:
              type: object
              required:
                - timezone_id
              properties:
                offer_ids:
                  type: array
                  items:
                    type: integer
                  description: >
                    Optional. Array of offer IDs. Note: this field does not
                    currently filter results.
                timezone_id:
                  type: integer
                  description: Timezone ID for cap calculations.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                description: Summary of cap usage across the specified offers.
      security:
        - API Key: []

  /networks/reporting/caps/offergroup:
    post:
      summary: Get Offer Group Caps Report
      tags:
        - Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              timezone_id: 90
            schema:
              type: object
              required:
                - timezone_id
              properties:
                offer_group_ids:
                  type: array
                  items:
                    type: integer
                  description: >
                    Optional. Array of offer group IDs. Note: this field does
                    not currently filter results — all offer group caps are
                    returned regardless of the IDs provided.
                timezone_id:
                  type: integer
                  description: Timezone ID for cap calculations.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  caps:
                    type: array
                    items:
                      type: object
                      description: Cap usage record for an offer group.
                  paging:
                    type: object
                    properties:
                      page:
                        type: integer
                      page_size:
                        type: integer
                      total_count:
                        type: integer
      security:
        - API Key: []

  /networks/reporting/caps/customsetting:
    post:
      summary: Get Custom Setting Caps Report
      tags:
        - Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              timezone_id: 90
            schema:
              type: object
              properties:
                timezone_id:
                  type: integer
                  description: Timezone ID for cap calculations.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                description: Custom cap usage data.
      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
