{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Planning Applications Monitor: New, Pending & Decided",
    "description": "Track new, pending, and decided UK planning applications (extensions, new builds, change of use, solar) from planning.data.gov.uk. Covers Camden, Worthing, Adur, and Doncaster today, expanding as the register onboards councils. Deduplicated, with change detection and lead alerts.",
    "version": "0.1",
    "x-build-id": "EYpIK5ghS82DYwcsU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/wallman_3rd~uk-planning-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-wallman_3rd-uk-planning-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/wallman_3rd~uk-planning-monitor/runs": {
      "post": {
        "operationId": "runs-sync-wallman_3rd-uk-planning-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/wallman_3rd~uk-planning-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-wallman_3rd-uk-planning-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": {
          "councils": {
            "title": "Councils",
            "type": "array",
            "description": "Which councils to include, by short code. The planning.data.gov.uk central register currently carries: DNC (Doncaster), ADU (Adur), WOT (Worthing), CMD (Camden). Leave empty to include every council the register covers.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includePending": {
            "title": "Include pending applications",
            "type": "boolean",
            "description": "Include applications that have no decision yet, the high-intent 'work about to start' signal for suppliers and installers.",
            "default": true
          },
          "includeDecided": {
            "title": "Include decided applications",
            "type": "boolean",
            "description": "Include applications that already carry a decision date.",
            "default": true
          },
          "categories": {
            "title": "Application categories",
            "type": "array",
            "description": "Filter to specific derived categories (e.g. extension, new_build, change_of_use, solar_pv, trees, listed_building, advertisement, demolition, other). Leave empty for all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "onlyOutputChanges": {
            "title": "Monitor mode, output only changes",
            "type": "boolean",
            "description": "Push only new/changed/removed applications to the dataset instead of the full list. Ideal for a scheduled run: the first run builds the baseline, each later run reports only what changed.",
            "default": false
          },
          "maxRecordsPerSource": {
            "title": "Max records per council (full mode output)",
            "minimum": 0,
            "type": "integer",
            "description": "In full mode, cap the dataset output to this many of the freshest applications per council (0 = unlimited; a full pull is roughly 100k rows). Change detection always reads the whole register regardless, so monitor mode is unaffected. Kept modest by default so a first run is quick and cheap; raise it for full historical coverage.",
            "default": 5000
          },
          "suppressInitialChanges": {
            "title": "Suppress changes on first run",
            "type": "boolean",
            "description": "On the very first run (no baseline yet), don't emit a 'new' event for every application. Leave on to avoid a flood.",
            "default": true
          },
          "freshLeadAlertDays": {
            "title": "Fresh-lead alert windows (days)",
            "type": "array",
            "description": "Age-since-filed windows for the FRESH_LEADS report, the newest applications are the hottest leads.",
            "default": [
              7,
              14,
              30
            ]
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "HTTPS endpoint to receive change events as a POST after each run (fires only when there are changes and a baseline exists)."
          },
          "checkCoverage": {
            "title": "Check for newly-added councils",
            "type": "boolean",
            "description": "Each run, cheaply check whether the central register has started carrying a council not yet built in, and report it in the COVERAGE output (and webhook). Lets you know the moment new coverage is worth adding.",
            "default": true
          },
          "stateStoreName": {
            "title": "State store name (advanced)",
            "type": "string",
            "description": "Name of the named key-value store that holds this monitor's cross-run baseline. Leave blank to use the shared default. Set a distinct value when you run two schedules or tasks with different inputs so they keep separate baselines instead of overwriting each other."
          },
          "testMode": {
            "title": "Test mode",
            "type": "boolean",
            "description": "Cap every source at 3 records and skip the snapshot update. Free smoke test to confirm the Actor works before a full run.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}