{
  "openapi": "3.0.1",
  "info": {
    "title": "FEMA Public Assistance Funding & Obligation Monitor",
    "description": "Monitor official OpenFEMA Public Assistance funded projects for disaster recovery funding changes. Get decision-ready obligation increases, deobligations, mitigation, process-step, and status events instead of raw FEMA API rows.",
    "version": "0.1",
    "x-build-id": "10OZ1WoR6MqeUL6Fy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nintendo424~fema-public-assistance-obligation-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nintendo424-fema-public-assistance-obligation-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/nintendo424~fema-public-assistance-obligation-monitor/runs": {
      "post": {
        "operationId": "runs-sync-nintendo424-fema-public-assistance-obligation-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/nintendo424~fema-public-assistance-obligation-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-nintendo424-fema-public-assistance-obligation-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": {
          "states": {
            "title": "States",
            "type": "array",
            "description": "Optional two-letter state or territory abbreviations; matching is case-insensitive.",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 2
            },
            "default": []
          },
          "disasterNumbers": {
            "title": "Disaster numbers",
            "type": "array",
            "description": "Optional FEMA disaster declaration numbers from 1 through 99999.",
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 99999
            },
            "default": []
          },
          "damageCategoryCodes": {
            "title": "Damage category codes",
            "type": "array",
            "description": "Optional single-letter Public Assistance category codes A through G or Z; matching is case-insensitive.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1
            },
            "default": []
          },
          "minimumTotalObligated": {
            "title": "Minimum total obligated",
            "minimum": 0,
            "type": "number",
            "description": "Only track projects whose current total obligated amount meets this USD floor.",
            "default": 0
          },
          "minimumAbsoluteChange": {
            "title": "Minimum absolute monetary change",
            "minimum": 0,
            "type": "number",
            "description": "Run-to-run USD threshold for obligation, deobligation, and mitigation signals. Status and process signals are unaffected.",
            "default": 0
          },
          "signalTypes": {
            "title": "Signal types",
            "type": "array",
            "description": "Optional allowlist: initial-obligation, obligation-increase, deobligation, mitigation-change, process-step-change, status-change, or unchanged. Empty includes all eligible signals, subject to includeInitial and emitUnchanged.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "includeInitial": {
            "title": "Emit initial observations",
            "type": "boolean",
            "description": "Emit initial-obligation when a project has no stored baseline. Disabled by default for alert-oriented runs.",
            "default": false
          },
          "emitUnchanged": {
            "title": "Emit unchanged observations",
            "type": "boolean",
            "description": "Emit when no configured signal type met its criteria. Changes excluded by a non-empty signalTypes allowlist count as unchanged. Disabled by default.",
            "default": false
          },
          "maxSourceRecords": {
            "title": "Maximum source records",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard bound on records fetched from OpenFEMA before local filtering.",
            "default": 1000
          },
          "maxItems": {
            "title": "Maximum output events",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap checked before every paid dataset push.",
            "default": 100
          },
          "pageSize": {
            "title": "OpenFEMA page size",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Number of records requested per OpenFEMA page.",
            "default": 100
          },
          "requestTimeoutSecs": {
            "title": "Request timeout",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Wall-time deadline in seconds for each page request through body decoding and JSON parsing. Async reads are aborted; synchronous decode/parse cannot be preempted, but the page is rejected if either returns after the deadline.",
            "default": 30
          },
          "baselineStoreName": {
            "title": "Baseline KV store",
            "pattern": "^[A-Za-z0-9._-]{1,100}$",
            "type": "string",
            "description": "Deliberately named persistent key-value store used across runs. Use a fresh legal name to establish a new baseline.",
            "default": "fema-pa-obligation-monitor-baseline"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}