{
  "openapi": "3.0.1",
  "info": {
    "title": "FDA Warning Letter Monitor - Supplier & Closeout Changes",
    "description": "Monitor FDA warning letters and response or closeout changes for supplier review. Bounded public windows, literal matches and saved comparisons. No compliance verdicts or letter-body scraping.",
    "version": "1.0",
    "x-build-id": "v9jVohJpg7Q1yrpUK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/maydit~fda-warning-letter-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-maydit-fda-warning-letter-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/maydit~fda-warning-letter-monitor/runs": {
      "post": {
        "operationId": "runs-sync-maydit-fda-warning-letter-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/maydit~fda-warning-letter-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-maydit-fda-warning-letter-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": {
          "sortBy": {
            "title": "Which FDA update window?",
            "enum": [
              "postedDate",
              "letterIssueDate",
              "responsePostedDate",
              "closeoutPostedDate"
            ],
            "type": "string",
            "description": "Descending publisher date, with company name as the second requested sort. Response and closeout sorting still returns warning-letter rows with distinct follow-up links; blanks can follow dated entries.",
            "default": "postedDate"
          },
          "maxSourceRecords": {
            "title": "Source window size",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Read the first 1-100 records in the chosen date order. Company and keyword filters apply only within this window. A missing match is not a clean supplier assessment.",
            "default": 25
          },
          "companyNames": {
            "title": "Supplier or company names",
            "type": "array",
            "description": "Optional literal, case-insensitive substrings; at least one must match the published company name. Up to 30 values of 120 characters. No fuzzy entity matching.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Subject or issuing-office keywords",
            "type": "array",
            "description": "Optional literal, case-insensitive terms across company, subject and issuing office. Any keyword matches; when supplier names are also given, both groups must match. Up to 30 terms.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Maximum saved letter observations",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Confirmed dataset rows only. A result cap can leave matching source rows unsaved. Unchanged rows skipped by onlyChanges do not consume this limit.",
            "default": 10
          },
          "comparePrevious": {
            "title": "Compare with saved observations",
            "type": "boolean",
            "description": "First saved observations are new; later runs show changed or unchanged fields and previous values. Only confirmed saved rows advance history.",
            "default": false
          },
          "onlyChanges": {
            "title": "Save only new or changed observations",
            "type": "boolean",
            "description": "Also enables comparisons. An unchanged run can legitimately save zero rows. A row leaving this bounded window is never reported as removed or resolved.",
            "default": false
          },
          "snapshotName": {
            "title": "Comparison namespace",
            "type": "string",
            "description": "1-80 letters, numbers, underscores or hyphens. The sort, source-window size and normalized filters are also part of the history scope. Use one sequential writer per scope.",
            "default": "default"
          },
          "stateStoreName": {
            "title": "Named history store",
            "type": "string",
            "description": "3-63 letters, numbers or hyphens. Used only for comparisons. Choose a dedicated store for each workflow when isolation is needed.",
            "default": "maydit-fda-warning-letter-history"
          },
          "maxRunSeconds": {
            "title": "Run budget in seconds",
            "minimum": 30,
            "maximum": 900,
            "type": "integer",
            "description": "Includes the publisher crawl delay, currently 30 seconds, and requests/history. Use at least 90 seconds of platform timeout. The Actor reserves 25 seconds before that platform deadline; a 30-second own budget may expire before results.",
            "default": 240
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}