{
  "info": {
    "name": "AllPDFMagic API",
    "description": "Complete REST API for PDF processing and AI document intelligence — 50+ endpoints.\n\n**Base URL:** https://www.allpdfmagic.com\n\n**Authentication:** All requests require `Authorization: Bearer <api_key>`\n\n**Tiers:**\n- Starter (Free): 500 calls/month — compress, merge, split, rotate, delete/extract pages, add-page-numbers, PDF→TXT, PDF→PNG, image-to-PDF\n- Indie ($9/mo): 2,000 calls/month — everything in Starter + PDF sign, AI summarise, HTML→PDF, PDF→CSV, Word/Excel/PPT ↔ PDF, PDF→JPG\n- Developer ($29/mo): 10,000 calls/month — everything in Indie + protect, watermark, unlock, AI extract-invoice, OCR, extract-tables, AI questions\n- Business ($99/mo): 100,000 calls/month — everything in Developer + parse-document/batch, validate, auto-redact, diff/cross-check, fraud detection, GSTR-2B, bulk async processing + 5 pipeline APIs\n\n**Usage endpoints** (check/stats) are always free and do not consume quota.\n\n**Sandbox:** Replace `/api/v1/` with `/api/v1/sandbox/` to test without consuming quota.\n\n**Annual billing:** Save 17–20% — Indie $90/yr, Developer $290/yr, Business $990/yr.\n\nGet your free API key at: https://www.allpdfmagic.com/signup",
    "version": "1.0.0",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "base_url", "value": "https://www.allpdfmagic.com", "type": "string" },
    { "key": "api_key", "value": "apm_live_YOUR_KEY_HERE", "type": "string" }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [{ "key": "token", "value": "{{api_key}}", "type": "string" }]
  },
  "item": [
    {
      "name": "🟢 PDF Operations (Starter — Free)",
      "description": "Core PDF tools available on the free Starter tier.",
      "item": [
        {
          "name": "Compress PDF",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/pdf/compress",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "PDF to compress (required)" },
                { "key": "level", "type": "text", "value": "medium", "description": "low | medium | high (optional)" }
              ]
            },
            "description": "Compress a PDF to reduce file size.\n\n**Returns:** Compressed PDF binary"
          }
        },
        {
          "name": "Merge PDFs",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/pdf/merge",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "files", "type": "file", "src": "", "description": "First PDF" },
                { "key": "files", "type": "file", "src": "", "description": "Second PDF (add more as needed)" }
              ]
            },
            "description": "Merge multiple PDFs into one, in order.\n\n**Returns:** Merged PDF binary"
          }
        },
        {
          "name": "Split PDF",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/pdf/split",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "PDF to split (required)" },
                { "key": "pages", "type": "text", "value": "1-3,5,7-9", "description": "Page ranges (optional, defaults to individual pages)" }
              ]
            },
            "description": "Split a PDF into parts.\n\n**Returns:** ZIP of split PDFs"
          }
        },
        {
          "name": "Rotate PDF",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/pdf/rotate",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "PDF to rotate (required)" },
                { "key": "degrees", "type": "text", "value": "90", "description": "90 | 180 | 270 (optional, default: 90)" }
              ]
            },
            "description": "Rotate all pages in a PDF.\n\n**Returns:** Rotated PDF binary"
          }
        },
        {
          "name": "Image to PDF",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/convert/image-to-pdf",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "files", "type": "file", "src": "", "description": "JPG/PNG/WebP image (add multiple for multi-page)" }
              ]
            },
            "description": "Convert one or more images to a PDF document.\n\n**Returns:** PDF binary"
          }
        },
        {
          "name": "PDF to TXT (text extraction)",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/convert/pdf-to-txt",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "PDF file (required)" }
              ]
            },
            "description": "Extract the text layer from a PDF instantly — no AI cost. For scanned PDFs without a text layer use `/api/v1/ai/ocr`.\n\n**Returns:** text/plain"
          }
        },
        {
          "name": "Delete Pages",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/pdf/delete-pages",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "PDF to edit (required)" },
                { "key": "pages", "type": "text", "value": "1,3-5", "description": "1-based page numbers to remove e.g. \"1,3-5,8\" (required)" }
              ]
            },
            "description": "Remove specific pages from a PDF.\n\n**Returns:** PDF binary (without removed pages)"
          }
        },
        {
          "name": "Extract Pages",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/pdf/extract-pages",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "PDF to extract from (required)" },
                { "key": "pages", "type": "text", "value": "2-4,7", "description": "1-based page numbers to keep e.g. \"2-4,7\" (required)" }
              ]
            },
            "description": "Extract specific pages into a new PDF.\n\n**Returns:** PDF binary (containing only the specified pages)"
          }
        },
        {
          "name": "Add Page Numbers",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/pdf/add-page-numbers",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "PDF to number (required)" },
                { "key": "position", "type": "text", "value": "bottom-center", "description": "bottom-center | bottom-left | bottom-right | top-center | top-left | top-right (optional)" },
                { "key": "start_number", "type": "text", "value": "1", "description": "Starting page number (optional, default: 1)" },
                { "key": "format", "type": "text", "value": "{n}", "description": "\"{n}\" | \"Page {n}\" | \"{n} of {total}\" (optional)" }
              ]
            },
            "description": "Add page numbers to a PDF.\n\n**Returns:** PDF binary with page numbers\n\n**Tier:** Starter (free)"
          }
        },
        {
          "name": "PDF to PNG",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/convert/pdf-to-png",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "PDF to convert (required)" },
                { "key": "dpi", "type": "text", "value": "150", "description": "Resolution in DPI (optional, default: 150)" }
              ]
            },
            "description": "Convert each PDF page to a PNG image.\n\n**Returns:** JSON with `images[]` array — each item has `page`, `filename`, `data` (base64), `encoding`.\n\n**Tier:** Starter (free)"
          }
        }
      ]
    },
    {
      "name": "🖊️ Signatures & AI Summarise (Indie — $9/mo and above)",
      "description": "PDF signing and AI summarisation — available from the Indie plan. Sign with text, drawn, or image signatures. Summarise any PDF instantly.",
      "item": [
        {
          "name": "Sign PDF (Text Signature)",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/pdf/sign",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "PDF to sign (required)" },
                { "key": "signature_type", "type": "text", "value": "text", "description": "text | base64 | image (default: text)" },
                { "key": "text", "type": "text", "value": "John Smith", "description": "Signature text (required when signature_type=text)" },
                { "key": "page", "type": "text", "value": "0", "description": "0-indexed page to sign (default: last page)" },
                { "key": "x", "type": "text", "value": "100", "description": "X position in points (optional)" },
                { "key": "y", "type": "text", "value": "100", "description": "Y position in points (optional)" },
                { "key": "font_size", "type": "text", "value": "24", "description": "Font size for text signatures (optional)" }
              ]
            },
            "description": "Add a text signature to a PDF.\n\nFor drawn signatures pass `signature_type=base64` and `signature_data` (base64 PNG).\nFor image signatures pass `signature_type=image` and `signature_file`.\n\n**Returns:** Signed PDF binary\n\n**Tier:** Indie+"
          }
        },
        {
          "name": "AI Summarise Document",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/ai/summarize",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "PDF to summarise (required)" },
                { "key": "max_length", "type": "text", "value": "500", "description": "Max words in summary (optional)" }
              ]
            },
            "description": "Generate an AI-powered summary of a document with key points.\n\n**Returns:** JSON with summary and key_points[]\n\n**Tier:** Indie+"
          }
        }
      ]
    },
    {
      "name": "🟠 Conversions (Indie — $9/mo and above)",
      "description": "Format conversion APIs available from the Indie plan ($9/mo). HTML→PDF and PDF→CSV are Indie+; all other conversions are also Indie+.",
      "item": [
        {
          "name": "HTML to PDF",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/convert/html-to-pdf",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "HTML file (.html/.htm) — OR use the url field below" },
                { "key": "url", "type": "text", "value": "", "description": "Public URL to render as PDF (use file OR url)" }
              ]
            },
            "description": "Render an HTML file or public URL to PDF using a headless browser.\n\n**Returns:** PDF binary\n\n**Tier:** Indie+"
          }
        },
        {
          "name": "PDF to CSV",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/convert/pdf-to-csv",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "PDF with tables (required)" }
              ]
            },
            "description": "Extract tables from a PDF and return them as CSV.\n\n**Returns:** text/csv (or JSON with `csv` field if Accept: application/json)\n\n**Tier:** Indie+"
          }
        },
        {
          "name": "PDF to Word",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/convert/pdf-to-word",
            "body": {
              "mode": "formdata",
              "formdata": [{ "key": "file", "type": "file", "src": "" }]
            },
            "description": "Convert PDF to editable .docx Word document.\n\n**Returns:** .docx binary"
          }
        },
        {
          "name": "PDF to Excel",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/convert/pdf-to-excel",
            "body": {
              "mode": "formdata",
              "formdata": [{ "key": "file", "type": "file", "src": "" }]
            },
            "description": "Extract tables from PDF to .xlsx Excel.\n\n**Returns:** .xlsx binary"
          }
        },
        {
          "name": "PDF to JPG",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/convert/pdf-to-jpg",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "" },
                { "key": "dpi", "type": "text", "value": "150", "description": "Resolution in DPI (optional)" }
              ]
            },
            "description": "Convert PDF pages to JPG images.\n\n**Returns:** ZIP of JPG images"
          }
        },
        {
          "name": "Word to PDF",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/convert/word-to-pdf",
            "body": {
              "mode": "formdata",
              "formdata": [{ "key": "file", "type": "file", "src": "", "description": ".docx or .doc file" }]
            },
            "description": "Convert Word document to PDF.\n\n**Returns:** PDF binary"
          }
        },
        {
          "name": "Excel to PDF",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/convert/excel-to-pdf",
            "body": {
              "mode": "formdata",
              "formdata": [{ "key": "file", "type": "file", "src": "", "description": ".xlsx or .xls file" }]
            },
            "description": "Convert Excel spreadsheet to PDF.\n\n**Returns:** PDF binary"
          }
        },
        {
          "name": "PPT to PDF",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/convert/ppt-to-pdf",
            "body": {
              "mode": "formdata",
              "formdata": [{ "key": "file", "type": "file", "src": "", "description": ".pptx or .ppt file" }]
            },
            "description": "Convert PowerPoint to PDF.\n\n**Returns:** PDF binary"
          }
        }
      ]
    },
    {
      "name": "🔐 PDF Security & Editing (Developer)",
      "description": "Password-protect and watermark PDFs. Requires Developer plan ($29/mo).",
      "item": [
        {
          "name": "Protect PDF (Password)",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/pdf/protect",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "PDF to protect (required)" },
                { "key": "password", "type": "text", "value": "MySecurePassword123", "description": "Password to set on the PDF (required)" },
                { "key": "permissions", "type": "text", "value": "[\"print\"]", "description": "JSON array of allowed actions: print, copy, annotate, fill_forms (optional — default: read-only)" }
              ]
            },
            "description": "Password-protect a PDF with optional permissions.\n\n**Returns:** Password-protected PDF binary\n\n**Tier:** Developer"
          }
        },
        {
          "name": "Watermark PDF",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/pdf/watermark",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "PDF to watermark (required)" },
                { "key": "text", "type": "text", "value": "CONFIDENTIAL", "description": "Watermark text (use text OR image_file)" },
                { "key": "opacity", "type": "text", "value": "0.3", "description": "0.0–1.0 (optional, default: 0.3)" },
                { "key": "position", "type": "text", "value": "diagonal", "description": "center | diagonal | top-left | top-right | bottom-left | bottom-right (optional)" },
                { "key": "pages", "type": "text", "value": "all", "description": "all (default) or page range e.g. \"1,3-5\"" },
                { "key": "font_size", "type": "text", "value": "48", "description": "Integer (optional, text watermarks only)" },
                { "key": "color", "type": "text", "value": "#808080", "description": "Hex color (optional, text watermarks only)" }
              ]
            },
            "description": "Add a text or image watermark to a PDF.\n\n**Returns:** Watermarked PDF binary\n\n**Tier:** Developer"
          }
        },
        {
          "name": "Unlock PDF (Remove Password)",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/pdf/unlock",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "Password-protected PDF (required)" },
                { "key": "password", "type": "text", "value": "", "description": "Owner/user password if known (optional — tried first)" }
              ]
            },
            "description": "Remove password protection from a PDF.\n\n**Returns:** Unlocked PDF binary\n\n**Tier:** Developer\n\n**Note:** Returns 422 if the password is wrong; 400 if the file is not password-protected."
          }
        }
      ]
    },
    {
      "name": "🤖 AI Document Intelligence (Developer)",
      "description": "AI-powered extraction, OCR, and analysis. Requires Developer plan.",
      "item": [
        {
          "name": "Extract Invoice Data",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/ai/extract-invoice",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "Invoice PDF (required)" },
                { "key": "export_format", "type": "text", "value": "json", "description": "json | csv | excel | quickbooks | xero (optional)" },
                { "key": "include_line_items", "type": "text", "value": "true", "description": "Extract line items (optional, default: true)" }
              ]
            },
            "description": "AI-powered structured data extraction from invoices. Returns vendor, amount, line items, GSTIN, dates, and more.\n\n**Returns:** JSON with extracted invoice data"
          }
        },
        {
          "name": "OCR — Extract Text",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/ai/ocr",
            "body": {
              "mode": "formdata",
              "formdata": [{ "key": "file", "type": "file", "src": "", "description": "Scanned PDF or image (required)" }]
            },
            "description": "Extract text from scanned PDFs and images using OCR.\n\n**Returns:** JSON with extracted text, confidence score, and page count"
          }
        },
        {
          "name": "Extract Tables",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/ai/extract-tables",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "PDF with tables (required)" },
                { "key": "pages", "type": "text", "value": "", "description": "Specific page numbers (optional)" }
              ]
            },
            "description": "Extract tables from PDF to structured JSON or Excel.\n\n**Returns:** JSON with table data, or Excel binary"
          }
        },
        {
          "name": "AI Generate Questions",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/ai/questions",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "PDF document (required)" },
                { "key": "num_questions", "type": "text", "value": "5", "description": "Number of questions to generate (optional, max: 20)" },
                { "key": "difficulty", "type": "text", "value": "medium", "description": "easy | medium | hard (optional)" },
                { "key": "focus_area", "type": "text", "value": "", "description": "Free-text hint e.g. \"financial figures\" or \"key dates\" (optional)" }
              ]
            },
            "description": "Generate comprehension questions from a PDF document — useful for quizzes, onboarding flows, study tools, and document review.\n\n**Returns:** JSON with questions[] array\n\n**Tier:** Developer"
          }
        }
      ]
    },
    {
      "name": "📦 Bulk Processing (Business)",
      "description": "Async batch processing for large volumes. Requires Business plan.",
      "item": [
        {
          "name": "Upload Batch Job",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/bulk/upload",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "files", "type": "file", "src": "", "description": "Files to process (up to 100)" },
                { "key": "operation", "type": "text", "value": "compress", "description": "compress | merge | convert | extract-invoice" }
              ]
            },
            "description": "Submit a batch of files for async processing.\n\n**Returns:** JSON with job_id and poll URL"
          }
        },
        {
          "name": "Check Batch Job Status",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/bulk/:job_id",
            "variable": [{ "key": "job_id", "value": "job_abc123xyz" }],
            "description": "Poll the status of a batch job.\n\n**Returns:** JSON with status, progress, and download URL when complete"
          }
        }
      ]
    },
    {
      "name": "⚡ Enterprise Workflows (Business)",
      "description": "Document intelligence workflows for fintech, legal, and accounting. Requires Business plan ($99/mo).",
      "item": [
        {
          "name": "Parse Document",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/workflows/parse-document",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "PDF, Excel, Word, or image (required)" },
                { "key": "extract_entities", "type": "text", "value": "true", "description": "Extract dates, amounts, entities (optional)" },
                { "key": "include_tables", "type": "text", "value": "true", "description": "Include table data (optional)" }
              ]
            },
            "description": "Parse any document to structured JSON — entities, amounts, dates, tables.\n\n**Note:** Old path `/api/v1/workflows/normalize-data` returns 410 — use this canonical path."
          }
        },
        {
          "name": "Parse Batch",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/workflows/parse-batch",
            "body": {
              "mode": "formdata",
              "formdata": [{ "key": "files", "type": "file", "src": "", "description": "Up to 100 files (required)" }]
            },
            "description": "Parse up to 100 documents in one call. Same shape as parse-document per file.\n\n**Note:** Old path `/api/v1/workflows/normalize-batch` returns 410 — use this canonical path."
          }
        },
        {
          "name": "Validate Document",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/workflows/validate-file",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "" },
                { "key": "format_type", "type": "text", "value": "gst", "description": "gst | bank_upload | vendor_onboarding | insurance_claim" }
              ]
            },
            "description": "Validate a document against compliance rules. Returns a score and list of issues."
          }
        },
        {
          "name": "Validate Batch",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/workflows/validate-batch",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "files", "type": "file", "src": "" },
                { "key": "format_type", "type": "text", "value": "gst" }
              ]
            },
            "description": "Validate multiple files against compliance rules in one call."
          }
        },
        {
          "name": "Auto-Redact PII",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/workflows/auto-redact",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "" },
                { "key": "pii_types", "type": "text", "value": "pan,aadhaar,phone,email", "description": "pan | aadhaar | ssn | email | phone | bank_account | credit_card" }
              ]
            },
            "description": "Automatically detect and redact PII from PDFs. Returns a redacted PDF binary."
          }
        },
        {
          "name": "Extract Contract Clauses",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/workflows/extract-clauses",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "" },
                { "key": "document_type", "type": "text", "value": "contract", "description": "contract | policy | terms" }
              ]
            },
            "description": "Extract clauses, obligations, deadlines, and risk levels from contracts and policies."
          }
        },
        {
          "name": "Detect Duplicates",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/workflows/detect-duplicates",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "files", "type": "file", "src": "", "description": "First file" },
                { "key": "files", "type": "file", "src": "", "description": "Second file (add more as needed)" },
                { "key": "similarity_threshold", "type": "text", "value": "0.95" }
              ]
            },
            "description": "Detect duplicate and near-duplicate documents across a set of files."
          }
        },
        {
          "name": "Diff Documents (formerly compare-versions)",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/workflows/diff-documents",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "old_version", "type": "file", "src": "" },
                { "key": "new_version", "type": "file", "src": "" }
              ]
            },
            "description": "Compare two versions of a document and extract a structured change log.\n\n**Note:** Old path `/api/v1/workflows/compare-versions` returns 410 — use this canonical path."
          }
        },
        {
          "name": "Cross-Check Documents (formerly check-consistency)",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/workflows/cross-check",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "files", "type": "file", "src": "", "description": "Document A (e.g. Invoice)" },
                { "key": "files", "type": "file", "src": "", "description": "Document B (e.g. Purchase Order)" },
                { "key": "comparison_type", "type": "text", "value": "invoice_po" }
              ]
            },
            "description": "Cross-check two documents for consistency (e.g. Invoice vs Purchase Order).\n\n**Note:** Old path `/api/v1/workflows/check-consistency` returns 410 — use this canonical path."
          }
        },
        {
          "name": "Process Bank Statement",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/workflows/process-bank-statement",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "Bank statement PDF" },
                { "key": "currency", "type": "text", "value": "inr_gst", "description": "inr_gst | usd | gbp | eur" }
              ]
            },
            "description": "Analyse a bank statement — extract transactions, categorise spending, compute totals, and export to Tally/Excel."
          }
        },
        {
          "name": "GSTR-2B Reconciliation",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/workflows/reconcile-documents",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "Purchase register or GSTR-2B PDF" },
                { "key": "reconciliation_type", "type": "text", "value": "gstr_2b" }
              ]
            },
            "description": "Reconcile purchase records with GSTR-2B to identify ITC discrepancies and flag mismatches."
          }
        },
        {
          "name": "Detect Invoice Fraud",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/workflows/detect-fraud",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "" },
                { "key": "files", "type": "file", "src": "", "description": "Optional second file for cross-vendor check" }
              ]
            },
            "description": "Run AI fraud detection on invoices. Returns a risk score, risk level, and specific red flags."
          }
        }
      ]
    },
    {
      "name": "🔗 Pipelines (Business)",
      "description": "Outcome-based pipelines that chain multiple workflows. Requires Business plan.",
      "item": [
        {
          "name": "Trusted Data Pipeline",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/pipelines/trusted-data",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "" },
                { "key": "extract_entities", "type": "text", "value": "true" },
                { "key": "include_tables", "type": "text", "value": "true" }
              ]
            },
            "description": "Turn any document into trusted, validated, quality-scored data — runs normalisation, entity extraction, validation, and quality scoring in one pipeline call."
          }
        },
        {
          "name": "Vendor Onboarding Pipeline",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/pipelines/onboarding",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "Business registration, GST cert, or PAN doc (required)" },
                { "key": "gstin", "type": "text", "value": "", "description": "Vendor GSTIN override (optional — extracted from doc if absent)" },
                { "key": "pan", "type": "text", "value": "", "description": "Vendor PAN override (optional)" },
                { "key": "vendor_name", "type": "text", "value": "", "description": "Trading name — aids extraction accuracy (optional)" }
              ]
            },
            "description": "Full vendor onboarding pipeline: extract entity data → verify GSTIN/PAN → risk-score → return APPROVED/REJECTED decision.\n\n**Returns:** JSON with entity data, validation results, risk score, and onboarding decision"
          }
        },
        {
          "name": "Risk Check Pipeline",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/pipelines/risk-check",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "Invoice, contract, or filing to assess (required)" },
                { "key": "document_type", "type": "text", "value": "invoice", "description": "invoice | contract | gst_filing | bank_statement (optional — auto-detected)" }
              ]
            },
            "description": "Comprehensive risk pipeline: fraud score + compliance score + duplicate detection.\n\n**Returns:** JSON risk report with risk_level: low | medium | high | critical"
          }
        },
        {
          "name": "Contract Intelligence Pipeline",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/pipelines/contract-intel",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "Contract PDF (required)" },
                { "key": "counterparty_name", "type": "text", "value": "", "description": "Counterparty name (optional — aids party extraction)" }
              ]
            },
            "description": "End-to-end contract intelligence: clause extraction → obligation mapping → risk scoring → executive summary.\n\n**Returns:** JSON with clauses, obligations, deadlines, risk summary, and executive_summary"
          }
        },
        {
          "name": "Regulatory Compliance Pipeline",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/pipelines/regulatory",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "", "description": "GST return, ITR, TDS, or audit report PDF (required)" },
                { "key": "filing_type", "type": "text", "value": "gst", "description": "gst | itr | tds | audit | mca (optional — auto-detected)" },
                { "key": "assessment_year", "type": "text", "value": "2024-25", "description": "e.g. \"2024-25\" (optional)" }
              ]
            },
            "description": "Regulatory compliance pipeline: detect filing type → validate fields → flag violations → ready-to-file check.\n\n**Returns:** JSON compliance report with issue list, severity classification, and ready_to_file boolean"
          }
        }
      ]
    },
    {
      "name": "🧪 Sandbox (Test Mode — all tiers)",
      "description": "Mirrors every production endpoint but returns mock data. Does NOT count against your monthly quota. Use this to test your integration before going live.",
      "item": [
        {
          "name": "Sandbox — Compress PDF",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/sandbox/pdf/compress",
            "body": { "mode": "formdata", "formdata": [{ "key": "file", "type": "file", "src": "" }] }
          }
        },
        {
          "name": "Sandbox — Extract Invoice",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/sandbox/ai/extract-invoice",
            "body": { "mode": "formdata", "formdata": [{ "key": "file", "type": "file", "src": "" }] }
          }
        },
        {
          "name": "Sandbox — Parse Document",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/sandbox/workflows/parse-document",
            "body": { "mode": "formdata", "formdata": [{ "key": "file", "type": "file", "src": "" }] }
          }
        },
        {
          "name": "Sandbox — Sign PDF",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/sandbox/pdf/sign",
            "body": { "mode": "formdata", "formdata": [{ "key": "file", "type": "file", "src": "" }, { "key": "text", "type": "text", "value": "John Smith" }] }
          }
        },
        {
          "name": "Sandbox — AI Questions",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/sandbox/ai/questions",
            "body": { "mode": "formdata", "formdata": [{ "key": "file", "type": "file", "src": "" }] }
          }
        },
        {
          "name": "Sandbox — PDF to PNG",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/sandbox/convert/pdf-to-png",
            "body": { "mode": "formdata", "formdata": [{ "key": "file", "type": "file", "src": "" }] }
          }
        },
        {
          "name": "Sandbox — Detect Fraud",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/sandbox/workflows/detect-fraud",
            "body": { "mode": "formdata", "formdata": [{ "key": "file", "type": "file", "src": "" }] }
          }
        },
        {
          "name": "Sandbox — HTML to PDF",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/sandbox/convert/html-to-pdf",
            "body": { "mode": "formdata", "formdata": [{ "key": "url", "type": "text", "value": "https://example.com" }] }
          }
        },
        {
          "name": "Sandbox — PDF to TXT",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/sandbox/convert/pdf-to-txt",
            "body": { "mode": "formdata", "formdata": [{ "key": "file", "type": "file", "src": "" }] }
          }
        },
        {
          "name": "Sandbox — Protect PDF",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/sandbox/pdf/protect",
            "body": { "mode": "formdata", "formdata": [{ "key": "file", "type": "file", "src": "" }, { "key": "password", "type": "text", "value": "test" }] }
          }
        },
        {
          "name": "Sandbox — Vendor Onboarding",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/sandbox/pipelines/onboarding",
            "body": { "mode": "formdata", "formdata": [{ "key": "file", "type": "file", "src": "" }] }
          }
        },
        {
          "name": "Sandbox — Risk Check",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/api/v1/sandbox/pipelines/risk-check",
            "body": { "mode": "formdata", "formdata": [{ "key": "file", "type": "file", "src": "" }] }
          }
        },
        {
          "name": "Sandbox — Check Usage",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/sandbox/usage/check"
          }
        }
      ]
    },
    {
      "name": "📊 Usage & Health",
      "item": [
        {
          "name": "Health Check",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/health",
            "description": "Check API health. No authentication required."
          }
        },
        {
          "name": "Check Usage Limits",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/usage/check",
            "description": "Get your current usage count, limit, and reset date for this month."
          }
        },
        {
          "name": "Usage Statistics",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/usage/stats",
            "description": "Get detailed usage statistics broken down by endpoint and day."
          }
        }
      ]
    }
  ]
}
