{
  "openapi": "3.0.1",
  "info": {
    "title": "New Homeowner & Business Leads (Certificates of Occupancy)",
    "description": "New homeowner and new business leads: certificates of occupancy from Accela Citizen Access cities, one row per newly finished home or business premises.",
    "version": "0.1",
    "x-build-id": "1h0j2Wz3efahxabcJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/finaldynamics~new-homeowner-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-finaldynamics-new-homeowner-leads",
        "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/finaldynamics~new-homeowner-leads/runs": {
      "post": {
        "operationId": "runs-sync-finaldynamics-new-homeowner-leads",
        "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/finaldynamics~new-homeowner-leads/run-sync": {
      "post": {
        "operationId": "run-sync-finaldynamics-new-homeowner-leads",
        "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": {
          "agency": {
            "title": "Agency key",
            "type": "string",
            "description": "Accela agency key. See agencies.json for 24 verified portal URLs.",
            "default": "BREA"
          },
          "portalUrl": {
            "title": "Agency portal URL",
            "type": "string",
            "description": "HTTPS base URL ending with the agency key and a slash. Bundled deployment permits aca-prod.accela.com.",
            "default": "https://aca-prod.accela.com/BREA/"
          },
          "module": {
            "title": "Module",
            "type": "string",
            "description": "Citizen Access module using General Search: Building, Enforcement or Planning. Known names are trimmed and normalized; other module names retain their casing. Availability varies by agency; unsupported modules fail clearly.",
            "default": "Building"
          },
          "dateFrom": {
            "title": "Applied date from",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Inclusive applied date, YYYY-MM-DD.",
            "default": "2026-09-02"
          },
          "dateTo": {
            "title": "Applied date to",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Inclusive applied date, YYYY-MM-DD.",
            "default": "2026-09-16"
          },
          "lastDays": {
            "title": "Last N days",
            "minimum": 0,
            "maximum": 366,
            "type": "integer",
            "description": "Search the last N calendar days ending today, instead of fixed dateFrom and dateTo. Leave at 0 to use the fixed dates.",
            "default": 0
          },
          "recordTypes": {
            "title": "Portal record types",
            "type": "array",
            "description": "Names from the portal's own \"Record Type\" list on its General Search page, for example \"Commercial Temp Certificate of Occupancy\". The portal then returns only those record types, which is far faster and cheaper than reading every record in the date range. Leave empty and the actor picks the matching record types itself from \"Permit type contains\"; it falls back to reading everything when the agency publishes no list. A name the agency does not offer stops the run and lists what it does offer.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "permitTypeContains": {
            "title": "Permit type contains",
            "type": "array",
            "description": "Case-insensitive substring matching; any listed string may match. The default matches every certificate of occupancy, temporary certificate of occupancy and occupancy permit type. Emptying the list returns every permit.",
            "items": {
              "type": "string"
            },
            "default": [
              "occupancy"
            ]
          },
          "minValuation": {
            "title": "Minimum valuation (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Zero disables filtering. A positive value excludes unknown valuations; enable includeDetails to read valuation when published.",
            "default": 0
          },
          "maxResults": {
            "title": "Maximum emitted permits",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most rows one run delivers. When a run stops at this limit, the \"only new permits\" memory is not updated, so nothing is skipped next time.",
            "default": 200
          },
          "maxPages": {
            "title": "Maximum result pages read",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Ceiling on search result pages one run reads, across all record types. On reaching it the run stops tidily, delivers everything found so far and says so. Raise it only when a run reports that it stopped here; a wide date range on a busy agency is usually better narrowed instead.",
            "default": 60
          },
          "includeDetails": {
            "title": "Include permit details",
            "type": "boolean",
            "description": "Fetch public detail links for contractor, parcel, dates and valuation. Owner names additionally require includeOwnerName. Each fetched detail page costs $0.004, even if a valuation filter later excludes the record.",
            "default": false
          },
          "includeOwnerName": {
            "title": "Include owner name",
            "type": "boolean",
            "description": "Include the property owner's name from the permit detail page. Off by default because owners are usually private individuals.",
            "default": false
          },
          "sinceLastRun": {
            "title": "Only permits newer than previous run",
            "type": "boolean",
            "description": "Deliver only permits applied for after the newest one a previous run delivered. Needs a key-value store selected below as stateStoreId; give each schedule its own. A run that stops early does not move the marker forward.",
            "default": false
          },
          "stateStoreId": {
            "title": "Incremental state store",
            "type": "string",
            "description": "Key-value store that remembers the newest applied date delivered by sinceLastRun runs. Create one in Apify Console and select it here; each schedule should have its own."
          },
          "statusBaseline": {
            "title": "Previous permit statuses",
            "type": "array",
            "description": "Optional list of permit numbers and statuses from an earlier run, to compare against. Permit numbers match without regard to case.",
            "items": {
              "type": "object",
              "properties": {
                "permitNumber": {
                  "title": "Permit number",
                  "type": "string",
                  "description": "Record number as emitted by an earlier run."
                },
                "status": {
                  "title": "Status",
                  "type": "string",
                  "description": "Status text as emitted by that run."
                }
              },
              "required": [
                "permitNumber",
                "status"
              ],
              "additionalProperties": false
            },
            "default": []
          },
          "statusChangesOnly": {
            "title": "Only status transitions",
            "type": "boolean",
            "description": "Deliver only permits from the list above whose status is different now. Needs a non-empty list.",
            "default": false
          },
          "statusStateStoreId": {
            "title": "Reusable status state store",
            "pattern": "^[A-Za-z0-9_-]{1,128}$",
            "type": "string",
            "description": "A key-value store the actor uses to remember every permit's status between scheduled runs. The first complete run delivers everything and saves the statuses; later runs deliver only permits whose status changed. Use one store per schedule and let runs finish one at a time."
          },
          "statusMonitorMaxPages": {
            "title": "Maximum monitor pages scanned",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Safety limit on search result pages when watching status changes. If the limit is reached, the run stops and the saved statuses stay as they were.",
            "default": 100
          },
          "statusMonitorMaxRecords": {
            "title": "Maximum monitor records scanned",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Safety limit on permits read when watching status changes. If the limit is reached, the run stops and the saved statuses stay as they were.",
            "default": 5000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}