{
  "openapi": "3.1.0",
  "info": {
    "title": "Velocofile filing discovery and subscriptions",
    "version": "1.0.0",
    "description": "Vendor requirements: filing catalog, immutable source PDFs, and filing change subscriptions."
  },
  "servers": [
    {
      "url": "https://api.velocifile.ai/v1",
      "description": "Production"
    },
    {
      "url": "https://api.dev.velocifile.ai/v1",
      "description": "Sandbox"
    }
  ],
  "security": [
    {
      "partnerKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "partnerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Account-scoped random server credential. See architecture for rotation and scopes."
      }
    }
  },
  "paths": {
    "/taxonomies": {
      "get": {
        "operationId": "listTaxonomies",
        "summary": "List supported controlled vocabularies and paginated carriers",
        "tags": [
          "Filing discovery"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List supported controlled vocabularies and paginated carriers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Taxonomy"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope; status and retry semantics are defined in the architecture document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Error"
                }
              }
            }
          }
        }
      }
    },
    "/filings/search": {
      "post": {
        "operationId": "searchFilings",
        "summary": "Search a stable catalog snapshot",
        "tags": [
          "Filing discovery"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Search a stable catalog snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/SearchResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope; status and retry semantics are defined in the architecture document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "./interfaces.schema.json#/definitions/SearchRequest"
              }
            }
          }
        }
      }
    },
    "/filings/{filing_id}": {
      "get": {
        "operationId": "getFiling",
        "summary": "Read current filing metadata",
        "tags": [
          "Filing discovery"
        ],
        "parameters": [
          {
            "name": "filing_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read current filing metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Filing"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope; status and retry semantics are defined in the architecture document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Error"
                }
              }
            }
          }
        }
      }
    },
    "/filings/{filing_id}/versions": {
      "get": {
        "operationId": "listFilingVersions",
        "summary": "List immutable versions newest first",
        "tags": [
          "Filing discovery"
        ],
        "parameters": [
          {
            "name": "filing_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List immutable versions newest first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/VersionPage"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope; status and retry semantics are defined in the architecture document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Error"
                }
              }
            }
          }
        }
      }
    },
    "/filings/{filing_id}/versions/{filing_version_id}": {
      "get": {
        "operationId": "getFilingVersion",
        "summary": "Read one immutable filing version",
        "tags": [
          "Filing discovery"
        ],
        "parameters": [
          {
            "name": "filing_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
            }
          },
          {
            "name": "filing_version_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read one immutable filing version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Version"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope; status and retry semantics are defined in the architecture document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Error"
                }
              }
            }
          }
        }
      }
    },
    "/filings/{filing_id}/versions/{filing_version_id}/manifest": {
      "get": {
        "operationId": "getManifest",
        "summary": "Download immutable manifest bytes",
        "tags": [
          "Filing discovery"
        ],
        "parameters": [
          {
            "name": "filing_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
            }
          },
          {
            "name": "filing_version_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Download immutable manifest bytes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Manifest"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope; status and retry semantics are defined in the architecture document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Error"
                }
              }
            }
          },
          "410": {
            "description": "VERSION_SUPERSEDED: manifests and PDFs are available for the current version only. Error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Error"
                }
              }
            }
          }
        }
      }
    },
    "/filings/{filing_id}/versions/{filing_version_id}/documents/{document_id}/download": {
      "get": {
        "operationId": "getDocumentDownload",
        "summary": "Mint a short-lived source PDF download URL",
        "tags": [
          "Filing discovery"
        ],
        "parameters": [
          {
            "name": "filing_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
            }
          },
          {
            "name": "filing_version_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
            }
          },
          {
            "name": "document_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Mint a short-lived source PDF download URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Download"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope; status and retry semantics are defined in the architecture document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Error"
                }
              }
            }
          },
          "410": {
            "description": "VERSION_SUPERSEDED: manifests and PDFs are available for the current version only. Error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Error"
                }
              }
            }
          }
        }
      }
    },
    "/watchers": {
      "post": {
        "operationId": "createWatcher",
        "summary": "Create a watcher at an atomic catalog watermark",
        "tags": [
          "Filing subscriptions"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Create a watcher at an atomic catalog watermark",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Watcher"
                }
              }
            },
            "headers": {
              "ETag": {
                "required": true,
                "description": "Quoted decimal watcher revision, for example \"1\".",
                "schema": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "default": {
            "description": "Error envelope; status and retry semantics are defined in the architecture document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Error"
                }
              }
            }
          },
          "422": {
            "description": "WATCHER_SCOPE_TOO_BROAD: a query watcher may match at most 25,000 filings at creation. Error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "./interfaces.schema.json#/definitions/WatcherRequest"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listWatchers",
        "summary": "List this client account watchers",
        "tags": [
          "Filing subscriptions"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List this client account watchers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/WatcherPage"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope; status and retry semantics are defined in the architecture document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Error"
                }
              }
            }
          }
        }
      }
    },
    "/watchers/{watcher_id}": {
      "get": {
        "operationId": "getWatcher",
        "summary": "Read watcher definition and revision",
        "tags": [
          "Filing subscriptions"
        ],
        "parameters": [
          {
            "name": "watcher_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read watcher definition and revision",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Watcher"
                }
              }
            },
            "headers": {
              "ETag": {
                "required": true,
                "description": "Quoted decimal watcher revision, for example \"1\".",
                "schema": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "default": {
            "description": "Error envelope; status and retry semantics are defined in the architecture document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateWatcher",
        "summary": "Pause resume or tombstone a watcher with revision precondition",
        "tags": [
          "Filing subscriptions"
        ],
        "parameters": [
          {
            "name": "watcher_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pause resume or tombstone a watcher with revision precondition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Watcher"
                }
              }
            },
            "headers": {
              "ETag": {
                "required": true,
                "description": "Quoted decimal watcher revision, for example \"1\".",
                "schema": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "default": {
            "description": "Error envelope; status and retry semantics are defined in the architecture document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "./interfaces.schema.json#/definitions/WatcherUpdate"
              }
            }
          }
        }
      }
    },
    "/watchers/{watcher_id}/events": {
      "get": {
        "operationId": "getWatcherEvents",
        "summary": "Replay events after a sequence in ascending order",
        "tags": [
          "Filing subscriptions"
        ],
        "parameters": [
          {
            "name": "watcher_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
            }
          },
          {
            "name": "after_sequence",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Replay events after a sequence in ascending order",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/EventPage"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope; status and retry semantics are defined in the architecture document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./interfaces.schema.json#/definitions/Error"
                }
              }
            }
          }
        }
      }
    }
  }
}
