{
  "openapi": "3.0.1",
  "info": {
    "title": "HUD Section 8 Contract Expiration Monitor + Owner Contacts",
    "description": "Every HUD project-based Section 8, 202 and 811 HAP contract with its true term end (not the funding increment), assisted units, rent-vs-FMR position, owner and management-agent contacts, and a new-since-last-run delta.",
    "version": "1.0",
    "x-build-id": "nIzLe5LdOUIHwgwG8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/malonestar~hud-section8-contract-expiration-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-malonestar-hud-section8-contract-expiration-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/malonestar~hud-section8-contract-expiration-monitor/runs": {
      "post": {
        "operationId": "runs-sync-malonestar-hud-section8-contract-expiration-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/malonestar~hud-section8-contract-expiration-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-malonestar-hud-section8-contract-expiration-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 or territories",
            "type": "array",
            "description": "Two-letter state or territory codes, matched against the HUD PROPERTY record (CA, NY, TX, PR, VI, GU, MP, DC). Do not use the first two characters of the contract number: they disagree with the property's own state on 229 of 24,315 contracts.",
            "items": {
              "type": "string"
            }
          },
          "expirationBasis": {
            "title": "Which expiration date to screen on",
            "enum": [
              "overall",
              "current",
              "either"
            ],
            "type": "string",
            "description": "HUD publishes two different expiration dates. 'overall' is the CONTRACT TERM END - the genuine renewal / opt-out decision point, and the default. 'current' is the end of the current funding increment, which is earlier on 63.2% of contracts: a 24-month screen on it returns 18,939 contracts / 1,184,903 units against 4,627 / 126,711 on the term end. Starrett City's increment ends 2027-01-31 while its contract runs to 2041.",
            "default": "overall"
          },
          "expiringWithinMonths": {
            "title": "Expiring within N months",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "Return contracts whose chosen expiration date falls between today and N months from today. Leave blank to apply no window. Not defaulted: an unrequested window would silently narrow every query."
          },
          "expiringFiscalYears": {
            "title": "Federal fiscal years of expiration",
            "type": "array",
            "description": "Federal fiscal years (beginning 1 October) in which the chosen expiration date falls, for example [\"2027\",\"2028\"]. Combined with the month window as an OR.",
            "items": {
              "type": "string"
            }
          },
          "programGroups": {
            "title": "Program types",
            "type": "array",
            "description": "Program type group codes or detailed program names. Groups: PRAC, 202, S8NC, LMSA, HFDA, 515, S8 RAD Conv, PRAD, S8SR, PD, PRES, PAC, Pension Fund. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "contractStatuses": {
            "title": "Contract statuses",
            "type": "array",
            "description": "TRACS statuses to keep: Active, Expired, Pending, Suspended, Terminated, Executed. Leave empty for all statuses - not defaulted to Active, because a hidden status filter is a hidden answer.",
            "items": {
              "type": "string"
            }
          },
          "minAssistedUnits": {
            "title": "Minimum assisted units",
            "minimum": 0,
            "type": "integer",
            "description": "Only return contracts with at least this many assisted units. Leave blank for no minimum."
          },
          "contractNumbers": {
            "title": "Specific contract numbers",
            "type": "array",
            "description": "Look up specific 11-character HUD TRACS contract numbers, for example [\"NY36M000277\"].",
            "items": {
              "type": "string"
            }
          },
          "propertyIds": {
            "title": "Specific HUD property ids",
            "type": "array",
            "description": "Look up every contract on specific HUD property ids, for example [\"800015895\"].",
            "items": {
              "type": "string"
            }
          },
          "ownerSearch": {
            "title": "Owner or management agent name contains",
            "type": "string",
            "description": "Case-insensitive substring matched against the owner organisation, owner individual, management agent organisation and management agent individual names."
          },
          "deltaOnly": {
            "title": "Only contracts that are new or changed",
            "type": "boolean",
            "description": "Return only contracts that are new or whose term end, funding increment end, assisted units or status moved since the previous run's full-universe baseline. On the very first run there is no baseline, so this returns nothing rather than billing the whole file as new.",
            "default": false
          },
          "includeContacts": {
            "title": "Include owner and management agent contacts",
            "type": "boolean",
            "description": "Include owner and management-agent name, address, phone and email. Turn off to emit the same row shape with those values nulled and a status of 'suppressed_by_input'.",
            "default": true
          },
          "maxResults": {
            "title": "Maximum rows to return",
            "minimum": 1,
            "maximum": 30000,
            "type": "integer",
            "description": "Caps how many matching contracts are emitted and billed. Every row carries matched_rows_total and results_truncated, so a capped answer is never mistaken for a complete one.",
            "default": 1000
          },
          "simulateDrift": {
            "title": "Simulate a source-drift failure (diagnostic)",
            "type": "boolean",
            "description": "Diagnostic only. When true, the live drift gate is forced to fail so the fail-loudly path can be verified on demand: the run FAILS, emits zero rows and bills nothing. It can only make the gate stricter, never looser. Leave false for normal use.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}