{
  "openapi": "3.0.1",
  "info": {
    "title": "USACE Wetland Permit Geofence Watcher",
    "description": "Monitor public USACE wetland and Clean Water Act public notices near geofences, watersheds, counties, applicants, and comment deadlines.",
    "version": "0.1",
    "x-build-id": "WnPYGafsJftceuRl4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mikechiou~wetland-clean-water-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mikechiou-wetland-clean-water-permits",
        "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/mikechiou~wetland-clean-water-permits/runs": {
      "post": {
        "operationId": "runs-sync-mikechiou-wetland-clean-water-permits",
        "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/mikechiou~wetland-clean-water-permits/run-sync": {
      "post": {
        "operationId": "run-sync-mikechiou-wetland-clean-water-permits",
        "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": {
          "searchText": {
            "title": "Source search text",
            "type": "string",
            "description": "Text sent to the public USACE RRS search endpoint. Default keeps v1 focused on wetland notices; use an empty string to search all active public notices.",
            "default": "wetland"
          },
          "geofences": {
            "title": "Geofences",
            "maxItems": 10,
            "type": "array",
            "description": "Up to 10 watched circles. A notice produces geofence_public_notice_match when its coordinates fall within any circle.",
            "items": {
              "type": "object",
              "required": [
                "lat",
                "lon",
                "radiusKm"
              ],
              "properties": {
                "label": {
                  "type": "string",
                  "title": "Label",
                  "description": "Optional label shown in matched output."
                },
                "lat": {
                  "type": "number",
                  "title": "Latitude",
                  "description": "Circle center latitude in decimal degrees.",
                  "minimum": -90,
                  "maximum": 90
                },
                "lon": {
                  "type": "number",
                  "title": "Longitude",
                  "description": "Circle center longitude in decimal degrees.",
                  "minimum": -180,
                  "maximum": 180
                },
                "radiusKm": {
                  "type": "number",
                  "title": "Radius in km",
                  "description": "Circle radius in kilometers. Boundary matches are included.",
                  "minimum": 0
                }
              }
            }
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "Optional two-letter state filters. These are sent to the RRS search endpoint and verified again in output matching.",
            "items": {
              "type": "string"
            }
          },
          "districtCodes": {
            "title": "USACE district codes",
            "type": "array",
            "description": "Optional exact district codes, e.g. SAJ, NAO, LRP.",
            "items": {
              "type": "string"
            }
          },
          "counties": {
            "title": "Counties",
            "type": "array",
            "description": "Optional county names or fragments, e.g. St. Johns, Westmoreland.",
            "items": {
              "type": "string"
            }
          },
          "hucCodes": {
            "title": "HUC codes",
            "type": "array",
            "description": "Optional hydrologic unit code prefixes or full codes. A prefix such as 0308 matches 03080201.",
            "items": {
              "type": "string"
            }
          },
          "actionTypes": {
            "title": "Action types",
            "type": "array",
            "description": "Optional exact USACE action types, e.g. SP or DEVMBA.",
            "items": {
              "type": "string"
            }
          },
          "applicantKeywords": {
            "title": "Applicant keywords",
            "type": "array",
            "description": "Optional applicant or applicant-company keywords matched with word boundaries.",
            "items": {
              "type": "string"
            }
          },
          "projectKeywords": {
            "title": "Project keywords",
            "type": "array",
            "description": "Optional project, keyword, or description terms matched with word boundaries.",
            "items": {
              "type": "string"
            }
          },
          "dateWindow": {
            "title": "Public notice start window",
            "type": "object",
            "description": "Use explicit start/end ISO dates or lookbackDays. Default is a 30-day lookback against the public notice start date.",
            "properties": {
              "start": {
                "type": "string",
                "title": "Start date",
                "description": "Inclusive public-notice-start window start in YYYY-MM-DD format."
              },
              "end": {
                "type": "string",
                "title": "End date",
                "description": "Inclusive public-notice-start window end in YYYY-MM-DD format."
              },
              "lookbackDays": {
                "type": "integer",
                "title": "Lookback days",
                "description": "Rolling window size when start/end are omitted.",
                "minimum": 1,
                "maximum": 30
              }
            }
          },
          "commentWindowDays": {
            "title": "Comment deadline window",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "Emit comment_deadline_alert when an accepting-comments notice closes within this many days. Use 0 to disable.",
            "default": 7
          },
          "includeExpiredCommentWindows": {
            "title": "Include expired comment windows",
            "type": "boolean",
            "description": "When false, notices whose comment windows have already expired are skipped.",
            "default": false
          },
          "maxSourceNotices": {
            "title": "Maximum source notices",
            "minimum": 1,
            "maximum": 250,
            "type": "integer",
            "description": "Safety cap for RRS detail fetches before local matching.",
            "default": 75
          },
          "maxEvents": {
            "title": "Maximum events",
            "minimum": 1,
            "maximum": 250,
            "type": "integer",
            "description": "Safety cap for one run.",
            "default": 50
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store used for dedupe and notice snapshots. Use __RUN_DEFAULT__ to keep state in the default store for each run.",
            "default": "wetland-clean-water-permits-state"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}