{
  "openapi": "3.0.1",
  "info": {
    "title": "🇸🇬 MAS Financial Institutions Directory Change Watch",
    "description": "Monitor the official MAS Financial Institutions Directory and get auditable deltas when a Singapore financial institution is added, removed, or has its licence category or profile changed. Keyed on the source-native MAS entity id, seed-zero, with a receipt every run.",
    "version": "0.1",
    "x-build-id": "iZRCmho78fzTaj8Zz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nexgenwatch~mas-register-watch/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nexgenwatch-mas-register-watch",
        "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/nexgenwatch~mas-register-watch/runs": {
      "post": {
        "operationId": "runs-sync-nexgenwatch-mas-register-watch",
        "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/nexgenwatch~mas-register-watch/run-sync": {
      "post": {
        "operationId": "run-sync-nexgenwatch-mas-register-watch",
        "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": [
          "sector"
        ],
        "properties": {
          "sector": {
            "title": "MAS sector",
            "enum": [
              "Banking",
              "Capital Markets",
              "Financial Advisory",
              "Insurance",
              "Payments"
            ],
            "type": "string",
            "description": "Which public MAS Financial Institutions Directory sector to enumerate. This fixes the complete enumeration surface for the watch.",
            "default": "Payments"
          },
          "watchMode": {
            "title": "Watch mode",
            "type": "boolean",
            "description": "Seed a private baseline and emit only confirmed later changes. The first run emits zero deltas.",
            "default": true
          },
          "institutionIds": {
            "title": "Institution IDs",
            "type": "array",
            "description": "Optional. Restrict tracking to these MAS entity IDs (the leading numeric token of an institution detail URL, e.g. 431405).",
            "items": {
              "type": "string"
            }
          },
          "nameContains": {
            "title": "Name contains",
            "type": "array",
            "description": "Optional. Keep only institutions whose directory name contains one of these substrings (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "categoryContains": {
            "title": "Licence category contains",
            "type": "array",
            "description": "Optional. Keep only institutions whose official licence category (e.g. 'Major Payment Institution', 'Money-changing Licensee') contains one of these substrings (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "nameMatchMode": {
            "title": "Name match mode",
            "enum": [
              "any",
              "all"
            ],
            "type": "string",
            "description": "Match any (default) or all of the nameContains substrings.",
            "default": "any"
          },
          "changeTypes": {
            "title": "Change types",
            "type": "array",
            "description": "Which change classes to emit.",
            "items": {
              "type": "string",
              "enum": [
                "added_to_directory",
                "removed_from_directory",
                "licence_category_changed",
                "profile_changed"
              ]
            },
            "default": [
              "added_to_directory",
              "removed_from_directory",
              "licence_category_changed",
              "profile_changed"
            ]
          },
          "includeDetail": {
            "title": "Enrich from detail page",
            "type": "boolean",
            "description": "Optional. After the primary sector enumeration completes, fetch each in-scope institution detail page for licence type/status and regulated activities. Bounded; disabled by default to keep the base watch cheap and robust.",
            "default": false
          },
          "removalGraceRuns": {
            "title": "Removal grace runs",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "Distinct complete enumerations an institution must be absent before a removal is confirmed.",
            "default": 1
          },
          "includeBeforeAfter": {
            "title": "Include before/after",
            "type": "boolean",
            "description": "Attach the before and after institution profiles on each delta.",
            "default": true
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum institution deltas to emit this run. Overflow is reported as PARTIAL_MAX_ITEMS.",
            "default": 2000
          },
          "baselineId": {
            "title": "Baseline ID",
            "type": "string",
            "description": "Named watch baseline. Changing the canonical scope (sector + filters) derives a new baseline."
          },
          "resetBaseline": {
            "title": "Reset baseline",
            "type": "boolean",
            "description": "Archive the old baseline, re-seed, and emit zero deltas this 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}