{
  "openapi": "3.0.1",
  "info": {
    "title": "FDA Wholesale Drug Distributor & 3PL Reporting Monitor",
    "description": "Look up FDA wholesale drug distributor (WDD) and 3PL annual reporting records by license or facility name. Monitor reported expiration dates, DBAs and reporting changes across supplier lists. DSCSA reporting data only; verify state licensure separately.",
    "version": "0.1",
    "x-build-id": "eU8ghZkU4gEp0a25x"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automa-flow~fda-wdd-3pl-reporting-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automa-flow-fda-wdd-3pl-reporting-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/automa-flow~fda-wdd-3pl-reporting-monitor/runs": {
      "post": {
        "operationId": "runs-sync-automa-flow-fda-wdd-3pl-reporting-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/automa-flow~fda-wdd-3pl-reporting-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-automa-flow-fda-wdd-3pl-reporting-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": "Supplier watchlist",
            "minItems": 1,
            "maxItems": 10000,
            "type": "array",
            "description": "One entry per facility or licence you want screened. A licence target needs licenseState and licenseNumber; a name target needs facilityName and matches exactly after case, punctuation and whitespace normalization. Identical targets are de-duplicated and charged once.",
            "items": {
              "type": "object",
              "properties": {
                "licenseState": {
                  "title": "Licence state",
                  "type": "string",
                  "description": "The state that issued the licence, as US-XX or XX (for example US-OH or OH). Required together with licenseNumber.",
                  "editor": "textfield",
                  "maxLength": 32
                },
                "licenseNumber": {
                  "title": "Licence number",
                  "type": "string",
                  "description": "Exact licence number as FDA publishes it. Case and surrounding whitespace are normalized; punctuation is never stripped, because WHO.0008724 and WHO0008724 are different licences.",
                  "editor": "textfield",
                  "maxLength": 100
                },
                "facilityName": {
                  "title": "Facility name",
                  "type": "string",
                  "description": "Exact reported facility name, used when you have no licence number. Never combined with a licence identity in the same target. If the name is reported by more than one facility, the result is AMBIGUOUS rather than a guess.",
                  "editor": "textfield",
                  "maxLength": 300
                },
                "facilityState": {
                  "title": "Facility state (optional filter)",
                  "type": "string",
                  "description": "Restrict the target to facilities located in this state, as XX or US-XX. Useful to disambiguate a company name used at several sites.",
                  "editor": "textfield",
                  "maxLength": 32
                },
                "reference": {
                  "title": "Your reference",
                  "type": "string",
                  "description": "Optional ERP, vendor-master or procurement key echoed unchanged on every row this target produces.",
                  "editor": "textfield",
                  "maxLength": 200
                }
              },
              "additionalProperties": false
            }
          },
          "monitorKey": {
            "title": "Monitor key",
            "minLength": 1,
            "maxLength": 80,
            "type": "string",
            "description": "Names the stored comparison state. Reuse the same key on every scheduled run so changes are detected against that watchlist's own history. 1-80 letters, digits, underscores or hyphens.",
            "default": "default"
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "changesOnly",
              "snapshotAndChanges"
            ],
            "type": "string",
            "description": "changesOnly publishes only baselines, changes and unresolved targets, which is what a scheduled monitor wants. snapshotAndChanges also republishes the current reported records for every matched target on every run.",
            "default": "changesOnly"
          },
          "firstRunBehavior": {
            "title": "First run behaviour",
            "enum": [
              "emitCurrent",
              "baselineOnly"
            ],
            "type": "string",
            "description": "emitCurrent publishes what FDA reports today, so the first run is immediately useful. baselineOnly stores the baseline silently and publishes nothing until something changes. Both are charged, because the screening happened either way.",
            "default": "emitCurrent"
          },
          "facilityTypes": {
            "title": "Facility types",
            "uniqueItems": true,
            "type": "array",
            "description": "Restrict matching to wholesale drug distributors, third-party logistics providers, or both. These are the only two values FDA publishes. Leave empty for both.",
            "items": {
              "type": "string",
              "enum": [
                "WDD",
                "3PL"
              ],
              "enumTitles": [
                "WDD - wholesale drug distributor",
                "3PL - third-party logistics provider"
              ]
            },
            "default": [
              "WDD",
              "3PL"
            ]
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}