{
  "openapi": "3.0.1",
  "info": {
    "title": "UK FSA Food Safety Alert Portfolio Report",
    "description": "Monitor official UK Food Standards Agency Food Alerts for Allergy Alerts, Product Recall Information Notices, and Food Alerts for Action. Receive source-linked change alerts, portfolio reports, and exports.",
    "version": "0.1",
    "x-build-id": "XQFOrrglkdKGFOWV1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/taroyamada~food-safety-alert-portfolio-report/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-taroyamada-food-safety-alert-portfolio-report",
        "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~food-safety-alert-portfolio-report/runs": {
      "post": {
        "operationId": "runs-sync-taroyamada-food-safety-alert-portfolio-report",
        "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~food-safety-alert-portfolio-report/run-sync": {
      "post": {
        "operationId": "run-sync-taroyamada-food-safety-alert-portfolio-report",
        "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": [
          "watchlists",
          "monitorKey",
          "initialRunMode",
          "generateReport",
          "emitRawRows",
          "emitUnchanged",
          "maxChargeUsd",
          "dryRun"
        ],
        "properties": {
          "watchlists": {
            "title": "FSA alert watchlists",
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "description": "Each watchlist is an independent FSA query and state observation. Filters within a group are OR; supplied filter groups are ANDed locally.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "title": "Watchlist ID",
                  "type": "string",
                  "description": "Stable identifier used for state and report joins.",
                  "maxLength": 100
                },
                "name": {
                  "title": "Watchlist name",
                  "type": "string",
                  "description": "Optional human-readable label for this food-safety watch.",
                  "maxLength": 160
                },
                "alertTypes": {
                  "title": "Alert types",
                  "type": "array",
                  "description": "Use AA for Allergy Alert, PRIN for Product Recall Information Notice, or FAFA for Food Alert for Action.",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 3
                },
                "allergens": {
                  "title": "Allergens",
                  "type": "array",
                  "description": "FSA documented allergen terms used in problem.allergen and local matching.",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 20
                },
                "hazards": {
                  "title": "Hazards or pathogen risks",
                  "type": "array",
                  "description": "Terms matched against structured FSA problem fields and alert text.",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 20
                },
                "products": {
                  "title": "Products",
                  "type": "array",
                  "description": "Product terms matched against structured FSA product fields and alert text.",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 20
                },
                "searchTerms": {
                  "title": "Additional search terms",
                  "type": "array",
                  "description": "Bounded FSA full-text search terms.",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 20
                },
                "modifiedSince": {
                  "title": "Modified since",
                  "type": "string",
                  "description": "ISO date or datetime. Overrides lookbackDays for this watchlist."
                },
                "lookbackDays": {
                  "title": "Lookback days",
                  "type": "integer",
                  "description": "Bound the official alert window when modifiedSince is not supplied.",
                  "minimum": 1,
                  "maximum": 3650,
                  "default": 30
                },
                "maxResults": {
                  "title": "Maximum source items",
                  "type": "integer",
                  "description": "Maximum official FSA alerts fetched for this watchlist.",
                  "minimum": 1,
                  "maximum": 100,
                  "default": 25
                }
              },
              "required": [
                "id"
              ]
            }
          },
          "monitorKey": {
            "title": "Monitor key",
            "maxLength": 120,
            "type": "string",
            "description": "Stable state namespace for one recurring portfolio.",
            "default": "food-safety-default"
          },
          "initialRunMode": {
            "title": "Initial run mode",
            "enum": [
              "baseline_only",
              "emit_current_window",
              "emit_backfill"
            ],
            "type": "string",
            "description": "baseline_only saves the official snapshot with zero rows; other modes can emit first-run changes.",
            "default": "baseline_only"
          },
          "generateReport": {
            "title": "Generate portfolio report",
            "type": "boolean",
            "description": "Emit one source-linked portfolio report when selected alerts are new or changed.",
            "default": true
          },
          "emitRawRows": {
            "title": "Emit changed alert rows",
            "type": "boolean",
            "description": "Emit low-priced normalized rows for new or changed official alerts.",
            "default": false
          },
          "emitUnchanged": {
            "title": "Include unchanged alerts when another alert changes",
            "type": "boolean",
            "description": "Include unchanged context only in a run that already contains a real alert change; a fully unchanged run remains free.",
            "default": false
          },
          "emitExport": {
            "title": "Generate export row",
            "type": "boolean",
            "description": "Emit one compact handoff export when selected alerts are new or changed.",
            "default": false
          },
          "maxChangedRecords": {
            "title": "Maximum changed alerts per run",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Fail closed if the selected change set exceeds this bounded delivery limit.",
            "default": 25
          },
          "maxChargeUsd": {
            "title": "Maximum charge USD",
            "minimum": 0,
            "maximum": 5000,
            "type": "number",
            "description": "All unique planned events must fit before delivery.",
            "default": 1
          },
          "dryRun": {
            "title": "Dry run",
            "type": "boolean",
            "description": "Uses deterministic fixture output without network, state, or charges.",
            "default": false
          },
          "requestTimeoutSeconds": {
            "title": "Request timeout seconds",
            "minimum": 2,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum time allowed for one official FSA request.",
            "default": 30
          },
          "rateLimitMs": {
            "title": "Minimum request interval ms",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Minimum delay between official source requests.",
            "default": 250
          },
          "maxRetries": {
            "title": "Maximum retries",
            "minimum": 0,
            "maximum": 4,
            "type": "integer",
            "description": "Maximum retry count for transient official source failures.",
            "default": 2
          },
          "backoffBaseMs": {
            "title": "Backoff base ms",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Initial exponential backoff delay after a transient source failure.",
            "default": 250
          },
          "maxBackoffMs": {
            "title": "Maximum backoff ms",
            "minimum": 0,
            "maximum": 15000,
            "type": "integer",
            "description": "Maximum exponential backoff delay between retries.",
            "default": 4000
          },
          "delivery": {
            "title": "Delivery mode",
            "enum": [
              "dataset",
              "webhook"
            ],
            "type": "string",
            "description": "Deliver to the default dataset or also copy the completed payload to an HTTPS webhook.",
            "default": "dataset"
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional HTTPS copy after dataset delivery."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}