{
  "openapi": "3.0.1",
  "info": {
    "title": "Fleet Analytics — Full Account Dashboard",
    "description": "Actor Fleet Analytics. Available on the Apify Store with pay-per-event pricing.",
    "version": "1.1",
    "x-build-id": "0a9FSMAeNO0TrsErw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~actor-fleet-analytics/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-actor-fleet-analytics",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/ryanclinton~actor-fleet-analytics/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-actor-fleet-analytics",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/ryanclinton~actor-fleet-analytics/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-actor-fleet-analytics",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "apifyToken": {
            "title": "Apify API Token",
            "type": "string",
            "description": "Your Apify API token. Leave empty when running on Apify platform — the token is injected automatically. Required for local testing."
          },
          "includeRevenueBreakdown": {
            "title": "Include per-actor revenue breakdown",
            "type": "boolean",
            "description": "Also produce a detailed per-actor revenue breakdown: ranked revenueByActor list, top 10 earners, pricing tier classification (budget/standard/premium), and a list of actors with positive run volume but no PPE pricing (missed monetization opportunities). Zero extra API cost — reuses data already fetched for the main rollup.",
            "default": false
          },
          "mode": {
            "title": "Analysis mode (reweights the action plan)",
            "enum": [
              "default",
              "growth",
              "cost",
              "stability",
              "weekly"
            ],
            "type": "string",
            "description": "default = balanced priorities (recommended). growth = emphasize buildNext + revenue opportunities. cost = emphasize cost signals + plan right-sizing. stability = emphasize risk + quality + compliance. weekly = balanced output formatted for weekly review.",
            "default": "default"
          },
          "acknowledgements": {
            "title": "Action item acknowledgements",
            "type": "array",
            "description": "Update the status of action items from a previous run. Array of {id, status, note?} where status is 'acknowledged' | 'in_progress' | 'done' | 'pending'. Acks are persisted across runs so in-progress items don't re-surface at full urgency. Items marked 'done' that later reappear are flagged as regressions and upgraded in severity.",
            "default": []
          },
          "outputProfile": {
            "title": "Output profile (verbosity)",
            "enum": [
              "full",
              "standard",
              "executive",
              "automation"
            ],
            "type": "string",
            "description": "How much of the result to emit. full = the complete decision tree (default). standard = the headline decision blocks (operator brief, next best action, agent contract, decision cards, since-last-run, revenue opportunities, deprioritized, portfolio segments, fleet health + key scalars). executive = the operator brief + fleet-health headline + agent contract for a 30-second read. automation = only the agent contract + next best action + fleet-health headline, for agents/Dify/Make nodes that branch on one object. This is a pure projection of the same computed record — nothing is recomputed and no charge changes.",
            "default": "full"
          },
          "focusActors": {
            "title": "Focus on specific actors",
            "type": "array",
            "description": "Restrict the analysis to these actors. Each entry is an actor ID or a case-insensitive substring of the actor name. Leave empty to analyze the whole fleet.",
            "items": {
              "type": "string"
            }
          },
          "excludeActors": {
            "title": "Exclude specific actors",
            "type": "array",
            "description": "Exclude these actors from the analysis. Each entry is an actor ID or a case-insensitive substring of the actor name. Applied after focusActors.",
            "items": {
              "type": "string"
            }
          },
          "minimumMonthlyImpactUsd": {
            "title": "Minimum monthly impact ($)",
            "minimum": 0,
            "type": "integer",
            "description": "Move revenue opportunities whose estimated monthly uplift is below this many USD into the deprioritized (do-not-do) list instead of the main opportunity list. 0 (default) keeps everything in the main list. Use to suppress low-leverage noise on large fleets.",
            "default": 0
          },
          "weeklyHoursBudget": {
            "title": "Hours available this week",
            "minimum": 0,
            "type": "integer",
            "description": "How many hours you have to work on your fleet this week. When set, the timeAllocation output greedily marks the highest ROI-per-hour opportunities that fit your budget as selected. 0 (default) still emits the ranked ROI-per-hour list, just without selection.",
            "default": 0
          },
          "includeSpecialistReports": {
            "title": "Include specialist reports (slower, deeper)",
            "type": "boolean",
            "description": "Also call 5 fleet-wide specialist actors in parallel: quality-audit, cost-watchdog, pricing-advisor, competitor-scanner, market-gap-finder. Each call runs a full specialist — adds 3-10 minutes to total run time but produces a consolidated health report with a prioritized actionPlan (fixNow / optimizeNext / buildNext / considerArchiving) instead of just metadata aggregates.",
            "default": false
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}