{
  "openapi": "3.0.1",
  "info": {
    "title": "OSHA Citation & EPA Noncompliance Executive Defense Dossier",
    "description": "Detect open, contestable OSHA Serious, Willful & Repeat citations ($12K–$165K+ fines), cross-screen EPA ECHO facility noncompliance, decode 29 CFR standards, resolve Parent Corporate HQs, verify VP of EHS & General Counsel emails/phones, and generate AI abatement briefs.",
    "version": "0.0",
    "x-build-id": "0tAWcRZg0CzxB7kQy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/unique_dev~osha-citation-epa-noncompliance-executive-defense-dossier/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-unique_dev-osha-citation-epa-noncompliance-executive-defense-dossier",
        "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/unique_dev~osha-citation-epa-noncompliance-executive-defense-dossier/runs": {
      "post": {
        "operationId": "runs-sync-unique_dev-osha-citation-epa-noncompliance-executive-defense-dossier",
        "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/unique_dev~osha-citation-epa-noncompliance-executive-defense-dossier/run-sync": {
      "post": {
        "operationId": "run-sync-unique_dev-osha-citation-epa-noncompliance-executive-defense-dossier",
        "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": {
          "maxDossiers": {
            "title": "Max Dossiers to Emit",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of enriched corporate defense dossiers to emit in this run (free-tier users are capped at 10 records).",
            "default": 15
          },
          "minInitialPenaltyUsd": {
            "title": "Minimum Initial OSHA Penalty (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum proposed initial OSHA citation penalty in USD (e.g., 40000 for OSHA Severe/Top Penalty cases, 16131+ for single Serious maximum).",
            "default": 40000
          },
          "states": {
            "title": "Target US States (2-Letter Codes)",
            "type": "array",
            "description": "Optional list of 2-letter US state codes (e.g., [\"TX\", \"OH\", \"IL\", \"PA\", \"GA\"]). Leave empty for nationwide coverage across all 50 states.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "naicsPrefixes": {
            "title": "Target NAICS Prefixes",
            "type": "array",
            "description": "Optional NAICS industry prefixes (e.g., [\"31\", \"32\", \"33\"] for Manufacturing, [\"23\"] for Construction, [\"48\", \"49\"] for Warehousing/Logistics). Leave empty for all industries.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "targetBuyerPersona": {
            "title": "Target Executive Buyer Persona",
            "enum": [
              "EHS_SAFETY_DIRECTOR",
              "GENERAL_COUNSEL_LEGAL",
              "CFO_RISK_MANAGEMENT",
              "PLANT_OPERATIONS_VP"
            ],
            "type": "string",
            "description": "Primary corporate decision-maker persona to resolve at the parent HQ or cited facility.",
            "default": "EHS_SAFETY_DIRECTOR"
          },
          "requireOpenCaseOnly": {
            "title": "Open / Contestable Cases Only",
            "type": "boolean",
            "description": "When enabled, filters strictly to active/open or pending-contest OSHA enforcement cases (isCaseOpen = true).",
            "default": true
          },
          "includeWillfulRepeatOnly": {
            "title": "Willful or Repeat Citations Only",
            "type": "boolean",
            "description": "When enabled, restricts output to inspections carrying at least one Willful or Repeat violation.",
            "default": false
          },
          "establishmentQuery": {
            "title": "Establishment / Company Filter (Optional)",
            "type": "string",
            "description": "Optional company or worksite keyword filter.",
            "default": ""
          },
          "watchlistCompanies": {
            "title": "Enterprise Client / Prospect Watchlist Companies (Optional)",
            "type": "array",
            "description": "Optional permanent watchlist of client, portfolio, or target account names (e.g., [\"United States Steel\", \"Taylor Farms\", \"FleetPride\"]). Matching citations are prioritized at the top of every daily run.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "webhookUrl": {
            "title": "CRM / Automation Webhook URL (HubSpot, Slack, Clay, Make, n8n)",
            "type": "string",
            "description": "Optional HTTPS webhook endpoint. When configured, newly enriched OSHA/EPA defense dossiers are automatically POSTed as JSON at the end of every run.",
            "default": ""
          },
          "onlyNewSinceLastRun": {
            "title": "Only New Citations Since Last Run (Delta Mode)",
            "type": "boolean",
            "description": "When enabled, skips OSHA activity numbers previously emitted in persistent state store OSHA_EPA_DEFENSE_SEEN_STATE.",
            "default": false
          },
          "llmApiKey": {
            "title": "Optional Gemini / OpenAI API Key",
            "type": "string",
            "description": "Optional API key for live LLM executive verification & contest brief synthesis (overrides GEMINI_API_KEY / OPENAI_API_KEY env vars; deterministic expert fallback runs automatically when omitted)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}