{
  "openapi": "3.0.1",
  "info": {
    "title": "Texas Workers' Comp Non-Subscriber & X-Date Lead Monitor",
    "description": "Extract Texas Workers' Compensation Non-Subscriber employers (TDI DWC Form-005) with Parent + Multi-Location rollup grouping, upcoming Insurance X-Date expiration filters, recent-filing alerts, city/ZIP targeting, and stateful deduplication for commercial P&C, OccAcc, and ERISA brokers.",
    "version": "1.0",
    "x-build-id": "kHXdyjl007z6BznwN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zinky_atelier~tx-workers-comp-xdate-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zinky_atelier-tx-workers-comp-xdate-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/zinky_atelier~tx-workers-comp-xdate-monitor/runs": {
      "post": {
        "operationId": "runs-sync-zinky_atelier-tx-workers-comp-xdate-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/zinky_atelier~tx-workers-comp-xdate-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-zinky_atelier-tx-workers-comp-xdate-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": {
          "expiringWithinDays": {
            "title": "Expiring Within Next N Days (Insurance X-Date Window)",
            "minimum": 0,
            "maximum": 1095,
            "type": "integer",
            "description": "Keep filings whose non-coverage period `end_date` (annual renewal / X-Date) falls between today and today + N days (e.g. 60, 90, or 120 days ahead of renewal). Set to 0 to disable X-Date window filtering.",
            "default": 90
          },
          "filedWithinDays": {
            "title": "Filed Within Last N Days (Recent Non-Subscriber Filings)",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Keep filings where TDI received DWC Form-005 (`filing_date_received`) within the last N days (e.g. 14 or 30 days for daily/weekly newly opted-out employer alerts). Set to 0 to disable.",
            "default": 0
          },
          "cities": {
            "title": "Target Cities (Parent HQ or Operating Location)",
            "type": "array",
            "description": "Optional list of cities (case-insensitive, e.g. ['Austin', 'Houston', 'Dallas']). Matches employers whose Parent HQ OR any operating Location is in these cities, then rolls up the entire multi-location employer.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "Target ZIP Codes (5-Digit Prefix Match)",
            "type": "array",
            "description": "Optional list of 5-digit ZIP codes (e.g. ['78701', '77002']). Matches both 5-digit and ZIP+4 records across Parent HQ and child Locations.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "companyName": {
            "title": "Company or DBA Name Contains",
            "type": "string",
            "description": "Optional case-insensitive keyword filter on Parent company name or subsidiary/location DBA name (e.g. 'CONSTRUCTION', 'LOGISTICS', 'HEALTHCARE')."
          },
          "minLocations": {
            "title": "Minimum Locations Per Employer",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Filter for larger commercial accounts by requiring at least N covered locations on the rolled-up Parent employer (set 2+ for multi-location chains only).",
            "default": 1
          },
          "onlyNew": {
            "title": "Only Emit New / Updated Filings (Stateful SEEN_FILINGS Deduplication)",
            "type": "boolean",
            "description": "When enabled, tracks emitted `filingId` + `coverageEndDate` signatures in persistent Key-Value Store (`SEEN_FILINGS`) so scheduled daily/weekly runs only push unseen or renewed employer leads.",
            "default": false
          },
          "maxItems": {
            "title": "Max Employer Leads",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of rolled-up Parent employer leads to emit in this run.",
            "default": 50
          },
          "maxLocationsPerEmployer": {
            "title": "Max Embedded Location Records Per Employer",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Caps the embedded `locations[]` detail array per output item to keep JSON payloads compact for mega-chains, while `locationCount`, `cities`, `texasCities`, and `zipCodes` always aggregate 100% of locations.",
            "default": 25
          },
          "socrataAppToken": {
            "title": "Optional Socrata App Token (data.texas.gov)",
            "type": "string",
            "description": "Optional Texas Open Data Portal `X-App-Token` for higher rate-limit pools on very large multi-thousand-record batch runs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}