{
  "openapi": "3.0.1",
  "info": {
    "title": "Regulatory Change Monitor API",
    "description": "Monitor official regulator update feeds, government bulletin pages, and public compliance notices with one action-oriented digest row per monitored source.",
    "version": "0.1",
    "x-build-id": "mloO4qnjXmUcl3DeO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/taroyamada~regulatory-change-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-taroyamada-regulatory-change-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/taroyamada~regulatory-change-monitor/runs": {
      "post": {
        "operationId": "runs-sync-taroyamada-regulatory-change-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/taroyamada~regulatory-change-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-taroyamada-regulatory-change-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",
        "required": [
          "targets"
        ],
        "properties": {
          "targets": {
            "title": "Targets (one digest row each)",
            "type": "array",
            "description": "List of regulatory sources to monitor. Each item supports id, name, jurisdiction, regulator, domain, criticality, owner, tags, feedUrl, bulletinUrl, noticesUrl, and optional sourcePages[]."
          },
          "requestTimeoutSeconds": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum time to wait for one public source request.",
            "default": 30
          },
          "userAgent": {
            "title": "Custom User-Agent",
            "type": "string",
            "description": "Optional custom User-Agent string for public HTTP requests."
          },
          "maxChars": {
            "title": "Global max chars per source",
            "minimum": 1000,
            "maximum": 200000,
            "type": "integer",
            "description": "Upper bound for extracted text per monitored source before hashing and diff.",
            "default": 35000
          },
          "delivery": {
            "title": "Delivery mode",
            "enum": [
              "dataset",
              "webhook",
              "email"
            ],
            "type": "string",
            "description": "Choose whether digest rows should be written to the dataset, posted to a webhook, or reserved for a future email path.",
            "default": "dataset"
          },
          "datasetMode": {
            "title": "Dataset mode",
            "enum": [
              "action_needed",
              "changes_only",
              "all"
            ],
            "type": "string",
            "description": "Controls which target rows are persisted: only action-needed rows, only changed rows, or every monitored target.",
            "default": "changes_only"
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Webhook destination when delivery is set to webhook."
          },
          "notifyOnNoChange": {
            "title": "Notify even if no change",
            "type": "boolean",
            "description": "If true, webhook delivery still fires even when no target crosses the change threshold.",
            "default": false
          },
          "snapshotKey": {
            "title": "Snapshot key",
            "type": "string",
            "description": "Stable key used to load and save previous source snapshots between recurring runs.",
            "default": "regulatory-change-monitor-snapshots"
          },
          "diffMode": {
            "title": "Diff mode",
            "enum": [
              "line_summary",
              "hash_only"
            ],
            "type": "string",
            "description": "Use line summaries for concise change evidence or hash-only mode for simple changed/unchanged detection.",
            "default": "line_summary"
          },
          "summaryMaxLines": {
            "title": "Max diff lines per source",
            "minimum": 5,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of added and removed lines to keep in each source-level change summary.",
            "default": 12
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many public sources the actor may fetch in parallel.",
            "default": 2
          },
          "batchDelayMs": {
            "title": "Inter-batch delay (ms)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Delay between fetch batches to soften load on public regulatory sources.",
            "default": 500
          },
          "nowIso": {
            "title": "Override current time (ISO)",
            "type": "string",
            "description": "Optional ISO timestamp override for deterministic fixture tests or proof snapshots."
          },
          "dryRun": {
            "title": "Dry run",
            "type": "boolean",
            "description": "If true, the actor skips snapshot writes and remote delivery while still producing local output.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}