{
  "openapi": "3.0.1",
  "info": {
    "title": "Code Violation Leads (Accela Code Enforcement Cases)",
    "description": "Code violation leads: code enforcement cases from any Accela Citizen Access city or county with case type, status, address and date. Distressed property lists.",
    "version": "0.1",
    "x-build-id": "myfCiyhVwLxoHsdDT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/finaldynamics~code-violation-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-finaldynamics-code-violation-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~code-violation-leads/runs": {
      "post": {
        "operationId": "runs-sync-finaldynamics-code-violation-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~code-violation-leads/run-sync": {
      "post": {
        "operationId": "run-sync-finaldynamics-code-violation-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": "ATLANTA_GA"
          },
          "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/ATLANTA_GA/"
          },
          "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": "Enforcement"
          },
          "dateFrom": {
            "title": "Applied date from",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Inclusive applied date, YYYY-MM-DD.",
            "default": "2026-09-01"
          },
          "dateTo": {
            "title": "Applied date to",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Inclusive applied date, YYYY-MM-DD.",
            "default": "2026-09-14"
          },
          "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 case types",
            "type": "array",
            "description": "Names or values from the selected module's Record Type list, for example \"Code Complaint\" in Atlanta. The portal searches only those types. At most 25 explicit types are allowed; unknown names stop the run with examples of available types. Leave empty to select types automatically using permitTypeContains. If no list is published, no types match, or more than 25 match, the actor scans the date window and filters rows locally.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "permitTypeContains": {
            "title": "Case type contains",
            "type": "array",
            "description": "Case-insensitive substring matching; any listed string may match. Empty includes all types. With recordTypes empty, matching types from the portal list are searched directly (up to 25). If automatic selection is unavailable, finds no matches, or exceeds 25 matches, the date window is scanned. This filter still applies to returned rows, including when recordTypes is set.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "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 result pages read across all record-type searches (default 60). At the limit the run stops and names the input to change. Narrow the dates, select recordTypes, or raise maxPages. Plain runs retain delivered rows; detail runs deliver only after the failure threshold check. Incomplete status-monitor runs deliver no rows or baseline changes. sinceLastRun is not advanced on an incomplete run.",
            "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. Counts across all record-type searches; maxPages also applies, and the lower limit wins.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}