{
  "openapi": "3.0.1",
  "info": {
    "title": "SEC 8-K Risk Signals & Corporate Distress Monitor",
    "description": "Extract high-signal SEC Form 8-K risk events (cyber breaches 1.05, restatements 4.02, auditor exits 4.01, C-suite departures 5.02, bankruptcies 1.03, delistings 3.01) & SEC comment letters with 0-100 risk scores and clean MCP/n8n/Clay JSON.",
    "version": "1.0",
    "x-build-id": "aq8oSxGydjA0k49hk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/durative_hairstreak~sec-8k-risk-signals/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-durative_hairstreak-sec-8k-risk-signals",
        "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/durative_hairstreak~sec-8k-risk-signals/runs": {
      "post": {
        "operationId": "runs-sync-durative_hairstreak-sec-8k-risk-signals",
        "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/durative_hairstreak~sec-8k-risk-signals/run-sync": {
      "post": {
        "operationId": "run-sync-durative_hairstreak-sec-8k-risk-signals",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Scan Mode",
            "enum": [
              "market_scan",
              "ticker_audit"
            ],
            "type": "string",
            "description": "Choose 'market_scan' to scan all US public filings across SEC EDGAR for selected risk items, or 'ticker_audit' to deeply audit specific stock tickers or CIKs (including SEC comment letters).",
            "default": "market_scan"
          },
          "riskItems": {
            "title": "SEC 8-K Risk Items to Track",
            "type": "array",
            "description": "High-signal SEC Form 8-K Item codes to monitor. Supported codes: 1.03 (Bankruptcy), 4.02 (Financial Restatement), 3.01 (Delisting), 2.04 (Debt Default), 4.01 (Auditor Change), 1.05 (Cybersecurity Incident), 2.06 (Material Impairment), 1.02 (Agreement Termination), 2.05 (Restructuring/Layoffs), 5.02 (C-Suite Departure).",
            "items": {
              "type": "string"
            },
            "default": [
              "1.05",
              "4.01",
              "4.02",
              "1.03",
              "3.01",
              "5.02"
            ]
          },
          "tickers": {
            "title": "Tickers or CIKs (for Watchlist Audit Mode)",
            "type": "array",
            "description": "US stock tickers (e.g., SMCI, CRWD, NVDA, TSLA) or 10-digit SEC CIKs to audit. Required when Scan Mode is 'ticker_audit'.",
            "items": {
              "type": "string"
            }
          },
          "lookbackDays": {
            "title": "Lookback Window (Days)",
            "minimum": 1,
            "maximum": 730,
            "type": "integer",
            "description": "Number of calendar days back from today to scan (ignored if startDate is explicitly provided).",
            "default": 30
          },
          "maxResults": {
            "title": "Maximum Filings to Output",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of risk-scored SEC filings to extract and return. Respects your Apify Pay-Per-Event spending cap automatically.",
            "default": 25
          },
          "includeExcerpts": {
            "title": "Extract Clean Item Text Excerpts & Forensic Red Flags",
            "type": "boolean",
            "description": "Fetch the official SEC filing HTML, strip inline XBRL noise, extract the matched Item section text, and detect 20+ forensic risk phrases (e.g., material weakness, ransomware, going concern, restatement).",
            "default": true
          },
          "includeCommentLetters": {
            "title": "Include SEC Accounting Comment Letters (Watchlist Mode)",
            "type": "boolean",
            "description": "In 'ticker_audit' mode, also extract SEC staff comment letters (UPLOAD) and issuer responses (CORRESP) within the lookback window.",
            "default": true
          },
          "minRiskScore": {
            "title": "Minimum Risk Score (0-100)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Filter output to only include filings meeting or exceeding this deterministic risk score (e.g., 65 for HIGH/CRITICAL alerts only).",
            "default": 0
          },
          "keywordFilter": {
            "title": "Optional Full-Text Keyword Filter",
            "type": "string",
            "description": "Optional keyword or phrase to narrow results (e.g., 'ransomware', 'material weakness', 'CFO', 'Chapter 11')."
          },
          "startDate": {
            "title": "Custom Start Date (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional explicit start date in YYYY-MM-DD format. Overrides lookbackDays when provided."
          },
          "endDate": {
            "title": "Custom End Date (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional explicit end date in YYYY-MM-DD format. Defaults to today (UTC)."
          },
          "excerptMaxChars": {
            "title": "Maximum Excerpt Characters",
            "minimum": 300,
            "maximum": 8000,
            "type": "integer",
            "description": "Maximum character length of the cleaned Item prose excerpt per filing (optimized for LLM / MCP token budgets).",
            "default": 1800
          },
          "secUserAgent": {
            "title": "Custom SEC EDGAR User-Agent (Optional)",
            "type": "string",
            "description": "Optional SEC-compliant User-Agent header ('Organization ContactEmail'). Leave blank to use the default compliant header."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}