{
  "openapi": "3.1.0",
  "info": {
    "title": "Omnicap Developer API",
    "version": "1.6.0",
    "description": "Server-side document tools API. Never call the API from a browser or mobile app with a live key. Requests that include an Origin header are rejected. Store keys in a secret manager or server environment variable. Rotate and revoke compromised keys from the developer dashboard."
  },
  "servers": [
    {
      "url": "https://api.omnicap.app/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerApiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key (omni_live_… or omni_test_…)"
      }
    }
  },
  "security": [
    {
      "bearerApiKey": []
    }
  ],
  "paths": {
    "/v1/bates-stamp": {
      "post": {
        "operationId": "bates_stamp",
        "summary": "Bates Numbering API",
        "description": "Stamp sequential Bates numbers on every page of a PDF.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "One or more PDFs. Multiple files merge in order before stamping."
                  },
                  "prefix": {
                    "type": "string",
                    "description": "Text before the number (e.g. CASE-)."
                  },
                  "start": {
                    "type": "string",
                    "description": "Starting number (default 1)."
                  },
                  "digits": {
                    "type": "string",
                    "description": "Zero-pad width (default 6)."
                  },
                  "position": {
                    "type": "string",
                    "description": "top-left | top-right | bottom-left | bottom-right."
                  },
                  "fontSize": {
                    "type": "string",
                    "description": "Font size 6–36 (default 10)."
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/check-extract": {
      "post": {
        "operationId": "check_extract",
        "summary": "Check Extract API",
        "description": "Extract payee, date, amount, check number, and MICR-like digit lines from a check PDF or image for bookkeeping intake.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Check PDF or image. Prefer OCR'd PDFs for image-only scans."
                  },
                  "password": {
                    "type": "string",
                    "description": "Password if the PDF is encrypted."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/compress-pdf": {
      "post": {
        "operationId": "compress_pdf",
        "summary": "Compress PDF API",
        "description": "Reduce PDF file size for email and uploads.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/credit-card-to-excel": {
      "post": {
        "operationId": "credit_card_to_excel",
        "summary": "Credit Card to Excel API",
        "description": "Parse a credit-card statement PDF into an async job; download Excel, CSV, or OFX-family exports when ready.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Credit-card statement PDF (text layer preferred)."
                  },
                  "password": {
                    "type": "string",
                    "description": "Password if the PDF is encrypted."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/csv-fill-pdf": {
      "post": {
        "operationId": "csv_fill_pdf",
        "summary": "CSV Fill PDF API",
        "description": "Fill an AcroForm PDF from the first CSV data row; flatten by default so recipients cannot edit values.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Fillable PDF with AcroForm fields."
                  },
                  "csv": {
                    "type": "string",
                    "format": "binary",
                    "description": "CSV with a header row matching field names."
                  },
                  "password": {
                    "type": "string"
                  },
                  "flatten": {
                    "type": "string",
                    "description": "1 (default) to bake fields; 0 to leave editable."
                  }
                },
                "required": [
                  "file",
                  "csv"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/csv-to-json": {
      "post": {
        "operationId": "csv_to_json",
        "summary": "CSV to JSON API",
        "description": "Convert a headered CSV into a JSON array of objects.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "CSV with a header row."
                  },
                  "pretty": {
                    "type": "string",
                    "description": "Set to 0 or false for compact JSON (default pretty)."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/csv-to-ofx": {
      "post": {
        "operationId": "csv_to_ofx",
        "summary": "CSV to OFX API",
        "description": "Turn bank CSV exports into OFX for accounting imports.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "CSV bank export."
                  },
                  "dateColumn": {
                    "type": "string"
                  },
                  "memoColumn": {
                    "type": "string"
                  },
                  "amountColumn": {
                    "type": "string"
                  },
                  "debitColumn": {
                    "type": "string"
                  },
                  "creditColumn": {
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/x-ofx": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/edit-pdf": {
      "post": {
        "operationId": "edit_pdf",
        "summary": "Edit PDF API",
        "description": "Apply cover, type, watermark, rotate, and permanent remove operations server-side.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "PDF to edit."
                  },
                  "ops": {
                    "type": "string",
                    "description": "JSON array of up to 200 edit operations. Coordinates are PDF user space: origin at the bottom-left, y upward. Page indexes start at 0. A rect is [x0, y0, x1, y1]. Text and note x,y are the baseline. Apply order is rotate, then remove (redact), cover (whiteout), text, image, highlight, note, and watermark. Text uses font helv, times, or cour, size 6–96, color #RRGGBB, and at most 400 characters. Cover paints white and leaves the original characters in the file. Remove deletes the text in the rect, fails if any remains, and also scrubs metadata and hidden text for the whole file. The last watermark wins, opacity 0.05–0.6, at most 80 characters, on every page. An image op names an extra multipart part imageId (img-…): PNG or JPG, at most 8 images, 20 MB each. Highlight and note are annotations."
                  },
                  "password": {
                    "type": "string",
                    "description": "Password if the PDF is locked."
                  }
                },
                "required": [
                  "file",
                  "ops"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/flatten-pdf": {
      "post": {
        "operationId": "flatten_pdf",
        "summary": "Flatten PDF API",
        "description": "Bake form fields and annotations into static page content.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/jpg-to-pdf": {
      "post": {
        "operationId": "jpg_to_pdf",
        "summary": "JPG to PDF API",
        "description": "Combine images into a single PDF.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "PNG, JPG, WebP, or GIF images."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/json-to-csv": {
      "post": {
        "operationId": "json_to_csv",
        "summary": "JSON to CSV API",
        "description": "Convert a JSON array of objects into a CSV spreadsheet.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "JSON file whose root value is an array of objects."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/merge-pdf": {
      "post": {
        "operationId": "merge_pdf",
        "summary": "Merge PDF API",
        "description": "Combine multiple PDFs into one document in upload order.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Two or more PDF files (repeat the field)."
                  },
                  "password": {
                    "type": "string",
                    "description": "Password for encrypted source PDFs."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/pdf-ocr": {
      "post": {
        "operationId": "pdf_ocr",
        "summary": "PDF OCR API",
        "description": "Run OCR on scanned PDFs and return a searchable PDF or plain text.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Scanned PDF to OCR."
                  },
                  "language": {
                    "type": "string",
                    "description": "Tesseract language code (default eng)."
                  },
                  "output": {
                    "type": "string",
                    "description": "pdf (searchable PDF) or txt."
                  },
                  "password": {
                    "type": "string",
                    "description": "Password if the PDF is encrypted."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/pdf-tamper-check": {
      "post": {
        "operationId": "pdf_tamper_check",
        "summary": "PDF Tamper Check API",
        "description": "Heuristic integrity scan returning risk, flags, and summary for incremental updates, hidden text, JS, and signatures.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "PDF to inspect."
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/pdf-to-excel": {
      "post": {
        "operationId": "pdf_to_excel",
        "summary": "PDF to Excel API",
        "description": "Convert bank statements and table PDFs to Excel, CSV, OFX, QBO, or QFX asynchronously.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "PDF file to convert."
                  },
                  "password": {
                    "type": "string",
                    "description": "Password if the PDF is encrypted."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/pdf-to-jpg": {
      "post": {
        "operationId": "pdf_to_jpg",
        "summary": "PDF to JPG API",
        "description": "Render PDF pages to JPG or PNG inside a ZIP archive.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "format": {
                    "type": "string",
                    "description": "jpg or png (default jpg)."
                  },
                  "dpi": {
                    "type": "number",
                    "description": "Resolution, default 150."
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/pdf-to-word": {
      "post": {
        "operationId": "pdf_to_word",
        "summary": "PDF to Word API",
        "description": "Convert a PDF to an editable DOCX via LibreOffice.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "PDF up to 80 pages."
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/protect-pdf": {
      "post": {
        "operationId": "protect_pdf",
        "summary": "Protect PDF API",
        "description": "Add a password to a PDF.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "file",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/receipt-extract": {
      "post": {
        "operationId": "receipt_extract",
        "summary": "Receipt Extract API",
        "description": "Extract merchant, tax, totals, and line items from a receipt PDF or image.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Receipt or invoice PDF, PNG, JPEG, or WebP."
                  },
                  "password": {
                    "type": "string",
                    "description": "Password if the upload is an encrypted PDF."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/redact-pdf": {
      "post": {
        "operationId": "redact_pdf",
        "summary": "Redact PDF API",
        "description": "Permanently remove boxed text and image pixels, then add a watermark, stamp, or page rotation.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "PDF to edit."
                  },
                  "ops": {
                    "type": "string",
                    "description": "JSON array of edits. Rects are PDF points [x0, y0, x1, y1], origin bottom-left. Page indexes are 0-based. Types: redact, rotate (90, 180, 270), watermark, stamp. Supports type regex with pattern for batch text destruction."
                  },
                  "stamp": {
                    "type": "string",
                    "format": "binary",
                    "description": "PNG, JPEG, or WebP placed in the stamp box."
                  },
                  "password": {
                    "type": "string",
                    "description": "Password if the PDF is locked."
                  }
                },
                "required": [
                  "file",
                  "ops"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/sign-self": {
      "post": {
        "operationId": "sign_self",
        "summary": "Self-sign PDF API",
        "description": "Upload a PDF, apply signature and field values, and download the signed file in one request.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "PDF to sign."
                  },
                  "party": {
                    "type": "string",
                    "description": "JSON with fields, consent: true, signaturePngBase64, and optional initialsPngBase64."
                  }
                },
                "required": [
                  "file",
                  "party"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/sign-send": {
      "post": {
        "operationId": "sign_send",
        "summary": "Send for signature API",
        "description": "Upload a PDF, place fields, and email one signer a link. Poll until completed.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "PDF to sign."
                  },
                  "party": {
                    "type": "string",
                    "description": "JSON with signerEmail, signerName, message, and fields (same layout as the Sign web studio)."
                  }
                },
                "required": [
                  "file",
                  "party"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/split-pdf": {
      "post": {
        "operationId": "split_pdf",
        "summary": "Split PDF API",
        "description": "Extract pages from a PDF as a new PDF or a ZIP of single pages.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Source PDF."
                  },
                  "mode": {
                    "type": "string",
                    "description": "all | ranges | zip (default all)."
                  },
                  "ranges": {
                    "type": "string",
                    "description": "Page ranges when mode=ranges, e.g. 1-3,5."
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/pdf or application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/statement-reconcile": {
      "post": {
        "operationId": "statement_reconcile",
        "summary": "Statement Reconcile API",
        "description": "Diff two consecutive statement PDFs, or a PDF against an ERP CSV/OFX/QBO/QFX export. Returns matched rows, one-sided exceptions, date gaps, and a balance bridge.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "left": {
                    "type": "string",
                    "format": "binary",
                    "description": "Earlier statement PDF (or bank PDF in pdf_vs_books). Omit when leftJson is provided."
                  },
                  "leftJson": {
                    "type": "string",
                    "description": "JSON string with transactions (+ balances) from a ready convert job — use instead of left file."
                  },
                  "right": {
                    "type": "string",
                    "format": "binary",
                    "description": "Later statement PDF, or CSV/OFX/QBO/QFX books export."
                  },
                  "mode": {
                    "type": "string",
                    "description": "consecutive (default) or pdf_vs_books."
                  },
                  "leftPassword": {
                    "type": "string"
                  },
                  "rightPassword": {
                    "type": "string"
                  }
                },
                "required": [
                  "right"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/statement-to-ofx": {
      "post": {
        "operationId": "statement_to_ofx",
        "summary": "Bank Statement to OFX API",
        "description": "Parse a bank-statement PDF and return OFX synchronously for accounting imports. For QBO/QFX or batch studio flows, use async pdf-to-excel jobs and download?format=qbo|qfx.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Bank statement PDF (text layer preferred)."
                  },
                  "password": {
                    "type": "string",
                    "description": "Password if the PDF is encrypted."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/x-ofx": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/strip-pdf-metadata": {
      "post": {
        "operationId": "strip_pdf_metadata",
        "summary": "Strip PDF Metadata API",
        "description": "Remove author, title, XMP, JavaScript, and related hidden PDF properties.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/unlock-pdf": {
      "post": {
        "operationId": "unlock_pdf",
        "summary": "Unlock PDF API",
        "description": "Remove a known password from a PDF and return an unencrypted copy.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional idempotency key for billing deduplication."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "file",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File body",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/jobs/from-url": {
      "post": {
        "operationId": "create_job_from_url",
        "summary": "Create convert job from HTTPS PDF URL",
        "description": "Server-side fetch of a PDF URL into a pdf-to-excel style async job. Bills one call when the job is accepted.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "HTTPS URL of a PDF."
                  },
                  "password": {
                    "type": "string"
                  },
                  "filename": {
                    "type": "string",
                    "description": "Optional display filename."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Job accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/jobs/from-drive": {
      "post": {
        "operationId": "create_job_from_drive",
        "summary": "Create convert job from a Google Drive file",
        "description": "Downloads a Drive file with the caller-supplied OAuth access token and enqueues a convert job.",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "accessToken",
                  "fileId"
                ],
                "properties": {
                  "accessToken": {
                    "type": "string",
                    "description": "Google OAuth access token with drive.readonly (or file) scope."
                  },
                  "fileId": {
                    "type": "string",
                    "description": "Google Drive file id."
                  },
                  "password": {
                    "type": "string"
                  },
                  "filename": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Job accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/jobs/{id}": {
      "get": {
        "operationId": "get_job",
        "summary": "Poll convert job",
        "description": "Returns job state, detected bank/account metadata when available, and validationPassed for ledger tie-out.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Job status"
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/jobs/{id}/download": {
      "get": {
        "operationId": "download_job",
        "summary": "Download convert job export",
        "description": "Download xlsx/csv when ready. ofx, qbo, and qfx are generated from parsed transactions when present.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "xlsx",
                "csv",
                "ofx",
                "qbo",
                "qfx"
              ]
            },
            "description": "Default xlsx. OFX family requires extracted transactions."
          }
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Spreadsheet or OFX-family file"
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/sign/envelopes/{id}": {
      "get": {
        "operationId": "get_sign_envelope",
        "summary": "Poll signature envelope",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Envelope status"
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/sign/envelopes/{id}/download": {
      "get": {
        "operationId": "download_signed_pdf",
        "summary": "Download completed signed PDF",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Signed PDF"
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "Quota, billing, or permission error"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    }
  }
}