{
  "openapi": "3.0.1",
  "info": {
    "title": "Washington Contractor License Lookup — L&I Change Alerts",
    "description": "Washington contractor license lookup and verification from L&I open data — new licences, status changes and lapse alerts, plus Oregon.",
    "version": "0.3",
    "x-build-id": "3WLb1Hpkyl7BlFBoO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/themartygriffin~pnw-contractor-compliance-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-themartygriffin-pnw-contractor-compliance-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/themartygriffin~pnw-contractor-compliance-monitor/runs": {
      "post": {
        "operationId": "runs-sync-themartygriffin-pnw-contractor-compliance-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/themartygriffin~pnw-contractor-compliance-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-themartygriffin-pnw-contractor-compliance-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "refresh",
              "check",
              "lookup"
            ],
            "type": "string",
            "description": "'refresh' downloads the current Washington and/or Oregon licence, insurance and bond data and stores it as your baseline snapshot (free). 'check' compares today's data with that baseline and returns one record per change (charged). A 'check' with no stored baseline creates the baseline from today's data and returns the cover already at risk: expired insurance or bond, cover expiring within days_to_lapse, missing cover, impaired bond. 'lookup' returns the current status and lapse risk of the licence numbers you list.",
            "default": "check"
          },
          "states": {
            "title": "State",
            "enum": [
              "both",
              "WA",
              "OR"
            ],
            "type": "string",
            "description": "Which state(s) to refresh, check or look up.",
            "default": "both"
          },
          "licence_numbers": {
            "title": "Licence numbers (lookup)",
            "type": "array",
            "description": "Lookup mode only. Washington numbers look like CASCAAG870N8, Oregon numbers like 100308. An Oregon number can belong to several licence types (the same number is reused across types), and each is returned as its own record. Up to 500.",
            "items": {
              "type": "string"
            }
          },
          "days_to_lapse": {
            "title": "Days to lapse",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Insurance or bond that ends within this many days of today counts as a lapse risk (1 to 365). In 'check' a lapse-risk record appears when cover newly enters this window, not on every run it stays inside it.",
            "default": 30
          },
          "change_types": {
            "title": "Change types (check)",
            "type": "array",
            "description": "Check mode only. Any of: new-licence, status-change, expired, lapse-risk. Empty = all four.",
            "items": {
              "type": "string"
            }
          },
          "licence_types": {
            "title": "Licence types",
            "type": "array",
            "description": "Check mode only. Exact type codes. Washington: CC (construction), EC (electrical), PC (plumbing), LC (elevator). Oregon: e.g. CGC1, CGC2, RGC, RSC, CSC1, CSC2, LBPR, RLC. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "counties": {
            "title": "Counties",
            "type": "array",
            "description": "Check mode only. Oregon county names, e.g. Multnomah, Lane. The Washington source has no county column, so a county filter returns no Washington records. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "include_already_reported": {
            "title": "Re-report changes already reported",
            "type": "boolean",
            "description": "Check mode only. Controls whether changes an earlier run already reported appear in the dataset again. Off (the default): they are left out. On: they are returned again. It never changes what you are charged: a change is billed once, the first time it is reported, and re-reported changes are free.",
            "default": false
          },
          "advance_snapshot": {
            "title": "Advance the baseline after a check",
            "type": "boolean",
            "description": "Check mode only. On: after a check that reported everything it found, today's data replaces the baseline. Off (the default): the baseline stays until you run 'refresh'. A run stopped by the maximum cap never advances the baseline.",
            "default": false
          },
          "max_results": {
            "title": "Maximum charged records per run",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Safety cap on charged records (never reported before) per run. Unchanged records and records returned again for free do not count. Default 2000. A first check against a fresh snapshot has a large backlog of cover already at risk, so a low cap just defers it to later runs.",
            "default": 2000
          },
          "snapshot_name": {
            "title": "Snapshot name",
            "type": "string",
            "description": "Name of the saved baseline. Use a different name for each set of filters you schedule. Changes already reported are remembered per name for hiding, but billed once per account whatever the name.",
            "default": "default"
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}