{
  "openapi": "3.1.0",
  "info": {
    "title": "Veritura buyer API",
    "version": "2026-10-01",
    "summary": "Read pharmacy and supplier files: every item with who checked it, when, and the receipt.",
    "description": "Free to read. Signed webhooks are on a paid plan for now. Test keys (vk_test_) read a fixed sample with invented names; live keys (vk_live_) read published files, your watches and your private lookups. 300 requests a minute per workspace, counted apart for test and live keys, free; 600 a minute on a paid plan, and 1,200 with supported API automation (Operations). Send X-Veritura-Version: 2026-10-01 to pin the version; every answer carries the version it was answered under. Lists page with limit and cursor (next_cursor), and the two writes take an Idempotency-Key. Veritura checks paperwork at its source; a file is not an approval, a certification or a rating, and it says nothing about any medicine. Nothing is ranked or graded.",
    "contact": {
      "name": "Veritura",
      "url": "https://www.veritura.co/contact"
    }
  },
  "servers": [
    {
      "url": "https://www.veritura.co",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "tags": [
    {
      "name": "Files",
      "description": "Published pharmacy and supplier files."
    },
    {
      "name": "Lookups",
      "description": "The files your workspace keeps about pharmacies. Private to your workspace."
    },
    {
      "name": "Watches",
      "description": "Be told when a published file changes."
    },
    {
      "name": "Exposure",
      "description": "Where products stand on the FDA's public lists."
    }
  ],
  "paths": {
    "/v1/pharmacies": {
      "get": {
        "tags": [
          "Files"
        ],
        "operationId": "listPharmacies",
        "summary": "List published pharmacy files",
        "description": "Alphabetical. Search by part of the name, home state or NPI. Nothing is ranked or graded.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Version"
          },
          {
            "name": "q",
            "in": "query",
            "description": "Part of the name. Up to 80 characters.",
            "schema": {
              "type": "string",
              "maxLength": 80
            }
          },
          {
            "name": "state",
            "in": "query",
            "description": "Home state, two letters (TX).",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{2}$"
            }
          },
          {
            "name": "npi",
            "in": "query",
            "description": "The 10-digit NPI.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{10}$"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "offset",
            "in": "query",
            "deprecated": true,
            "description": "Deprecated: use cursor. Rows to skip. Works until at least Oct 1, 2027; an answer that used it carries Deprecation, Sunset and Link headers. Never with cursor.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The published pharmacy files that match, in alphabetical order.",
            "headers": {
              "X-Veritura-Version": {
                "$ref": "#/components/headers/Version"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PharmacyList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v1/pharmacies/{id}/file": {
      "get": {
        "tags": [
          "Files"
        ],
        "operationId": "getPharmacyFile",
        "summary": "Read one published pharmacy file",
        "description": "The same file a buyer reads on the pharmacy's public page, as data. Findings come first. An unpublished file does not exist here.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Version"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The file id (vfl_...) or its public name (harbor-compounding).",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,120}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The published file.",
            "headers": {
              "X-Veritura-Version": {
                "$ref": "#/components/headers/Version"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v1/suppliers": {
      "get": {
        "tags": [
          "Files"
        ],
        "operationId": "listSuppliers",
        "summary": "List published supplier files",
        "description": "Alphabetical. Search by part of the name or home state.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Version"
          },
          {
            "name": "q",
            "in": "query",
            "description": "Part of the name. Up to 80 characters.",
            "schema": {
              "type": "string",
              "maxLength": 80
            }
          },
          {
            "name": "state",
            "in": "query",
            "description": "Home state, two letters (TX).",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{2}$"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "offset",
            "in": "query",
            "deprecated": true,
            "description": "Deprecated: use cursor. Rows to skip. Works until at least Oct 1, 2027; an answer that used it carries Deprecation, Sunset and Link headers. Never with cursor.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The published supplier files that match, in alphabetical order.",
            "headers": {
              "X-Veritura-Version": {
                "$ref": "#/components/headers/Version"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v1/suppliers/{id}/file": {
      "get": {
        "tags": [
          "Files"
        ],
        "operationId": "getSupplierFile",
        "summary": "Read one published supplier file",
        "parameters": [
          {
            "$ref": "#/components/parameters/Version"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The file id (vfl_...) or its public name.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,120}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The published file.",
            "headers": {
              "X-Veritura-Version": {
                "$ref": "#/components/headers/Version"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v1/lookups": {
      "get": {
        "tags": [
          "Lookups"
        ],
        "operationId": "listLookups",
        "summary": "List your private lookups",
        "description": "The files your workspace keeps about pharmacies, including ones that never published. Only your workspace's keys see them. Paged with limit and cursor.",
        "responses": {
          "200": {
            "description": "Your lookups, in alphabetical order.",
            "headers": {
              "X-Veritura-Version": {
                "$ref": "#/components/headers/Version"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LookupList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/Version"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ]
      },
      "post": {
        "tags": [
          "Lookups"
        ],
        "operationId": "runLookup",
        "summary": "Run a lookup of any pharmacy, or refresh one",
        "description": "Looks up any pharmacy by name or NPI in NPPES, the FDA's compounding actions, warning letters and Data Dashboard, openFDA recalls and OIG's exclusion list, each answer with its receipt, and keeps it private to your workspace. A lookup of the same pharmacy in the last day is returned as it is unless force is true. With watch true, the lookup is watched: the weekly look-up keeps it current and a change arrives as a file.changed alert with kind lookup. 10 lookups a minute per workspace. A test key never asks a public source: every source reads \"Not checked here\" and nothing is stored. Send an Idempotency-Key so a retry never runs it twice: for 24 hours the same key and body return the first answer and run nothing.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LookupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A lookup from the last day, returned as it is (reused: true), or a test key's lookup shape.",
            "headers": {
              "X-Veritura-Version": {
                "$ref": "#/components/headers/Version"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LookupRunResponse"
                }
              }
            }
          },
          "201": {
            "description": "A new lookup, stored privately for your workspace.",
            "headers": {
              "X-Veritura-Version": {
                "$ref": "#/components/headers/Version"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LookupRunResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/Version"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/lookups/{id}": {
      "get": {
        "tags": [
          "Lookups"
        ],
        "operationId": "getLookup",
        "summary": "Read one private lookup",
        "parameters": [
          {
            "$ref": "#/components/parameters/Version"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The lookup id (vfl_...).",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,80}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The lookup, item by item.",
            "headers": {
              "X-Veritura-Version": {
                "$ref": "#/components/headers/Version"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LookupResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v1/watches": {
      "get": {
        "tags": [
          "Watches"
        ],
        "operationId": "listWatches",
        "summary": "List your watches and what changed",
        "description": "Your watches (oldest first) and the changes found (newest first), one page of each; one cursor pages both. The first page compares each watched file with what it showed before, at most once a minute for your workspace; Veritura also compares every six hours without being asked. A change is a sentence, never a score.",
        "responses": {
          "200": {
            "description": "Your watches, and the changes found, newest first.",
            "headers": {
              "X-Veritura-Version": {
                "$ref": "#/components/headers/Version"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/Version"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ]
      },
      "post": {
        "tags": [
          "Watches"
        ],
        "operationId": "watch",
        "summary": "Watch a published file, or one of your lookups",
        "description": "Watching what you already watch returns the same watch. kind lookup watches one of your own lookups, so a pharmacy that never published can be watched; the weekly look-up keeps it current. Send an Idempotency-Key so a retry never runs it twice: for 24 hours the same key and body return the first answer and run nothing.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The watch.",
            "headers": {
              "X-Veritura-Version": {
                "$ref": "#/components/headers/Version"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/Version"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/watches/{id}": {
      "delete": {
        "tags": [
          "Watches"
        ],
        "operationId": "unwatch",
        "summary": "Stop watching a file",
        "parameters": [
          {
            "$ref": "#/components/parameters/Version"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The watch id (fw_...).",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_]{1,80}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The watch is gone.",
            "headers": {
              "X-Veritura-Version": {
                "$ref": "#/components/headers/Version"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/v1/exposure": {
      "get": {
        "tags": [
          "Exposure"
        ],
        "operationId": "getExposure",
        "summary": "Where your products stand on the FDA's public lists, by product",
        "description": "For each product, each substance read from its name and where it stands on the FDA's public lists: the 503A bulks lists and categories, a component of a drug marketed under an FDA application, 21 CFR 216.24, the shortage list, and marketed products a compounded version would copy. Each fact carries its source and the date of the list. With lookup or pharmacy, what the FDA has said about that pharmacy too. Facts, never a verdict. products is paged with limit and cursor; counts cover every product named.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Version"
          },
          {
            "name": "product",
            "in": "query",
            "required": true,
            "description": "A product as the label names it. Repeat for each, up to 24.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 3,
                "maxLength": 160
              },
              "maxItems": 24
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "lookup",
            "in": "query",
            "required": false,
            "description": "One of your lookup ids (vfl_...).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pharmacy",
            "in": "query",
            "required": false,
            "description": "A published pharmacy file id or public name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/ExposureLimit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "The exposure check.",
            "headers": {
              "X-Veritura-Version": {
                "$ref": "#/components/headers/Version"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExposureResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    }
  },
  "webhooks": {
    "file.changed": {
      "post": {
        "summary": "A file you watch changed",
        "description": "Sent to each webhook endpoint your workspace registered for file.changed. Signed webhooks are on a paid plan for now. Verify X-Veritura-Signature (sha256=HMAC-SHA256 of the raw body with your endpoint's secret) before trusting the body. The event id is inside the signed body, so you can recognise a redelivery.",
        "parameters": [
          {
            "name": "X-Veritura-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "file.changed"
            }
          },
          {
            "name": "X-Veritura-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Veritura-Signature",
            "in": "header",
            "required": true,
            "description": "sha256=<hex HMAC-SHA256 of the raw body>",
            "schema": {
              "type": "string",
              "pattern": "^sha256=[0-9a-f]{64}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileChangedEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 5 seconds. Anything else is retried."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key from Settings, Developer: vk_test_... or vk_live_..., scope network:read. Keep it on your server; never in a browser or an app."
      }
    },
    "headers": {
      "RateLimitLimit": {
        "description": "Requests allowed in the current minute for this workspace and mode.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitRemaining": {
        "description": "Requests left in the current minute.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitReset": {
        "description": "When the minute resets, in Unix seconds.",
        "schema": {
          "type": "integer"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before trying again.",
        "schema": {
          "type": "integer"
        }
      },
      "Version": {
        "description": "The API version this answer was given under.",
        "schema": {
          "$ref": "#/components/schemas/ApiVersion"
        }
      },
      "IdempotentReplayed": {
        "description": "true when this is the first answer to an earlier request with the same Idempotency-Key, sent again; nothing ran.",
        "schema": {
          "type": "string",
          "enum": [
            "true"
          ]
        }
      },
      "Deprecation": {
        "description": "When what this request used was deprecated (RFC 9745): @ and Unix seconds.",
        "schema": {
          "type": "string"
        }
      },
      "Sunset": {
        "description": "The date it stops working (RFC 8594), as an HTTP date.",
        "schema": {
          "type": "string"
        }
      },
      "Link": {
        "description": "The docs section that says what to use instead, rel=\"deprecation\".",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "E400": {
        "description": "The request is missing something, names a version this API does not have (version_unknown, which carries no version header), or sends a cursor or Idempotency-Key that is not valid.",
        "headers": {
          "X-Veritura-Version": {
            "$ref": "#/components/headers/Version"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorBody"
            }
          }
        }
      },
      "E401": {
        "description": "No key, a key that is not recognised, or a key that was revoked or has expired.",
        "headers": {
          "X-Veritura-Version": {
            "$ref": "#/components/headers/Version"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorBody"
            }
          }
        }
      },
      "E403": {
        "description": "The key does not carry network:read, or the shared demo cannot be changed.",
        "headers": {
          "X-Veritura-Version": {
            "$ref": "#/components/headers/Version"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorBody"
            }
          }
        }
      },
      "E404": {
        "description": "Nothing with that id: an unpublished file, another workspace's lookup or watch, or a typo.",
        "headers": {
          "X-Veritura-Version": {
            "$ref": "#/components/headers/Version"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorBody"
            }
          }
        }
      },
      "E409": {
        "description": "This Idempotency-Key was used in the last 24 hours for a different request (idempotency_key_reused), or the first request with it is still running (idempotency_in_progress, with Retry-After).",
        "headers": {
          "X-Veritura-Version": {
            "$ref": "#/components/headers/Version"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorBody"
            }
          }
        }
      },
      "E429": {
        "description": "Over the rate limit. Wait Retry-After seconds.",
        "headers": {
          "X-Veritura-Version": {
            "$ref": "#/components/headers/Version"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorBody"
            }
          }
        }
      },
      "E502": {
        "description": "The lookup did not run (lookup_failed). Try again with the same Idempotency-Key.",
        "headers": {
          "X-Veritura-Version": {
            "$ref": "#/components/headers/Version"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorBody"
            }
          }
        }
      }
    },
    "schemas": {
      "ErrorBody": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "What went wrong, in plain words."
          },
          "code": {
            "type": "string",
            "description": "A stable code: key_missing, key_malformed, key_invalid, key_revoked, key_expired, key_issuer_removed, scope_missing, version_unknown, cursor_invalid, idempotency_key_invalid, idempotency_key_reused, idempotency_in_progress, not_found, bad_request, own_file, demo, method_not_allowed, rate_limited, lookup_failed."
          },
          "versions": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "On version_unknown only: the versions this API accepts."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": true
      },
      "ApiVersion": {
        "type": "string",
        "enum": [
          "2026-10-01"
        ],
        "description": "A dated version of this API. Send it as X-Veritura-Version; with no header, the latest stable version answers. A breaking change ships only under a new date, and the version it replaces keeps working for at least 12 months after the new one is released."
      },
      "Mode": {
        "type": "string",
        "enum": [
          "test",
          "live"
        ],
        "description": "test: the sample data. live: published files and your own records."
      },
      "CheckedBy": {
        "type": "string",
        "enum": [
          "",
          "public_source",
          "independent_person",
          "self",
          "document",
          "claim"
        ],
        "description": "Who checked it. public_source: a lookup Veritura ran at the source (the FDA, openFDA, NPPES, OIG). independent_person: someone independent of the firm opened the issuer's own record. self: the firm's own staff recorded it, including a document the firm attested that Veritura could not read. document: Veritura read the document against its rule, or a Veritura reviewer read a document Veritura could not read itself. claim: typed in, nobody checked it. Empty when nothing was checked."
      },
      "Tone": {
        "type": "string",
        "enum": [
          "positive",
          "attention",
          "critical",
          "neutral"
        ]
      },
      "Receipt": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "description": "The source asked."
          },
          "url": {
            "type": "string",
            "description": "A link to the source, https only, or empty."
          },
          "query": {
            "type": "string",
            "description": "What was asked."
          },
          "capturedAt": {
            "type": "string",
            "description": "The date it was asked (YYYY-MM-DD)."
          },
          "sourceCurrentAs": {
            "type": "string"
          },
          "result": {
            "type": "string",
            "description": "What the source returned."
          },
          "by": {
            "type": "string",
            "description": "Who or what asked."
          },
          "limitation": {
            "type": "string",
            "description": "What this lookup cannot show."
          },
          "hash": {
            "type": "string",
            "description": "SHA-256 of the captured row."
          }
        },
        "required": [
          "id",
          "source",
          "query",
          "capturedAt",
          "result"
        ],
        "description": "What was asked, of which source, when, and what came back.",
        "additionalProperties": true
      },
      "Who": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "source",
              "issuer",
              "reader",
              "claim",
              "person"
            ]
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "name"
        ],
        "additionalProperties": true
      },
      "Check": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "pass",
              "fail",
              "attention",
              "not_run"
            ]
          },
          "why": {
            "type": "string"
          },
          "standard": {
            "type": "string"
          },
          "math": {
            "type": "string"
          },
          "cite": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "line": {
                    "type": "integer"
                  },
                  "quote": {
                    "type": "string"
                  }
                },
                "required": [
                  "line"
                ],
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "name",
          "state"
        ],
        "additionalProperties": true
      },
      "Retired": {
        "type": "object",
        "properties": {
          "at": {
            "type": "string"
          },
          "why": {
            "type": "string"
          }
        },
        "required": [
          "at",
          "why"
        ],
        "description": "The firm retired it. It stays on the file, marked.",
        "additionalProperties": true
      },
      "SourceLink": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "additionalProperties": true
      },
      "HistoryEntry": {
        "type": "object",
        "properties": {
          "route": {
            "type": "string"
          },
          "routeWord": {
            "type": "string"
          },
          "result": {
            "type": "string"
          },
          "at": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "receipt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Receipt"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": true
      },
      "Item": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The catalogue item: permit, pic, npi, recalls, sterility ..."
          },
          "group": {
            "type": "string",
            "description": "identity, accreditation, fda, quality or law."
          },
          "label": {
            "type": "string"
          },
          "applies": {
            "type": "boolean"
          },
          "naWord": {
            "type": "string",
            "description": "Why it does not apply, when it does not."
          },
          "counted": {
            "type": "boolean"
          },
          "state": {
            "type": "string",
            "description": "verified, finding, stale, claimed, not_run, missing, expired, not_found, name_differs, contradicted, failed or review_open."
          },
          "stateWord": {
            "type": "string",
            "description": "The item's state in words. For a verified item it says how it was established (the same words as howWord), never a bare \"Confirmed\"."
          },
          "howWord": {
            "type": "string",
            "description": "How the item was established, in words: \"Checked at the source\", \"Answered by the issuer in writing\", \"Confirmed by <first name>\", \"Read by a Veritura reviewer\", \"Read from its document, not checked at the issuer\", \"Recorded by the <firm> itself\", \"Typed in, not checked\", or the bad or missing state."
          },
          "howMark": {
            "type": "string",
            "enum": ["source", "person", "review", "doc", "self", "claim", "missing", "bad"],
            "description": "How the item was established, as a key. Only source and person mean someone other than the firm checked it at the issuer or confirmed it by name; a page shows a check mark for those two only."
          },
          "tone": {
            "$ref": "#/components/schemas/Tone"
          },
          "checkedHere": {
            "type": "boolean",
            "description": "True only when the item was checked by someone other than the firm itself: a public-source lookup, the issuer, a buyer's own check, or Veritura reading a document. A record the firm made about itself, or a value typed in and not checked, is false."
          },
          "checkedBy": {
            "$ref": "#/components/schemas/CheckedBy"
          },
          "checkedByWord": {
            "type": "string",
            "description": "Who checked it, in words: \"Public source lookup\", \"Recorded by the pharmacy's own staff\" ..."
          },
          "summary": {
            "type": "string"
          },
          "route": {
            "type": "string",
            "description": "How the item's leading evidence was established: source_auto (matched at the source by a lookup Veritura ran), issuer (answered by the issuer in writing), source_person (a person opened the issuer's own record), certificate (read by Veritura from the firm's document), reviewed (a document Veritura could not read itself, read by a Veritura reviewer, who found it is what the item asks for), computed (the document's figures checked against a limit computed from the rule), attested (a document Veritura could not read, kept and attested by the person who added it, waiting for a Veritura reviewer), claimed (typed in, not checked). routeWord says it in words."
          },
          "routeWord": {
            "type": "string"
          },
          "at": {
            "type": "string"
          },
          "by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Who"
              },
              {
                "type": "null"
              }
            ]
          },
          "receipt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Receipt"
              },
              {
                "type": "null"
              }
            ]
          },
          "docName": {
            "type": "string"
          },
          "document": {
            "$ref": "#/components/schemas/ItemDocument"
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Check"
            }
          },
          "expires": {
            "type": "string"
          },
          "daysLeft": {
            "type": [
              "integer",
              "null"
            ]
          },
          "nextCheck": {
            "type": "string"
          },
          "retired": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Retired"
              },
              {
                "type": "null"
              }
            ]
          },
          "how": {
            "type": "string",
            "description": "How this item is checked."
          },
          "source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SourceLink"
              },
              {
                "type": "null"
              }
            ]
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoryEntry"
            }
          },
          "askable": {
            "type": "string"
          },
          "onRecord": {
            "type": "boolean",
            "description": "True when anything is on file for the item, whoever recorded it. Use checkedHere to know whether it was checked independently."
          }
        },
        "required": [
          "id",
          "group",
          "label",
          "applies"
        ],
        "description": "One item of the catalogue. Items that do not apply carry only id, group, label, applies and naWord.",
        "additionalProperties": true
      },
      "Finding": {
        "type": "object",
        "properties": {
          "item": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "from": {
            "type": "string",
            "enum": [
              "source",
              "document",
              "records"
            ]
          },
          "route": {
            "type": "string"
          },
          "routeWord": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "at": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "high",
              "medium"
            ]
          },
          "by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Who"
              },
              {
                "type": "null"
              }
            ]
          },
          "checkedBy": {
            "$ref": "#/components/schemas/CheckedBy"
          },
          "checkedByWord": {
            "type": "string"
          },
          "receipt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Receipt"
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SourceLink"
              },
              {
                "type": "null"
              }
            ]
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Check"
            }
          },
          "details": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          },
          "retired": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Retired"
              },
              {
                "type": "null"
              }
            ]
          },
          "negative": {
            "type": "boolean"
          },
          "negativeWord": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        },
        "required": [
          "item",
          "label",
          "from",
          "summary",
          "at",
          "checkedBy",
          "checkedByWord"
        ],
        "description": "A finding on record: a recall, a warning letter, an inspection, an expired license, a failed test. Findings come first; a retired one stays, marked.",
        "additionalProperties": true
      },
      "Completeness": {
        "type": "object",
        "properties": {
          "confirmed": {
            "type": "integer"
          },
          "applicable": {
            "type": "integer"
          },
          "bySelf": {
            "type": "integer"
          },
          "notChecked": {
            "type": "integer"
          },
          "notApplicable": {
            "type": "integer"
          },
          "catalogue": {
            "type": "integer"
          },
          "uncounted": {
            "type": "integer"
          },
          "line": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "checked": {
            "type": "integer",
            "description": "Items a public source, someone independent of the firm, the issuer or Veritura's own read answered. Leads every summary."
          },
          "selfRecorded": {
            "type": "integer",
            "description": "Items the firm recorded about itself. Never counted as checked or confirmed."
          },
          "claimed": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "appliesTo": {
            "type": "string"
          }
        },
        "required": [
          "confirmed",
          "applicable",
          "line"
        ],
        "description": "A count of what is on file and how it was checked. Never a rating.",
        "additionalProperties": true
      },
      "Answer": {
        "type": "object",
        "properties": {
          "facts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "line": {
            "type": "string"
          },
          "boundary": {
            "type": "string"
          },
          "documentsRead": {
            "type": "integer"
          },
          "supplierCertificatesRead": {
            "type": "integer"
          }
        },
        "required": [
          "facts",
          "line"
        ],
        "description": "One or two sentences of facts from the file's own items. Never a grade.",
        "additionalProperties": true
      },
      "PublishedFile": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "description": "The public page, or empty for sample data."
          },
          "side": {
            "type": "string",
            "enum": [
              "pharmacy",
              "supplier"
            ]
          },
          "kind": {
            "type": "string",
            "description": "pharmacy (503A), outsourcing (503B), maker or distributor."
          },
          "kindLabel": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "homeState": {
            "type": "string"
          },
          "npi": {
            "type": "string"
          },
          "publishedAt": {
            "type": "string"
          },
          "lastRefreshAt": {
            "type": "string",
            "description": "When the public sources were last looked up."
          },
          "asOf": {
            "type": "string"
          },
          "statement": {
            "type": "string",
            "description": "What the file is not."
          },
          "completeness": {
            "$ref": "#/components/schemas/Completeness"
          },
          "answer": {
            "$ref": "#/components/schemas/Answer"
          },
          "findings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Finding"
            }
          },
          "pic": {
            "type": [
              "object",
              "null"
            ]
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "items": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "additionalProperties": true
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Item"
            }
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileDocument"
            },
            "description": "Every item's current document, with who may open it, alphabetical by item. The same documents each item carries as document."
          },
          "documentsLine": {
            "type": "string",
            "description": "The documents in a sentence: how many are on file, how many anyone can open, how many are for connected buyers and how many are kept private. Empty when the file has no document."
          },
          "licensedStates": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "notCheckedHere": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "why": {
                  "type": "string"
                },
                "how": {
                  "type": "string"
                },
                "askable": {
                  "type": "string"
                }
              },
              "additionalProperties": true
            }
          },
          "notCheckedLine": {
            "type": "string"
          },
          "askAll": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "askAllUrl": {
            "type": "string"
          },
          "blocks": {
            "type": "object"
          },
          "options": {
            "type": "object"
          },
          "asks": {
            "type": [
              "object",
              "null"
            ]
          },
          "doors": {
            "type": [
              "object",
              "null"
            ]
          },
          "howToRead": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "route": {
                  "type": "string"
                },
                "means": {
                  "type": "string"
                }
              },
              "additionalProperties": true
            }
          },
          "whoChecked": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "mark": {
                  "type": "string"
                },
                "means": {
                  "type": "string"
                }
              },
              "additionalProperties": true
            }
          },
          "telehealth": {
            "type": [
              "object",
              "null"
            ],
            "description": "For telehealth buyers: LegitScript for the website, the states it is licensed in, the pharmacist in charge with the OIG screen, and its essentially-a-copy practice. Facts with sources and dates."
          },
          "exposure": {
            "type": [
              "object",
              "null"
            ],
            "description": "Where each product stands on the FDA's public lists (503A bulk categories, the shortage list, the FDA lists), with the source and date of each list. Facts, never a verdict."
          },
          "sample": {
            "type": "boolean"
          },
          "sampleNote": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "side",
          "kind",
          "name",
          "statement",
          "completeness",
          "answer",
          "findings",
          "items"
        ],
        "description": "A published file, as every reader sees it. New fields may be added; never removed without a dated changelog entry.",
        "additionalProperties": true
      },
      "DirectoryFacts": {
        "type": "object",
        "properties": {
          "lastLookedUp": {
            "type": "string"
          },
          "publicFindings": {
            "type": "integer"
          },
          "findings": {
            "type": "integer"
          },
          "licensedStates": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "certificatesRead": {
            "type": "integer"
          },
          "credentials": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "source": {
                  "type": "string"
                },
                "at": {
                  "type": "string"
                },
                "checkedBy": {
                  "$ref": "#/components/schemas/CheckedBy"
                },
                "state": {
                  "type": "string"
                },
                "line": {
                  "type": "string"
                }
              },
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      },
      "DirectoryRow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "side": {
            "type": "string",
            "enum": [
              "pharmacy",
              "supplier"
            ]
          },
          "kind": {
            "type": "string"
          },
          "kindLabel": {
            "type": "string"
          },
          "homeState": {
            "type": "string"
          },
          "npi": {
            "type": "string"
          },
          "publishedAt": {
            "type": "string"
          },
          "lastRefreshAt": {
            "type": "string"
          },
          "facts": {
            "$ref": "#/components/schemas/DirectoryFacts"
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DirectoryDocument"
            },
            "description": "The file's documents, each with who may open it."
          },
          "fileUrl": {
            "type": "string",
            "description": "The API path of the full file."
          },
          "sample": {
            "type": "boolean"
          },
          "sampleNote": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "side",
          "kind",
          "fileUrl"
        ],
        "additionalProperties": true
      },
      "PharmacyList": {
        "type": "object",
        "properties": {
          "ok": {
            "const": true
          },
          "mode": {
            "$ref": "#/components/schemas/Mode"
          },
          "order": {
            "const": "alphabetical"
          },
          "note": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer",
            "description": "The page size this answer used."
          },
          "offset": {
            "type": "integer",
            "description": "Only when the request sent offset, which is deprecated: use cursor."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it back as cursor for the next page. null on the last page. Opaque: its contents can change."
          },
          "pharmacies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DirectoryRow"
            }
          }
        },
        "required": [
          "ok",
          "mode",
          "order",
          "total",
          "pharmacies",
          "limit",
          "next_cursor"
        ],
        "additionalProperties": true
      },
      "SupplierList": {
        "type": "object",
        "properties": {
          "ok": {
            "const": true
          },
          "mode": {
            "$ref": "#/components/schemas/Mode"
          },
          "order": {
            "const": "alphabetical"
          },
          "note": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer",
            "description": "The page size this answer used."
          },
          "offset": {
            "type": "integer",
            "description": "Only when the request sent offset, which is deprecated: use cursor."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it back as cursor for the next page. null on the last page. Opaque: its contents can change."
          },
          "suppliers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DirectoryRow"
            }
          }
        },
        "required": [
          "ok",
          "mode",
          "order",
          "total",
          "suppliers",
          "limit",
          "next_cursor"
        ],
        "additionalProperties": true
      },
      "FileResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "const": true
          },
          "mode": {
            "$ref": "#/components/schemas/Mode"
          },
          "file": {
            "$ref": "#/components/schemas/PublishedFile"
          }
        },
        "required": [
          "ok",
          "mode",
          "file"
        ],
        "additionalProperties": true
      },
      "LookupRow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "instant": {
            "type": "boolean"
          },
          "kind": {
            "type": "string"
          },
          "kindLabel": {
            "type": "string"
          },
          "homeState": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "lastRefreshAt": {
            "type": "string"
          },
          "publishedByPharmacy": {
            "type": "boolean"
          },
          "findings": {
            "type": "integer"
          },
          "completeness": {
            "type": "string"
          },
          "lookupUrl": {
            "type": "string"
          },
          "sample": {
            "type": "boolean"
          },
          "sampleNote": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "publishedByPharmacy",
          "findings",
          "lookupUrl"
        ],
        "additionalProperties": true
      },
      "LookupList": {
        "type": "object",
        "properties": {
          "ok": {
            "const": true
          },
          "mode": {
            "$ref": "#/components/schemas/Mode"
          },
          "order": {
            "const": "alphabetical"
          },
          "note": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer",
            "description": "The page size this answer used."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it back as cursor for the next page. null on the last page. Opaque: its contents can change."
          },
          "lookups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LookupRow"
            }
          }
        },
        "required": [
          "ok",
          "mode",
          "total",
          "lookups",
          "limit",
          "next_cursor"
        ],
        "additionalProperties": true
      },
      "Lookup": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PublishedFile"
          },
          {
            "type": "object",
            "properties": {
              "private": {
                "const": true
              },
              "instant": {
                "type": "boolean"
              },
              "publishedByPharmacy": {
                "type": "boolean"
              },
              "basis": {
                "type": "string",
                "description": "Whether the pharmacy published, in words."
              },
              "createdAt": {
                "type": "string"
              },
              "lookupSummary": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "For an instant lookup: the public sources asked, each with its receipt, marked Not published by the pharmacy: public sources only."
              }
            },
            "required": [
              "private",
              "publishedByPharmacy",
              "basis"
            ],
            "additionalProperties": true
          }
        ]
      },
      "LookupResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "const": true
          },
          "mode": {
            "$ref": "#/components/schemas/Mode"
          },
          "lookup": {
            "$ref": "#/components/schemas/Lookup"
          }
        },
        "required": [
          "ok",
          "mode",
          "lookup"
        ],
        "additionalProperties": true
      },
      "Watch": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "pharmacy",
              "supplier",
              "lookup"
            ]
          },
          "fileId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "via": {
            "type": "string",
            "enum": [
              "app",
              "api"
            ]
          }
        },
        "required": [
          "id",
          "kind",
          "fileId",
          "name",
          "createdAt",
          "via"
        ],
        "additionalProperties": true
      },
      "Change": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "new_finding, finding_retired, expiring, expired, permit_change, pic_change, item_changed, document_answered, published or withdrawn."
          },
          "item": {
            "type": "string"
          },
          "line": {
            "type": "string",
            "description": "What changed, in a sentence."
          }
        },
        "required": [
          "type",
          "line"
        ],
        "additionalProperties": true
      },
      "Alert": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "pharmacy",
              "supplier",
              "lookup"
            ]
          },
          "fileId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "at": {
            "type": "string"
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Change"
            }
          },
          "read": {
            "type": "boolean"
          },
          "askId": {
            "type": "string"
          },
          "sample": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "fileId",
          "name",
          "at",
          "changes",
          "read"
        ],
        "additionalProperties": true
      },
      "WatchList": {
        "type": "object",
        "properties": {
          "ok": {
            "const": true
          },
          "mode": {
            "$ref": "#/components/schemas/Mode"
          },
          "limit": {
            "type": "integer",
            "description": "The page size this answer used, for each of the two lists."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it back as cursor for the next page. null on the last page. Opaque: its contents can change."
          },
          "watches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Watch"
            },
            "description": "Oldest first."
          },
          "alerts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Alert"
            },
            "description": "Newest first."
          }
        },
        "required": [
          "ok",
          "mode",
          "watches",
          "alerts",
          "limit",
          "next_cursor"
        ],
        "additionalProperties": true,
        "description": "One page of your watches (oldest first) and of the changes found (newest first). One cursor pages both lists; next_cursor is null when both are done."
      },
      "WatchRequest": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "pharmacy",
              "supplier",
              "lookup"
            ],
            "description": "pharmacy or supplier for a published file; lookup for one of your own lookups."
          },
          "id": {
            "type": "string",
            "description": "The file id or its public name."
          }
        },
        "required": [
          "kind",
          "id"
        ],
        "additionalProperties": false
      },
      "WatchResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "const": true
          },
          "mode": {
            "$ref": "#/components/schemas/Mode"
          },
          "watch": {
            "$ref": "#/components/schemas/Watch"
          }
        },
        "required": [
          "ok",
          "mode",
          "watch"
        ],
        "additionalProperties": true
      },
      "DeleteResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "const": true
          },
          "mode": {
            "$ref": "#/components/schemas/Mode"
          },
          "deleted": {
            "type": "string"
          }
        },
        "required": [
          "ok",
          "mode",
          "deleted"
        ],
        "additionalProperties": true
      },
      "FileChangedData": {
        "type": "object",
        "properties": {
          "event": {
            "const": "file.changed"
          },
          "file": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "kind": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "kind",
              "name",
              "url"
            ],
            "additionalProperties": true
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "item": {
                  "type": "string"
                },
                "line": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "line"
              ],
              "additionalProperties": true
            }
          },
          "at": {
            "type": "string"
          }
        },
        "required": [
          "event",
          "file",
          "changes",
          "at"
        ],
        "additionalProperties": true
      },
      "FileChangedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The event id, the same on every redelivery."
          },
          "event": {
            "const": "file.changed"
          },
          "created": {
            "type": "string",
            "description": "When this delivery was made."
          },
          "attempt": {
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/FileChangedData"
          }
        },
        "required": [
          "id",
          "event",
          "created",
          "attempt",
          "data"
        ],
        "additionalProperties": true
      },
      "LookupRequest": {
        "type": "object",
        "properties": {
          "q": {
            "type": "string",
            "description": "The pharmacy's name, or its 10-digit NPI.",
            "minLength": 3,
            "maxLength": 160
          },
          "npi": {
            "type": "string",
            "pattern": "^\\d{10}$"
          },
          "state": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "description": "Optional, to narrow a name."
          },
          "force": {
            "type": "boolean",
            "description": "Ask the sources again now."
          },
          "watch": {
            "type": "boolean",
            "description": "Watch the lookup too."
          }
        }
      },
      "LookupRunResponse": {
        "type": "object",
        "required": [
          "ok",
          "mode",
          "lookup"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "mode": {
            "$ref": "#/components/schemas/Mode"
          },
          "lookup": {
            "$ref": "#/components/schemas/Lookup"
          },
          "reused": {
            "type": "boolean"
          },
          "stored": {
            "type": "boolean",
            "description": "false for a test key: nothing is stored."
          },
          "watch": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Watch"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ExposureFact": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "bulks_503a",
              "withdrawn",
              "shortage",
              "copy",
              "supplier_registration",
              "basis_recorded"
            ]
          },
          "label": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "tone": {
            "$ref": "#/components/schemas/Tone"
          },
          "line": {
            "type": "string"
          },
          "asOf": {
            "type": "string"
          },
          "source": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "label": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            }
          }
        }
      },
      "ExposureProduct": {
        "type": "object",
        "properties": {
          "product": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "fromWord": {
            "type": "string"
          },
          "lotNumber": {
            "type": "string"
          },
          "substances": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "key": {
                  "type": "string"
                },
                "facts": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ExposureFact"
                  }
                }
              }
            }
          },
          "unread": {
            "type": "string"
          }
        }
      },
      "Exposure": {
        "type": "object",
        "properties": {
          "asOf": {
            "type": "string"
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExposureProduct"
            }
          },
          "pharmacy": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "counts": {
            "type": "object"
          },
          "note": {
            "type": "string"
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "description": "products is the page the cursor asked for, in the order you named them; counts, pharmacy and sources describe the whole request and repeat on every page."
      },
      "ExposureResponse": {
        "type": "object",
        "required": [
          "ok",
          "mode",
          "exposure",
          "total",
          "limit",
          "next_cursor"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "mode": {
            "$ref": "#/components/schemas/Mode"
          },
          "pharmacy": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "lookup",
                  "pharmacy"
                ]
              },
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "total": {
            "type": "integer",
            "description": "How many products the request named (each read once)."
          },
          "limit": {
            "type": "integer",
            "description": "The page size this answer used."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send it back as cursor for the next page. null on the last page. Opaque: its contents can change."
          },
          "exposure": {
            "$ref": "#/components/schemas/Exposure"
          }
        }
      },
      "DocumentAccess": {
        "type": "string",
        "enum": [
          "public",
          "connected",
          "private"
        ],
        "description": "Who may open the document behind an item, as the firm chose. public: anyone opens it, with no account. connected: a buyer opens it after asking and the firm allowing; who was allowed, by whom and when is recorded, and every open is recorded. private: never opened by anyone else. Every document starts private. Whatever is chosen, the item, how it was established and any finding stay on the file for every reader."
      },
      "ItemDocument": {
        "type": "object",
        "properties": {
          "access": {
            "$ref": "#/components/schemas/DocumentAccess"
          },
          "accessWord": {
            "type": "string",
            "enum": [
              "Open",
              "Ask for access",
              ""
            ],
            "description": "The action a reader is offered for the document, in words: \"Open\" when access is public, \"Ask for access\" when it is connected, empty when it is private."
          },
          "name": {
            "type": "string",
            "description": "The document's name as the firm added it. Empty when the document is private."
          },
          "keptWord": {
            "type": "string",
            "description": "How the document is kept: \"Original PDF\", \"Original image\" or \"Original text file\" when the firm attached its own file; \"Text copy, as added\" when only its text was added; \"Text copy, first 60,000 characters\" when a longer text was cut. Empty when the document is private."
          },
          "at": {
            "type": "string",
            "description": "The date the document was added to the file (YYYY-MM-DD)."
          },
          "url": {
            "type": "string",
            "description": "The public address that opens the document (/pharmacy/<slug>/document/<item> or /supplier/<slug>/document/<item>). Set only when access is public; empty otherwise. A connected document opens in the buyer's own Veritura workspace once the firm allows it."
          }
        },
        "required": [
          "access",
          "accessWord",
          "name",
          "keptWord",
          "at",
          "url"
        ],
        "description": "The current document behind an item, and who may open it. Present on an item only when the firm has a document on file for it and the item applies. The item's state, summary and findings never depend on it.",
        "additionalProperties": true
      },
      "FileDocument": {
        "type": "object",
        "properties": {
          "itemId": {
            "type": "string",
            "description": "The catalogue item the document answers (permit, pcab, sterility ...)."
          },
          "label": {
            "type": "string",
            "description": "The item, in words."
          },
          "access": {
            "$ref": "#/components/schemas/DocumentAccess"
          },
          "accessWord": {
            "type": "string",
            "enum": [
              "Open",
              "Ask for access",
              ""
            ],
            "description": "The action a reader is offered for the document, in words: \"Open\" when access is public, \"Ask for access\" when it is connected, empty when it is private."
          },
          "at": {
            "type": "string",
            "description": "The date the document was added to the file (YYYY-MM-DD)."
          },
          "name": {
            "type": "string",
            "description": "The document's name as the firm added it. Empty when the document is private."
          },
          "kept": {
            "type": "string",
            "enum": [
              "original",
              "text"
            ],
            "description": "original: the firm's own file is kept; text: only its text. Absent when the document is private."
          },
          "kind": {
            "type": "string",
            "enum": [
              "pdf",
              "png",
              "jpeg",
              "webp",
              "text"
            ],
            "description": "What the kept file is. Absent when the document is private."
          },
          "keptWord": {
            "type": "string",
            "description": "How the document is kept: \"Original PDF\", \"Original image\" or \"Original text file\" when the firm attached its own file; \"Text copy, as added\" when only its text was added; \"Text copy, first 60,000 characters\" when a longer text was cut. Empty when the document is private."
          },
          "size": {
            "type": "integer",
            "description": "The kept file's size in bytes. Absent when the document is private."
          },
          "url": {
            "type": "string",
            "description": "The public address that opens the document (/pharmacy/<slug>/document/<item> or /supplier/<slug>/document/<item>). Set only when access is public; empty otherwise. A connected document opens in the buyer's own Veritura workspace once the firm allows it."
          },
          "line": {
            "type": "string",
            "description": "What a reader can do with the document, in a sentence: \"Anyone can open it.\", \"Connected buyers open it once the firm allows them.\" or, when private, \"Kept private by the firm. The item, how it was established and any finding are on the file.\""
          }
        },
        "required": [
          "itemId",
          "label",
          "access",
          "accessWord",
          "at",
          "line"
        ],
        "description": "One document on a published file: the current document for one item, newest first among its versions. A private document is listed (that a document is on file is never hidden) without its name, kind or address.",
        "additionalProperties": true
      },
      "DirectoryDocument": {
        "type": "object",
        "properties": {
          "itemId": {
            "type": "string",
            "description": "The catalogue item the document answers (permit, pcab, sterility ...)."
          },
          "label": {
            "type": "string",
            "description": "The item, in words."
          },
          "access": {
            "$ref": "#/components/schemas/DocumentAccess"
          },
          "accessWord": {
            "type": "string",
            "enum": [
              "Open",
              "Ask for access",
              ""
            ],
            "description": "The action a reader is offered for the document, in words: \"Open\" when access is public, \"Ask for access\" when it is connected, empty when it is private."
          },
          "name": {
            "type": "string",
            "description": "The document's name as the firm added it. Empty when the document is private."
          },
          "keptWord": {
            "type": "string",
            "description": "How the document is kept: \"Original PDF\", \"Original image\" or \"Original text file\" when the firm attached its own file; \"Text copy, as added\" when only its text was added; \"Text copy, first 60,000 characters\" when a longer text was cut. Empty when the document is private."
          },
          "at": {
            "type": "string",
            "description": "The date the document was added to the file (YYYY-MM-DD)."
          },
          "url": {
            "type": "string",
            "description": "The public address that opens the document (/pharmacy/<slug>/document/<item> or /supplier/<slug>/document/<item>). Set only when access is public; empty otherwise. A connected document opens in the buyer's own Veritura workspace once the firm allows it."
          }
        },
        "required": [
          "itemId",
          "label",
          "access",
          "accessWord",
          "name",
          "keptWord",
          "at",
          "url"
        ],
        "description": "One document on a published file, as a directory row lists it: the item it answers and who may open it.",
        "additionalProperties": true
      }
    },
    "parameters": {
      "Version": {
        "name": "X-Veritura-Version",
        "in": "header",
        "required": false,
        "description": "The API version to answer under. Leave it out for the latest stable version. An unknown version is a 400 version_unknown.",
        "schema": {
          "$ref": "#/components/schemas/ApiVersion"
        }
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "description": "next_cursor from the page before. Leave it out for the first page.",
        "schema": {
          "type": "string",
          "maxLength": 3004
        }
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "description": "Rows a page, 1 to 500. Default 100.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "default": 100
        }
      },
      "ExposureLimit": {
        "name": "limit",
        "in": "query",
        "description": "Products a page, 1 to 24. Default 24.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 24,
          "default": 24
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "A new random key for each new request (a UUID works), sent again on a retry. For 24 hours the same key and body return the first successful answer again and run nothing; the same key with another body is a 409.",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "pattern": "^[!-~]{1,255}$"
        }
      }
    }
  }
}
