{
  "openapi": "3.0.1",
  "info": {
    "title": "Actor Reliability Monitor",
    "description": "Stop your scrapers from breaking without you noticing.\n\nThis tool watches your Apify actors and tells you when something goes wrong, even if the run says “Succeeded.”\n\nThe first 10 monitored runs are free, so you can test it before paying.",
    "version": "0.1",
    "x-build-id": "2grRgQAz1freoagmk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/anyhowmarketer~actor-reliability-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-anyhowmarketer-actor-reliability-monitor",
        "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/anyhowmarketer~actor-reliability-monitor/runs": {
      "post": {
        "operationId": "runs-sync-anyhowmarketer-actor-reliability-monitor",
        "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/anyhowmarketer~actor-reliability-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-anyhowmarketer-actor-reliability-monitor",
        "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": {
          "actorIds": {
            "title": "Actor IDs",
            "type": "array",
            "description": "List of actor IDs to monitor.",
            "items": {
              "type": "string"
            }
          },
          "actorTaskIds": {
            "title": "Actor Task IDs",
            "type": "array",
            "description": "List of actor task IDs to monitor.",
            "items": {
              "type": "string"
            }
          },
          "runIds": {
            "title": "Run IDs (one-off)",
            "type": "array",
            "description": "Explicit run IDs to inspect in this run.",
            "items": {
              "type": "string"
            }
          },
          "autoDiscover": {
            "title": "Auto-discover actors",
            "type": "boolean",
            "description": "If true, discover all actors in the account (optionally filtered by tags).",
            "default": false
          },
          "includeTags": {
            "title": "Include tags",
            "type": "array",
            "description": "Only monitor actors with these tags when auto-discovering.",
            "items": {
              "type": "string"
            }
          },
          "excludeTags": {
            "title": "Exclude tags",
            "type": "array",
            "description": "Skip actors with these tags when auto-discovering.",
            "items": {
              "type": "string"
            }
          },
          "monitoringFrequencyMinutes": {
            "title": "Monitoring frequency (minutes)",
            "minimum": 1,
            "type": "integer",
            "description": "Used for scheduling guidance and summary windows.",
            "default": 15
          },
          "baselineWindowDays": {
            "title": "Baseline window (days)",
            "minimum": 7,
            "type": "integer",
            "description": "Historical window for baseline metrics.",
            "default": 30
          },
          "maxRunsPerTarget": {
            "title": "Max runs per target",
            "minimum": 1,
            "type": "integer",
            "description": "Upper limit for runs fetched per actor/task per scan.",
            "default": 50
          },
          "maxSchemaSampleSize": {
            "title": "Max schema sample size",
            "minimum": 1,
            "type": "integer",
            "description": "Number of dataset items to sample for schema drift.",
            "default": 30
          },
          "minSchemaSampleSize": {
            "title": "Min schema sample size",
            "minimum": 1,
            "type": "integer",
            "description": "Skip schema drift detection when dataset has fewer than this many items.",
            "default": 20
          },
          "baselineMode": {
            "title": "Baseline mode",
            "enum": [
              "perActor",
              "perTask",
              "perInputSignature"
            ],
            "type": "string",
            "description": "How baselines are keyed.",
            "default": "perInputSignature"
          },
          "baselineHistorySize": {
            "title": "Baseline history size",
            "minimum": 5,
            "type": "integer",
            "description": "Rolling sample size for robust baseline recomputation.",
            "default": 30
          },
          "baselineUnfreezeConsecutiveRuns": {
            "title": "Unfreeze consecutive runs",
            "minimum": 1,
            "type": "integer",
            "description": "How many healthy runs are required to unfreeze baselines after an incident.",
            "default": 3
          },
          "forceUnfreezeBaselineKeys": {
            "title": "Force unfreeze baseline keys",
            "type": "array",
            "description": "Manual override list of baseline keys to unfreeze this run.",
            "items": {
              "type": "string"
            }
          },
          "forceRelearnBaselineKeys": {
            "title": "Force relearn baseline keys",
            "type": "array",
            "description": "Manual override list of baseline keys to reset/relearn.",
            "items": {
              "type": "string"
            }
          },
          "inputSignatureExcludeKeys": {
            "title": "Input signature exclude keys",
            "type": "array",
            "description": "Input keys excluded from baseline signature hash.",
            "items": {
              "type": "string"
            }
          },
          "inputSignatureIncludeKeys": {
            "title": "Input signature include keys",
            "type": "array",
            "description": "If set, only these keys are included in signature hashing.",
            "items": {
              "type": "string"
            }
          },
          "inputSignatureMaxArrayItems": {
            "title": "Input signature max array items",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of array values considered for input signature hashing.",
            "default": 20
          },
          "inputSignatureCanonicalizeDates": {
            "title": "Input signature canonicalize dates",
            "type": "boolean",
            "description": "Canonicalize ISO dates to month buckets to reduce baseline fragmentation.",
            "default": false
          },
          "volumeWarnConsecutiveRuns": {
            "title": "Volume warn consecutive runs",
            "minimum": 1,
            "type": "integer",
            "description": "Number of consecutive breaches required before emitting volume warning.",
            "default": 1
          },
          "volumeCriticalConsecutiveRuns": {
            "title": "Volume critical consecutive runs",
            "minimum": 1,
            "type": "integer",
            "description": "Number of consecutive critical breaches required before emitting critical volume alert.",
            "default": 2
          },
          "thresholdProfile": {
            "title": "Threshold profile",
            "enum": [
              "conservative",
              "balanced",
              "aggressive"
            ],
            "type": "string",
            "description": "Preset profile for threshold defaults.",
            "default": "balanced"
          },
          "schemaSampleEveryNPolls": {
            "title": "Schema sample every N polls",
            "minimum": 1,
            "type": "integer",
            "description": "Run schema sampling every N polls when no anomaly trigger is present.",
            "default": 4
          },
          "maxRunsPerPoll": {
            "title": "Max runs per poll",
            "minimum": 1,
            "type": "integer",
            "description": "Global cap of runs processed for each target per poll.",
            "default": 100
          },
          "maxRunsPerTargetPerPoll": {
            "title": "Max runs per target per poll",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of runs fetched per target in one poll cycle.",
            "default": 50
          },
          "pollJitterSeconds": {
            "title": "Poll jitter seconds",
            "minimum": 0,
            "type": "integer",
            "description": "Random delay per target to reduce synchronized API spikes.",
            "default": 2
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "type": "integer",
            "description": "Concurrency limit for future parallel target processing.",
            "default": 4
          },
          "maxDatasetSamplesPerPoll": {
            "title": "Max dataset samples per poll",
            "minimum": 0,
            "type": "integer",
            "description": "Global budget for schema sampling in one poll run.",
            "default": 20
          },
          "learningPeriodPolls": {
            "title": "Learning period polls",
            "minimum": 0,
            "type": "integer",
            "description": "Suppress alerts for first N polls per baseline while learning.",
            "default": 0
          },
          "silenceWindow": {
            "title": "Silence window (UTC)",
            "type": "object",
            "description": "Optional alert mute window by UTC hours; events are still recorded.",
            "default": {
              "startHourUtc": 0,
              "endHourUtc": 0
            }
          },
          "schemaDepth": {
            "title": "Schema depth",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum object flattening depth when building schema signatures.",
            "default": 1
          },
          "schemaTreatObjectsAsOpaque": {
            "title": "Schema treat objects as opaque",
            "type": "boolean",
            "description": "Configuration for Schema treat objects as opaque.",
            "default": true
          },
          "schemaCriticalFields": {
            "title": "Schema critical fields",
            "type": "array",
            "description": "Type changes on these fields are always treated as breaking.",
            "items": {
              "type": "string"
            }
          },
          "schemaCacheMaxEntries": {
            "title": "Schema cache max entries",
            "minimum": 10,
            "type": "integer",
            "description": "Maximum number of dataset schema signatures retained in cache.",
            "default": 200
          },
          "schemaCacheTtlDays": {
            "title": "Schema cache TTL days",
            "minimum": 1,
            "type": "integer",
            "description": "Days to keep schema cache entries before eviction.",
            "default": 14
          },
          "maxBaselineKeys": {
            "title": "Max baseline keys",
            "minimum": 10,
            "type": "integer",
            "description": "Maximum number of baseline keys retained in STATE_SNAPSHOT.",
            "default": 500
          },
          "maxIncidentsPerKey": {
            "title": "Max incidents per key",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum incident ledger entries retained per baseline key.",
            "default": 20
          },
          "baselineEvictionDays": {
            "title": "Baseline eviction days",
            "minimum": 1,
            "type": "integer",
            "description": "Evict baseline keys not seen within this number of days.",
            "default": 30
          },
          "thresholds": {
            "title": "Thresholds",
            "type": "object",
            "description": "Override default thresholds.",
            "default": {
              "failureRateWarn": 0.2,
              "failureRateCritical": 0.4,
              "latencyP90IncreaseFactor": 2,
              "volumeDropFactor": 0.8,
              "schemaDriftSeverityWarn": 0.3,
              "schemaDriftSeverityCritical": 0.6,
              "blockRateWarn": 0.15,
              "blockRateCritical": 0.3,
              "costPerSuccessIncreaseFactor": 2,
              "successRateHealthyMin": 0.9,
              "volumeLearningFloorFactor": 0.3,
              "schemaNullSpikeThreshold": 0.25,
              "extremeDeviationMadMultiplier": 5
            }
          },
          "alerts": {
            "title": "Alerting",
            "type": "object",
            "description": "Alerting configuration.",
            "default": {
              "slackWebhookUrl": "",
              "webhookUrl": "",
              "cooldownMinutes": 60,
              "maxRetries": 3,
              "initialBackoffMs": 500,
              "dedupeBufferSize": 500
            }
          },
          "enableProxyBlock": {
            "title": "Enable proxy/block intelligence",
            "type": "boolean",
            "description": "If true, analyze block/captcha signals from run status messages.",
            "default": true
          },
          "enableCostMonitoring": {
            "title": "Enable cost/burn monitoring",
            "type": "boolean",
            "description": "If true, compute cost per success and runtime trends.",
            "default": true
          },
          "dailySummaryEnabled": {
            "title": "Daily summary",
            "type": "boolean",
            "description": "If true, emit a daily summary report record.",
            "default": true
          },
          "weeklySummaryEnabled": {
            "title": "Weekly summary",
            "type": "boolean",
            "description": "If true, emit a weekly summary report record.",
            "default": true
          },
          "enablePricingEvents": {
            "title": "Enable pricing events",
            "type": "boolean",
            "description": "If true, emit pay-per-event charges after free allowance is consumed.",
            "default": true
          },
          "pricingEventName": {
            "title": "Pricing event name",
            "type": "string",
            "description": "Pay-per-event name configured in Actor pricing.",
            "default": "monitored-actor-run"
          },
          "freeBillableEventsPerUser": {
            "title": "Free billable events per user",
            "minimum": 0,
            "type": "integer",
            "description": "Number of billable events allowed per user before pricing events are emitted.",
            "default": 10
          },
          "env": {
            "title": "Environment",
            "enum": [
              "staging",
              "production"
            ],
            "type": "string",
            "description": "Environment label used for routing and separation.",
            "default": "production"
          },
          "slo": {
            "title": "SLO mode",
            "type": "object",
            "description": "Optional SLO constraints. Breaches emit SLO_BREACH events.",
            "default": {
              "minSuccessRate": 0.9,
              "maxP90": 120,
              "minVolume": 10,
              "maxBlockRate": 0.2
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}