{
  "openapi": "3.0.1",
  "info": {
    "title": "Cannabis License Radar: New-Licensee Alerts by Type & County",
    "description": "Name the NY cannabis license types, county or region to watch and get each newly-issued licensee as a deduped BD row (entity, license type, county, issue date) from the NY OCM open-data feed on your schedule. Alerts cover licenses issued from enrollment forward; report mode returns a recent cohort.",
    "version": "0.0",
    "x-build-id": "JKNnEIh4jQPcIJLw1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yungstentech~cannabis-license-radar/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yungstentech-cannabis-license-radar",
        "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/yungstentech~cannabis-license-radar/runs": {
      "post": {
        "operationId": "runs-sync-yungstentech-cannabis-license-radar",
        "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/yungstentech~cannabis-license-radar/run-sync": {
      "post": {
        "operationId": "run-sync-yungstentech-cannabis-license-radar",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "watch",
              "unwatch",
              "list-events",
              "report"
            ],
            "type": "string",
            "description": "What this run does. watch: establish (first run) or advance a standing filter-watch and deliver newly-issued licensees. unwatch: forget a saved filter's memory. list-events: replay this filter's change-event history. report: one-off newly-issued cohort report for a type/county/period (billed once, $29).",
            "default": "watch"
          },
          "licenseTypes": {
            "title": "License types",
            "maxItems": 10,
            "type": "array",
            "description": "Which NY OCM license type codes to watch. Empty means all watchable types. In watch mode OCMRO (Registered Organization) is not selectable because every RO record is a pending application with no issued date; it is available in report mode. Up to 10 types.",
            "items": {
              "type": "string",
              "enum": [
                "OCMRETL",
                "OCMMICR",
                "OCMCAURD22",
                "OCMPROC",
                "OCMCULT",
                "OCMDIST",
                "OCMPT3B",
                "OCMDIST2",
                "OCMPROC2",
                "OCMXROD",
                "OCMPT3F",
                "OCMCAURD22_PCA",
                "OCMRETL_PCA",
                "OCMRO"
              ],
              "enumTitles": [
                "Adult-Use Retail Dispensary",
                "Adult-Use Microbusiness",
                "Adult-Use Conditional Retail Dispensary",
                "Adult-Use Processor",
                "Adult-Use Cultivator",
                "Adult-Use Distributor",
                "Adult-Use Processor Type Three-Branding",
                "Adult-Use Distributor (variant)",
                "Adult-Use Processor (variant)",
                "Adult-Use RO Dispensary",
                "Adult-Use Processor Type Three-Flower",
                "Adult-Use Conditional Retail Dispensary (PCA)",
                "Adult-Use Retail Dispensary (PCA)",
                "Registered Organization (report mode only)"
              ]
            }
          },
          "county": {
            "title": "County (optional)",
            "type": "string",
            "description": "A single NY county to watch, matched case-insensitively (for example Kings, Ulster, New York). At least one of licenseTypes, county or region is required for a watch; report may be broad."
          },
          "region": {
            "title": "Region (optional)",
            "type": "string",
            "description": "A single NY OCM region to watch, matched case-insensitively (for example Manhattan, Finger Lakes). An alternative to county."
          },
          "statusFilter": {
            "title": "License statuses (optional)",
            "type": "array",
            "description": "Optional license_status values to restrict the filter (for example Active). Empty means all statuses. Part of the filter definition, so changing it re-baselines the saved filter.",
            "items": {
              "type": "string"
            }
          },
          "maxAlertsPerRun": {
            "title": "Max alerts per run",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Hard cap on the number of new-licensee alerts delivered and charged in a single run. Any overflow is not added to the seen-set and redelivers on the next run, and a truncation marker names how many were withheld. Bounds a catch-up run.",
            "default": 50
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "type": "string",
            "description": "Optional https URL that receives a POST with the new alerts after each run. Best-effort alerting only: the dataset is the durable record. If you need to verify the caller, put a secret token in the URL yourself."
          },
          "filterName": {
            "title": "Filter name",
            "type": "string",
            "description": "Names this filter within your account so its deduplication memory persists across scheduled runs. Lowercased and restricted to letters, digits and hyphens (1 to 40 characters). Widening a saved filter under the same name re-baselines it (no back-catalog charge).",
            "default": "default"
          },
          "period": {
            "title": "Report period (report mode)",
            "type": "string",
            "description": "Report mode only. The issued-date window for the cohort report, as YYYY-MM (a single month) or YYYY-MM..YYYY-MM (an inclusive range), for example 2026-04..2026-06."
          },
          "dryRun": {
            "title": "Dry run (preview, no charge)",
            "type": "boolean",
            "description": "When true, fetch, aggregate and diff but return at most 5 preview rows, charge nothing and touch no filter memory. Use it to sanity check your filter before scheduling.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}