{
  "swagger": "2.0",
  "info": {
    "title": "Zetaleap Power Suite",
    "description": "All-in-one Power Automate connector combining 63 actions: Office (.docx/.xlsx/.pptx) to PDF, PDF AES-256 Lock/Compress/Stamp/AcroForm, Image WebP & Neural OCR, Excel/PPTX {{Tag}} Template Populator, SEPA/TR Payment QR, Fuzzy Vendor Dedupe, Light Digital Contract E-Sign (/sign/:token), External File Intake (/r/:token), MT940/CAMT.053 Bank Statements, UBL-TR/PEPPOL E-Invoice, Celebration GIFs, SFTP SSH, and 150+ FX.",
    "version": "1.0.0",
    "contact": {
      "name": "Zetaleap Support Team",
      "url": "https://zetaleap.com/#contact",
      "email": "support_team@zetaleap.com"
    }
  },
  "x-ms-connector-metadata": [
    {
      "propertyName": "Website",
      "propertyValue": "https://zetaleap.com"
    },
    {
      "propertyName": "Privacy policy",
      "propertyValue": "https://zetaleap.com/privacy"
    },
    {
      "propertyName": "Categories",
      "propertyValue": "Productivity;Data"
    }
  ],
  "host": "zetaleap.com",
  "basePath": "/",
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "securityDefinitions": {
    "api_key": {
      "type": "apiKey",
      "in": "header",
      "name": "Authorization",
      "description": "Enter your Zetaleap Personal Access Token prefixed with Bearer (example: Bearer zl_your_api_token). Generate tokens free at https://zetaleap.com/profile."
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "paths": {
    "/api/hub/esign-create": {
      "post": {
        "operationId": "CreateEsignEnvelope",
        "summary": "Create Light Digital Contract E-Sign Portal (/sign/:token)",
        "description": "Generates a bot-safe digital contract signing portal with an HTML5 touch/mouse signature pad, producing a sealed ISO PDF 1.4 contract + cryptographic SHA-256 Audit Certificate and optional HTTPS webhook callback.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "title",
                "contractBody"
              ],
              "properties": {
                "title": {
                  "type": "string",
                  "title": "Contract Title"
                },
                "contractBody": {
                  "type": "string",
                  "title": "Contract Body Text"
                },
                "requesterName": {
                  "type": "string",
                  "title": "Sender Name / Department"
                },
                "signerName": {
                  "type": "string",
                  "title": "Signer Full Legal Name"
                },
                "signerEmail": {
                  "type": "string",
                  "title": "Signer Work Email"
                },
                "signerCompany": {
                  "type": "string",
                  "title": "Signer Company"
                },
                "webhookUrl": {
                  "type": "string",
                  "title": "Power Automate HTTPS Callback URL"
                },
                "expiresInHours": {
                  "type": "integer",
                  "default": 72,
                  "title": "Expiry Hours"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "token, signingUrl, statusApiUrl, downloadPdfUrl, and documentSha256"
          }
        }
      }
    },
    "/api/hub/intake-create": {
      "post": {
        "operationId": "CreateExternalIntakePortal",
        "summary": "Create External Client / Supplier File & Form Request Portal (/r/:token)",
        "description": "Creates a branded external form & multi-file upload portal bypassing Microsoft Forms external file restrictions without guest licenses, returning SHA-256 verified Base64 attachments via webhook.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string",
                  "title": "Portal Title"
                },
                "description": {
                  "type": "string",
                  "title": "Recipient Instructions"
                },
                "requesterName": {
                  "type": "string",
                  "title": "Requesting Team"
                },
                "maxFiles": {
                  "type": "integer",
                  "default": 3,
                  "title": "Max File Attachments (1-5)"
                },
                "webhookUrl": {
                  "type": "string",
                  "title": "Power Automate HTTPS Callback URL"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "token, portalUrl, statusApiUrl, and configured fields[]"
          }
        }
      }
    },
    "/api/hub/bank-statement": {
      "post": {
        "operationId": "ParseBankStatement",
        "summary": "Parse SWIFT MT940 or ISO 20022 CAMT.053 Bank Statement -> JSON + Excel",
        "description": "Extracts opening/closing balances, credit/debit transactions, counterparty IBANs, mathematical balance reconciliation, and an optional ready-to-open .xlsx workbook.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "statementText": {
                  "type": "string",
                  "title": "Raw MT940 (.sta) or CAMT.053 XML Text"
                },
                "statementBase64": {
                  "type": "string",
                  "title": "Optional Base64 Statement File"
                },
                "includeXlsx": {
                  "type": "boolean",
                  "default": true,
                  "title": "Generate .XLSX Workbook"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "openingBalance, closingBalance, summary, transactions[], and xlsx"
          }
        }
      }
    },
    "/api/hub/ai-json-repair": {
      "post": {
        "operationId": "RepairBrokenAiJson",
        "summary": "Deterministically Repair Broken ChatGPT / Copilot / LLM JSON",
        "description": "Strips markdown fences and conversational text, fixes Python True/False/None, single quotes, unquoted keys, trailing commas, and truncated brackets into strict RFC 8259 JSON.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "rawText"
              ],
              "properties": {
                "rawText": {
                  "type": "string",
                  "title": "Raw LLM Output Text"
                },
                "requiredKeys": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "title": "Optional Required Keys"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "parsed JSON object, normalizedJson, and repairsApplied[]"
          }
        }
      }
    },
    "/api/hub/ai-chunker": {
      "post": {
        "operationId": "ChunkDocumentForAi",
        "summary": "Split Long Text / Markdown into Heading-Aware RAG Token Chunks",
        "description": "Splits contracts, policies, or documents into overlap-preserving token chunks for Azure AI Search, Copilot Studio, and RAG vector indexing.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "text"
              ],
              "properties": {
                "text": {
                  "type": "string",
                  "title": "Document Text / Markdown"
                },
                "maxTokensPerChunk": {
                  "type": "integer",
                  "default": 220,
                  "title": "Max Tokens Per Chunk"
                },
                "overlapTokens": {
                  "type": "integer",
                  "default": 30,
                  "title": "Overlap Tokens"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "chunkCount, totalEstimatedTokens, and chunks[]"
          }
        }
      }
    },
    "/api/automation/office-template": {
      "post": {
        "summary": "Populate Excel (.xlsx) or PowerPoint (.pptx) Template & Inspect Tags",
        "description": "Populates corporate OpenXML .xlsx workbooks ({{Scalar}} + {{#items}}...{{/items}} dynamic row loops with formula preservation) and .pptx slide decks, or inspects broken XML split tags.",
        "operationId": "PopulateOrInspectOfficeTemplate",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "populate_xlsx",
                    "populate_pptx",
                    "inspect"
                  ],
                  "default": "populate_xlsx",
                  "x-ms-summary": "Template Mode"
                },
                "fileBase64": {
                  "type": "string",
                  "x-ms-summary": "Template .xlsx/.pptx/.docx Base64"
                },
                "fileName": {
                  "type": "string",
                  "default": "populated-quote.xlsx",
                  "x-ms-summary": "Output File Name"
                },
                "data": {
                  "type": "object",
                  "x-ms-summary": "Scalar {{Tags}} & Loop Arrays JSON"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Populated outputBase64 + Data URI or Template Tag Doctor diagnostics"
          }
        }
      }
    },
    "/api/automation/xlsx-to-json": {
      "post": {
        "summary": "Read Excel (.xlsx) Without Table to JSON",
        "description": "Extracts rows from any OpenXML .xlsx file into JSON objects without requiring an Excel Table or hitting the 256-row limit.",
        "operationId": "ParseExcelToJson",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "xlsxBase64"
              ],
              "properties": {
                "xlsxBase64": {
                  "type": "string",
                  "x-ms-summary": "Excel .xlsx File Content (Base64)"
                },
                "sheetName": {
                  "type": "string",
                  "x-ms-summary": "Worksheet Name (Optional)"
                },
                "hasHeaderRow": {
                  "type": "boolean",
                  "default": true,
                  "x-ms-summary": "First Row Has Headers"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Parsed worksheet JSON rows and headers"
          }
        }
      }
    },
    "/api/automation/json-to-xlsx": {
      "post": {
        "summary": "Generate Styled Excel (.xlsx) from JSON Rows",
        "description": "Builds a genuine OpenXML .xlsx workbook with styled header row and auto-sized columns from a JSON array.",
        "operationId": "BuildExcelFromJson",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "rows"
              ],
              "properties": {
                "fileName": {
                  "type": "string",
                  "default": "export.xlsx",
                  "x-ms-summary": "Output Filename (.xlsx)"
                },
                "sheetName": {
                  "type": "string",
                  "default": "Data",
                  "x-ms-summary": "Worksheet Tab Name"
                },
                "rows": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  },
                  "x-ms-summary": "JSON Rows Array"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Base64 .xlsx workbook and Data URI"
          }
        }
      }
    },
    "/api/automation/einvoice-xml": {
      "post": {
        "summary": "Parse E-Invoice XML (UBL-TR & PEPPOL) to JSON + HTML",
        "description": "Parses Turkish GİB UBL-TR 2.1 and European PEPPOL BIS 3.0 XML invoices into structured JSON and printable HTML.",
        "operationId": "ParseEInvoiceXml",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "xml": {
                  "type": "string",
                  "x-ms-summary": "Raw UBL-TR / PEPPOL XML String"
                },
                "xmlBase64": {
                  "type": "string",
                  "x-ms-summary": "Or Base64 XML Attachment"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Structured invoice JSON and inline HTML preview"
          }
        }
      }
    },
    "/api/automation/zip-archive": {
      "post": {
        "summary": "Pack or Unpack .ZIP Archive in Memory",
        "description": "Compresses multiple files into a .ZIP bundle or extracts .ZIP entries in memory with ZIP-bomb protection.",
        "operationId": "ManageZipArchive",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "pack",
                    "unpack"
                  ],
                  "default": "pack",
                  "x-ms-summary": "Mode (pack / unpack)"
                },
                "archiveName": {
                  "type": "string",
                  "default": "bundle.zip",
                  "x-ms-summary": "Output Archive Name"
                },
                "zipBase64": {
                  "type": "string",
                  "x-ms-summary": "Input .ZIP Base64 (when unpacking)"
                },
                "files": {
                  "type": "array",
                  "x-ms-summary": "Files to Pack",
                  "items": {
                    "type": "object",
                    "properties": {
                      "fileName": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      },
                      "contentBase64": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Packed .ZIP Base64 or extracted files array"
          }
        }
      }
    },
    "/api/automation/magic-link": {
      "post": {
        "summary": "Create External Approval or Self-Destructing Secret Link",
        "description": "Creates a bot-safe external guest approval link or AES-256-GCM one-time secret link without requiring Microsoft 365 guest licenses.",
        "operationId": "CreateExternalMagicLink",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "approval",
                    "secret"
                  ],
                  "default": "approval"
                },
                "title": {
                  "type": "string",
                  "x-ms-summary": "Portal Heading / Subject"
                },
                "summary": {
                  "type": "string",
                  "x-ms-summary": "Description / Instructions"
                },
                "requesterName": {
                  "type": "string",
                  "x-ms-summary": "Requester Name"
                },
                "secretText": {
                  "type": "string",
                  "x-ms-summary": "One-Time Secret (when mode=secret)"
                },
                "webhookUrl": {
                  "type": "string",
                  "x-ms-summary": "HTTPS Callback URL on Decision"
                },
                "expiresInHours": {
                  "type": "integer",
                  "default": 48
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generated /m/:token share URL and polling endpoint"
          }
        }
      }
    },
    "/api/automation/magic-link/{token}": {
      "get": {
        "summary": "Get External Approval or Secret Link Status",
        "description": "Polls the current status (pending, approved, rejected, burned, expired) of a magic link without burning it.",
        "operationId": "GetMagicLinkStatus",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "type": "string",
            "x-ms-summary": "Magic Link Token (ml_...)"
          }
        ],
        "responses": {
          "200": {
            "description": "Current link state and decision metadata"
          }
        }
      }
    },
    "/api/automation/trust-validate": {
      "post": {
        "summary": "Validate Email MX/SPF/DMARC, Burner Mail & VKN/TCKN",
        "description": "Checks live DNS-over-HTTPS MX/SPF/DMARC records, blocks disposable emails, and verifies Turkish VKN/TCKN checksums.",
        "operationId": "ValidateEmailDomainAndTaxId",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string",
                  "x-ms-summary": "Email Address"
                },
                "domain": {
                  "type": "string",
                  "x-ms-summary": "Domain Name"
                },
                "taxId": {
                  "type": "string",
                  "x-ms-summary": "10-Digit VKN or 11-Digit TCKN"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deliverability score, DNS security, and tax ID checksum result"
          }
        }
      }
    },
    "/api/automation/chart-svg": {
      "post": {
        "summary": "Render Executive Chart Card SVG (Bar, Donut, Gauge)",
        "description": "Generates crisp vector Bar, Donut, or KPI Gauge SVG cards and Outlook HTML <img> tags.",
        "operationId": "RenderExecutiveChartSvg",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "chartType": {
                  "type": "string",
                  "enum": [
                    "bar",
                    "donut",
                    "gauge"
                  ],
                  "default": "bar"
                },
                "theme": {
                  "type": "string",
                  "enum": [
                    "light",
                    "dark"
                  ],
                  "default": "light"
                },
                "title": {
                  "type": "string",
                  "x-ms-summary": "Chart Title"
                },
                "subtitle": {
                  "type": "string",
                  "x-ms-summary": "Chart Subtitle"
                },
                "labels": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "x-ms-summary": "Category Labels"
                },
                "values": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  },
                  "x-ms-summary": "Numeric Values"
                },
                "unit": {
                  "type": "string",
                  "x-ms-summary": "Unit ($, %, EUR)"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rendered SVG, Base64 Data URI, and Outlook HTML <img> tag"
          }
        }
      }
    },
    "/api/automation/docx-extract": {
      "post": {
        "summary": "Extract Plain Text, Tables, Headings & Metadata from Word (.docx)",
        "description": "Reads any raw OpenXML Word (.docx) file in memory and extracts paragraphs, headings, structured JSON table rows, and core document properties.",
        "operationId": "ExtractDocxContent",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "docxBase64"
              ],
              "properties": {
                "docxBase64": {
                  "type": "string",
                  "x-ms-summary": "Word (.docx) File Base64"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Extracted fullText, tables[], headings[], and metadata"
          }
        }
      }
    },
    "/api/automation/html-extract": {
      "post": {
        "summary": "Clean Email HTML, Strip Replies/Signatures & Convert Tables to JSON",
        "description": "Strips Outlook/Gmail quoted reply chains and signatures, extracts clean plain text, links, and parses every HTML <table> into typed JSON arrays.",
        "operationId": "CleanHtmlAndExtractTables",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "html"
              ],
              "properties": {
                "html": {
                  "type": "string",
                  "x-ms-summary": "Raw HTML Body"
                },
                "stripQuotedThread": {
                  "type": "boolean",
                  "default": true,
                  "x-ms-summary": "Strip Quoted Reply Thread"
                },
                "stripSignature": {
                  "type": "boolean",
                  "default": true,
                  "x-ms-summary": "Strip Email Signature"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "latestReplyOnlyText, cleanText, links[], and tables[]"
          }
        }
      }
    },
    "/api/automation/eml-parse": {
      "post": {
        "summary": "Parse Outlook / RFC-5322 (.eml) Email & Extract Attachments",
        "description": "Decodes RFC-2047 UTF-8 headers, Quoted-Printable/Base64 bodies, and recursive multipart MIME attachments into structured JSON.",
        "operationId": "ParseEmlEmail",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "eml": {
                  "type": "string",
                  "x-ms-summary": "Raw RFC-5322 .eml MIME String"
                },
                "emlBase64": {
                  "type": "string",
                  "x-ms-summary": "Or Base64 .eml File Content"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Parsed headers, textBody, htmlBody, and attachments[]"
          }
        }
      }
    },
    "/api/automation/xml-json-query": {
      "post": {
        "summary": "Convert XML <-> JSON & Evaluate Filter/Wildcard Query",
        "description": "Converts arbitrary XML to JSON or JSON to XML and evaluates dot/wildcard/filter queries (e.g. Batch.Order[?status==Approved].Amount) with sum/count/min/max.",
        "operationId": "ConvertAndQueryXmlJson",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "xml_to_json",
                    "json_to_xml",
                    "query_json"
                  ],
                  "default": "xml_to_json"
                },
                "xml": {
                  "type": "string",
                  "x-ms-summary": "XML String (when xml_to_json)"
                },
                "json": {
                  "type": "object",
                  "x-ms-summary": "JSON Object (when json_to_xml or query_json)"
                },
                "rootName": {
                  "type": "string",
                  "default": "Root"
                },
                "query": {
                  "type": "string",
                  "x-ms-summary": "Dot / Filter Query (e.g. Batch.Order[?status==Approved].Amount)"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Converted JSON/XML and queryResult aggregations"
          }
        }
      }
    },
    "/api/automation/text-redline": {
      "post": {
        "summary": "Compare Contract Clauses & Generate Track-Changes Redline HTML",
        "description": "Computes word-level redline diff between original and revised text, returning similarity % and inline <del>/<ins> HTML for Outlook & Teams.",
        "operationId": "CompareTextRedline",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "originalText",
                "revisedText"
              ],
              "properties": {
                "title": {
                  "type": "string",
                  "x-ms-summary": "Document / Clause Title"
                },
                "originalText": {
                  "type": "string",
                  "x-ms-summary": "Original Text (v1)"
                },
                "revisedText": {
                  "type": "string",
                  "x-ms-summary": "Revised Text (v2)"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "similarityPercent, changes[], and inline redlineHtml"
          }
        }
      }
    },
    "/api/pp/regex": {
      "post": {
        "operationId": "RegexMatchExtract",
        "summary": "Match extract or replace text with Regular Expressions",
        "description": "Executes bounded Regular Expression matching, named group extraction, or replacement in Power Automate.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "text",
                "pattern"
              ],
              "properties": {
                "text": {
                  "type": "string",
                  "x-ms-summary": "Source Text"
                },
                "pattern": {
                  "type": "string",
                  "x-ms-summary": "RegEx Pattern"
                },
                "flags": {
                  "type": "string",
                  "default": "gi",
                  "x-ms-summary": "RegEx Flags"
                },
                "mode": {
                  "type": "string",
                  "enum": [
                    "extract",
                    "replace",
                    "split"
                  ],
                  "default": "extract",
                  "x-ms-summary": "Mode"
                },
                "replacement": {
                  "type": "string",
                  "x-ms-summary": "Replacement Text"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Regex evaluation result",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "isMatch": {
                  "type": "boolean",
                  "x-ms-summary": "Is Match"
                },
                "matchCount": {
                  "type": "integer",
                  "x-ms-summary": "Match Count"
                },
                "firstMatch": {
                  "type": "string",
                  "x-ms-summary": "First Match"
                },
                "matches": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "x-ms-summary": "All Matches"
                },
                "replacedText": {
                  "type": "string",
                  "x-ms-summary": "Replaced Text"
                }
              }
            }
          }
        }
      }
    },
    "/api/pp/csv-to-json": {
      "post": {
        "operationId": "ParseCsvToJson",
        "summary": "Parse CSV string into typed JSON array",
        "description": "Parses comma, semicolon, tab, or pipe CSV content into structured JSON rows ready for Apply to each.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "csv"
              ],
              "properties": {
                "csv": {
                  "type": "string",
                  "x-ms-summary": "Raw CSV Content"
                },
                "delimiter": {
                  "type": "string",
                  "default": "auto",
                  "x-ms-summary": "Delimiter (auto , ; |)"
                },
                "normalizeHeaders": {
                  "type": "boolean",
                  "default": true,
                  "x-ms-summary": "Normalize Headers"
                },
                "autoType": {
                  "type": "boolean",
                  "default": true,
                  "x-ms-summary": "Auto Cast Numbers and Booleans"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Parsed CSV rows",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "delimiterUsed": {
                  "type": "string",
                  "x-ms-summary": "Detected Delimiter"
                },
                "rowCount": {
                  "type": "integer",
                  "x-ms-summary": "Row Count"
                },
                "headers": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "x-ms-summary": "Column Headers"
                },
                "rows": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  },
                  "x-ms-summary": "Parsed JSON Rows"
                }
              }
            }
          }
        }
      }
    },
    "/api/pp/adaptive-card": {
      "post": {
        "operationId": "BuildTeamsAdaptiveCard",
        "summary": "Build Microsoft Teams Adaptive Card v1.5 JSON",
        "description": "Generates a valid Microsoft Teams Adaptive Card v1.5 JSON payload for approvals, KPIs, and alerts.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "title",
                "summary"
              ],
              "properties": {
                "template": {
                  "type": "string",
                  "enum": [
                    "approval",
                    "kpi",
                    "incident",
                    "copilot"
                  ],
                  "default": "approval",
                  "x-ms-summary": "Card Template"
                },
                "title": {
                  "type": "string",
                  "x-ms-summary": "Card Title"
                },
                "summary": {
                  "type": "string",
                  "x-ms-summary": "Summary Body"
                },
                "metricValue": {
                  "type": "string",
                  "x-ms-summary": "Highlight Metric"
                },
                "metricDelta": {
                  "type": "string",
                  "x-ms-summary": "Metric Delta"
                },
                "primaryActionTitle": {
                  "type": "string",
                  "x-ms-summary": "Action Button Label"
                },
                "primaryActionUrl": {
                  "type": "string",
                  "x-ms-summary": "Action Button URL"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generated Adaptive Card payload",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "schemaVersion": {
                  "type": "string",
                  "x-ms-summary": "Adaptive Card Version"
                },
                "cardJsonString": {
                  "type": "string",
                  "x-ms-summary": "Adaptive Card JSON String"
                }
              }
            }
          }
        }
      }
    },
    "/api/pp/json-schema": {
      "post": {
        "operationId": "GenerateParseJsonSchema",
        "summary": "Generate null-safe Parse JSON schema from sample payload",
        "description": "Infers a crash-proof nullable JSON schema from any sample payload for Power Automate Parse JSON.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "sample"
              ],
              "properties": {
                "sample": {
                  "type": "object",
                  "x-ms-summary": "Sample JSON Object"
                },
                "nullSafe": {
                  "type": "boolean",
                  "default": true,
                  "x-ms-summary": "Allow Null Values"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generated Parse JSON schema",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "schemaString": {
                  "type": "string",
                  "x-ms-summary": "Parse JSON Schema String"
                }
              }
            }
          }
        }
      }
    },
    "/api/pp/mask-pii": {
      "post": {
        "operationId": "MaskSensitivePii",
        "summary": "Redact emails IBANs cards and phones before AI prompts",
        "description": "Masks sensitive PII tokens in unstructured text prior to Copilot Studio or OpenAI prompts.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "text"
              ],
              "properties": {
                "text": {
                  "type": "string",
                  "x-ms-summary": "Input Text"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Redacted text result",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "maskedText": {
                  "type": "string",
                  "x-ms-summary": "Masked Safe Text"
                },
                "redactionCount": {
                  "type": "integer",
                  "x-ms-summary": "Redaction Count"
                }
              }
            }
          }
        }
      }
    },
    "/api/pp/business-days": {
      "post": {
        "operationId": "CalculateBusinessDays",
        "summary": "Calculate SLA business days excluding weekends and holidays",
        "description": "Adds business days or calculates working day difference using regional holiday calendars.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "startDate"
              ],
              "properties": {
                "startDate": {
                  "type": "string",
                  "x-ms-summary": "Start Date (YYYY-MM-DD)"
                },
                "daysToAdd": {
                  "type": "integer",
                  "default": 5,
                  "x-ms-summary": "Business Days to Add"
                },
                "country": {
                  "type": "string",
                  "default": "US",
                  "x-ms-summary": "Holiday Country (US UK EU DE TR)"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SLA calculation response",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "resultDate": {
                  "type": "string",
                  "x-ms-summary": "Target Business Date"
                },
                "businessDays": {
                  "type": "integer",
                  "x-ms-summary": "Business Days"
                },
                "weekendDaysSkipped": {
                  "type": "integer",
                  "x-ms-summary": "Weekends Skipped"
                }
              }
            }
          }
        }
      }
    },
    "/api/pp/qr-barcode": {
      "post": {
        "operationId": "GenerateQrOrBarcode",
        "summary": "Generate ISO QR Code or Code-128 Barcode as SVG and Data URI",
        "description": "Generates scannable ISO/IEC 18004 QR Code or Code-128B linear barcode SVG and Base64 Data URI for Power Apps, SharePoint, and Outlook.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "value"
              ],
              "properties": {
                "format": {
                  "type": "string",
                  "enum": [
                    "qr",
                    "code128"
                  ],
                  "default": "qr",
                  "x-ms-summary": "Code Format (qr or code128)"
                },
                "value": {
                  "type": "string",
                  "x-ms-summary": "Encoded Value or URL"
                },
                "label": {
                  "type": "string",
                  "x-ms-summary": "Optional Human-Readable Caption"
                },
                "size": {
                  "type": "integer",
                  "default": 240,
                  "x-ms-summary": "Size in Pixels"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generated SVG and Data URI",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "svg": {
                  "type": "string",
                  "x-ms-summary": "Raw SVG Markup"
                },
                "dataUri": {
                  "type": "string",
                  "x-ms-summary": "Power Apps Image Data URI"
                },
                "htmlImgTag": {
                  "type": "string",
                  "x-ms-summary": "Outlook HTML Image Tag"
                }
              }
            }
          }
        }
      }
    },
    "/api/pp/iban-vat": {
      "post": {
        "operationId": "ValidateIbanAndVat",
        "summary": "Validate ISO 13616 IBAN checksum and EU UK TR VAT format",
        "description": "Validates international IBAN length and MOD-97 checksum across 70+ countries plus EU, UK, Swiss, and Turkish VAT syntax.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "iban": {
                  "type": "string",
                  "x-ms-summary": "IBAN Account Number"
                },
                "vatNumber": {
                  "type": "string",
                  "x-ms-summary": "EU UK or TR VAT Number"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "IBAN and VAT validation details",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "iban": {
                  "type": "object",
                  "x-ms-summary": "IBAN Validation Result"
                },
                "vat": {
                  "type": "object",
                  "x-ms-summary": "VAT Validation Result"
                }
              }
            }
          }
        }
      }
    },
    "/api/pp/ics-calendar": {
      "post": {
        "operationId": "GenerateOutlookIcsInvite",
        "summary": "Generate RFC-5545 Outlook ICS calendar invite attachment",
        "description": "Builds a standard .ics calendar event file and Base64 payload ready for Office 365 Outlook email attachments.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "title",
                "startUtc"
              ],
              "properties": {
                "title": {
                  "type": "string",
                  "x-ms-summary": "Meeting Title"
                },
                "startUtc": {
                  "type": "string",
                  "x-ms-summary": "Start Time ISO UTC"
                },
                "durationMinutes": {
                  "type": "integer",
                  "default": 60,
                  "x-ms-summary": "Duration Minutes"
                },
                "location": {
                  "type": "string",
                  "x-ms-summary": "Location or Teams Link"
                },
                "description": {
                  "type": "string",
                  "x-ms-summary": "Agenda Description"
                },
                "organizerEmail": {
                  "type": "string",
                  "x-ms-summary": "Organizer Email"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generated ICS payload",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "fileName": {
                  "type": "string",
                  "x-ms-summary": "Attachment File Name"
                },
                "icsText": {
                  "type": "string",
                  "x-ms-summary": "Raw ICS Content"
                },
                "icsBase64": {
                  "type": "string",
                  "x-ms-summary": "Base64 Content for Outlook"
                }
              }
            }
          }
        }
      }
    },
    "/api/pp/hmac": {
      "post": {
        "operationId": "ComputeWebhookHmac",
        "summary": "Sign payload or verify webhook HMAC-SHA256 signature",
        "description": "Computes HMAC-SHA256 or SHA-512 hex and Base64 digests and performs constant-time webhook signature verification.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "payload",
                "secret"
              ],
              "properties": {
                "payload": {
                  "type": "string",
                  "x-ms-summary": "Raw Request Body"
                },
                "secret": {
                  "type": "string",
                  "x-ms-summary": "Webhook Signing Secret"
                },
                "algorithm": {
                  "type": "string",
                  "enum": [
                    "SHA-256",
                    "SHA-512"
                  ],
                  "default": "SHA-256",
                  "x-ms-summary": "Hash Algorithm"
                },
                "providedSignature": {
                  "type": "string",
                  "x-ms-summary": "Incoming Header Signature to Verify"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "HMAC digest and verification result",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "signatureHex": {
                  "type": "string",
                  "x-ms-summary": "Hex Signature"
                },
                "signatureBase64": {
                  "type": "string",
                  "x-ms-summary": "Base64 Signature"
                },
                "verified": {
                  "type": "boolean",
                  "x-ms-summary": "Signature Verified"
                }
              }
            }
          }
        }
      }
    },
    "/api/pp/template-merge": {
      "post": {
        "operationId": "MergeDocumentTemplate",
        "summary": "Merge Word docx Base64 or Mustache template with JSON values",
        "description": "Replaces {{Key}} placeholders inside Microsoft Word .docx Base64 files in memory or renders Mustache templates with repeating loops.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "values"
              ],
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "mustache",
                    "docx"
                  ],
                  "default": "mustache",
                  "x-ms-summary": "Merge Mode (mustache or docx)"
                },
                "template": {
                  "type": "string",
                  "x-ms-summary": "Mustache Text or HTML Template"
                },
                "docxBase64": {
                  "type": "string",
                  "x-ms-summary": "Word .docx Base64 Content"
                },
                "values": {
                  "type": "object",
                  "x-ms-summary": "JSON Key-Value Data"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Merged document output",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "replacementsCount": {
                  "type": "integer",
                  "x-ms-summary": "Replacements Count"
                },
                "renderedText": {
                  "type": "string",
                  "x-ms-summary": "Merged Text or HTML"
                },
                "docxBase64": {
                  "type": "string",
                  "x-ms-summary": "Merged Word .docx Base64"
                }
              }
            }
          }
        }
      }
    },
    "/api/edge/amount-to-words": {
      "post": {
        "tags": [
          "Edge Finance & Security"
        ],
        "operationId": "ConvertAmountToWords",
        "summary": "Convert invoice amount to legal words in 9 languages",
        "description": "Converts numeric invoice or check totals into localized legal spell-out text across 9 languages (TR, EN, DE, FR, ES, IT, NL, PT, PL) including Turkish e-Fatura #Yalniz...# format.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "amount"
              ],
              "properties": {
                "amount": {
                  "type": "number",
                  "x-ms-summary": "Invoice Amount"
                },
                "currency": {
                  "type": "string",
                  "enum": [
                    "TRY",
                    "USD",
                    "EUR",
                    "GBP"
                  ],
                  "default": "TRY",
                  "x-ms-summary": "Currency Code"
                },
                "lang": {
                  "type": "string",
                  "enum": [
                    "tr",
                    "en",
                    "de",
                    "fr",
                    "es",
                    "it",
                    "nl",
                    "pt",
                    "pl"
                  ],
                  "default": "tr",
                  "x-ms-summary": "Language"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Legal amount in words",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "words": {
                      "type": "string",
                      "x-ms-summary": "Amount in Words"
                    },
                    "accountingCompact": {
                      "type": "string",
                      "x-ms-summary": "Check / e-Fatura Compact String"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/edge/json-diff": {
      "post": {
        "tags": [
          "Edge Finance & Security"
        ],
        "operationId": "DiffJsonRecordAudit",
        "summary": "Compare Before and After JSON records into HTML Audit Table",
        "description": "Computes field-level changes between two SharePoint or Dataverse JSON objects with automatic secret masking and Outlook-ready HTML table output.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "before",
                "after"
              ],
              "properties": {
                "before": {
                  "type": "object",
                  "x-ms-summary": "Before JSON Snapshot"
                },
                "after": {
                  "type": "object",
                  "x-ms-summary": "After JSON Snapshot"
                },
                "redactSecrets": {
                  "type": "boolean",
                  "default": true,
                  "x-ms-summary": "Mask Sensitive Keys"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Audit diff result",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "hasChanges": {
                      "type": "boolean"
                    },
                    "changedCount": {
                      "type": "integer"
                    },
                    "htmlAuditTable": {
                      "type": "string",
                      "x-ms-summary": "Inline HTML Audit Table"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/edge/totp": {
      "post": {
        "tags": [
          "Edge Finance & Security"
        ],
        "operationId": "ManageTotpAuthenticator",
        "summary": "Provision or verify RFC 6238 2FA Authenticator OTP",
        "description": "Generates Base32 TOTP secrets + Authenticator QR SVGs or verifies 6-digit OTP codes for high-value Power Apps approvals.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "provision",
                    "verify"
                  ],
                  "default": "provision",
                  "x-ms-summary": "Mode"
                },
                "secret": {
                  "type": "string",
                  "x-ms-summary": "Base32 Secret"
                },
                "token": {
                  "type": "string",
                  "x-ms-summary": "6-Digit OTP Token (Verify mode)"
                },
                "issuer": {
                  "type": "string",
                  "default": "Zetaleap",
                  "x-ms-summary": "Issuer Name"
                },
                "accountName": {
                  "type": "string",
                  "x-ms-summary": "Account Email"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "TOTP provisioning or verification result"
          }
        }
      }
    },
    "/api/edge/cron-schedule": {
      "post": {
        "tags": [
          "Edge Finance & Security"
        ],
        "operationId": "AnalyzeCronSchedule",
        "summary": "Explain 5-field Cron expression and calculate next runs",
        "description": "Validates Cron expressions, returns EN/TR human descriptions, and calculates upcoming ISO run timestamps.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "expression"
              ],
              "properties": {
                "expression": {
                  "type": "string",
                  "default": "30 9 * * 1-5",
                  "x-ms-summary": "5-Field Cron Expression"
                },
                "utcOffsetHours": {
                  "type": "integer",
                  "default": 3,
                  "x-ms-summary": "UTC Offset Hours"
                },
                "count": {
                  "type": "integer",
                  "default": 5,
                  "x-ms-summary": "Number of Upcoming Runs"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cron summary and upcoming runs"
          }
        }
      }
    },
    "/api/edge/jwt-odata": {
      "post": {
        "tags": [
          "Edge Finance & Security"
        ],
        "operationId": "BuildOdataOrInspectJwt",
        "summary": "Build safe SharePoint/Dataverse OData filter or inspect JWT claims",
        "description": "Escapes OData $filter expressions for SharePoint and Dataverse or safely decodes JWT payload claims and expiry.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "odata",
                    "jwt"
                  ],
                  "default": "odata"
                },
                "token": {
                  "type": "string",
                  "x-ms-summary": "JWT Token (jwt mode)"
                },
                "logicalJoin": {
                  "type": "string",
                  "enum": [
                    "and",
                    "or"
                  ],
                  "default": "and"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OData filter or decoded JWT claims"
          }
        }
      }
    },
    "/api/edge/smart-link": {
      "post": {
        "tags": [
          "Edge Finance & Security"
        ],
        "operationId": "BuildSmartCampaignLink",
        "summary": "Build WhatsApp, Teams chat or UTM link with QR SVG",
        "description": "Generates clickable WhatsApp Business (wa.me), Microsoft Teams direct chat, or UTM links plus scannable QR SVGs.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "channel": {
                  "type": "string",
                  "enum": [
                    "whatsapp",
                    "teams",
                    "utm"
                  ],
                  "default": "whatsapp"
                },
                "phone": {
                  "type": "string",
                  "x-ms-summary": "WhatsApp Phone (+CountryCode)"
                },
                "teamsUserEmail": {
                  "type": "string",
                  "x-ms-summary": "Teams User Email"
                },
                "targetUrl": {
                  "type": "string",
                  "x-ms-summary": "Target URL (UTM mode)"
                },
                "message": {
                  "type": "string",
                  "x-ms-summary": "Pre-filled Message"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generated deep link and QR Data URI"
          }
        }
      }
    },
    "/api/edge/payment-qr": {
      "post": {
        "tags": [
          "Edge Finance & Security"
        ],
        "operationId": "GeneratePaymentQrCard",
        "summary": "Generate SEPA EPC GiroCode or TR FAST IBAN Payment QR Card SVG",
        "description": "Validates ISO 13616 MOD-97 IBAN and generates bank-app-scannable EU SEPA EPC GiroCode, TR FAST/IBAN, or Payment Link QR SVGs and printable Payment Card SVGs.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "standard": {
                  "type": "string",
                  "enum": [
                    "sepa_epc",
                    "tr_fast",
                    "payment_url"
                  ],
                  "default": "sepa_epc",
                  "x-ms-summary": "Payment QR Standard"
                },
                "beneficiaryName": {
                  "type": "string",
                  "x-ms-summary": "Beneficiary Legal Name"
                },
                "iban": {
                  "type": "string",
                  "x-ms-summary": "Beneficiary IBAN (MOD-97 Checked)"
                },
                "bic": {
                  "type": "string",
                  "x-ms-summary": "Optional SWIFT / BIC Code"
                },
                "amount": {
                  "type": "number",
                  "x-ms-summary": "Payment Amount"
                },
                "currency": {
                  "type": "string",
                  "enum": [
                    "EUR",
                    "TRY",
                    "USD",
                    "GBP"
                  ],
                  "default": "EUR",
                  "x-ms-summary": "Currency Code"
                },
                "remittanceText": {
                  "type": "string",
                  "x-ms-summary": "Invoice / Remittance Reference"
                },
                "paymentUrl": {
                  "type": "string",
                  "x-ms-summary": "HTTPS Checkout Link (payment_url mode)"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "rawPayload, qrSvg, cardSvg, cardDataUri, and Outlook htmlImgTag"
          }
        }
      }
    },
    "/api/edge/fuzzy-match": {
      "post": {
        "tags": [
          "Edge Finance & Security"
        ],
        "operationId": "FuzzyMatchAndDeduplicateRecords",
        "summary": "Fuzzy match vendor/customer names or deduplicate JSON records",
        "description": "Normalizes Turkish/European diacritics and corporate legal suffixes (A.S., Ltd. Sti., GmbH, B.V., Inc.) and scores records via hybrid Jaro-Winkler + Token Jaccard similarity.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "match",
                    "deduplicate"
                  ],
                  "default": "match",
                  "x-ms-summary": "Operation Mode"
                },
                "query": {
                  "type": "string",
                  "x-ms-summary": "Target Vendor / Customer Name (match mode)"
                },
                "candidates": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  },
                  "x-ms-summary": "Candidate Records Array (match mode)"
                },
                "records": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  },
                  "x-ms-summary": "Records Array to Deduplicate"
                },
                "keyField": {
                  "type": "string",
                  "default": "name",
                  "x-ms-summary": "Field Name to Compare"
                },
                "threshold": {
                  "type": "number",
                  "default": 0.78,
                  "x-ms-summary": "Similarity Threshold (0.30-0.99)"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "bestMatch + ranked matches[] or uniqueRecords[] + duplicateClusters[]"
          }
        }
      }
    },
    "/api/studio/celebration": {
      "post": {
        "operationId": "RenderCelebrationCard",
        "summary": "Render animated celebration GIF PNG or SVG card",
        "description": "Generates a personalized celebration or recognition card (Birthday, Welcome Aboard, Work Anniversary, Promotion, Kudos, Deal Won, Release Shipped, Holiday) as Animated GIF, 2x PNG, or SVG.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "name"
              ],
              "properties": {
                "occasion": {
                  "type": "string",
                  "enum": [
                    "birthday",
                    "welcome",
                    "anniversary",
                    "promotion",
                    "kudos",
                    "deal_won",
                    "ship_it",
                    "holiday"
                  ],
                  "default": "birthday",
                  "x-ms-summary": "Occasion Template"
                },
                "theme": {
                  "type": "string",
                  "enum": [
                    "confetti_light",
                    "midnight_neon",
                    "golden_executive",
                    "emerald_aurora"
                  ],
                  "default": "confetti_light",
                  "x-ms-summary": "Color Theme"
                },
                "lang": {
                  "type": "string",
                  "enum": [
                    "en",
                    "tr",
                    "de",
                    "fr",
                    "es",
                    "it",
                    "nl",
                    "pt",
                    "pl",
                    "ja"
                  ],
                  "default": "en",
                  "x-ms-summary": "Country / Card Language (10 Locales)"
                },
                "format": {
                  "type": "string",
                  "enum": [
                    "gif",
                    "png",
                    "svg"
                  ],
                  "default": "gif",
                  "x-ms-summary": "Output Format"
                },
                "name": {
                  "type": "string",
                  "x-ms-summary": "Recipient Name"
                },
                "roleOrDept": {
                  "type": "string",
                  "x-ms-summary": "Role or Department"
                },
                "badgeText": {
                  "type": "string",
                  "x-ms-summary": "Milestone Badge Text"
                },
                "message": {
                  "type": "string",
                  "x-ms-summary": "Custom Greeting Message"
                },
                "companyName": {
                  "type": "string",
                  "x-ms-summary": "Company Name"
                },
                "senderName": {
                  "type": "string",
                  "x-ms-summary": "Sender Name"
                },
                "avatarBase64": {
                  "type": "string",
                  "x-ms-summary": "Recipient Photo Base64"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rendered celebration card output",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "format": {
                  "type": "string",
                  "x-ms-summary": "Format"
                },
                "mimeType": {
                  "type": "string",
                  "x-ms-summary": "MIME Type"
                },
                "base64": {
                  "type": "string",
                  "x-ms-summary": "Image Base64 ContentBytes"
                },
                "dataUri": {
                  "type": "string",
                  "x-ms-summary": "Embeddable Data URI"
                }
              }
            }
          }
        }
      }
    },
    "/api/studio/html-to-pdf": {
      "post": {
        "operationId": "RenderHtmlToPdf",
        "summary": "Convert HTML and CSS into print ready A4 or Letter PDF",
        "description": "Renders HTML invoices, certificates, and reports into pixel-perfect PDF documents.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "html"
              ],
              "properties": {
                "html": {
                  "type": "string",
                  "x-ms-summary": "HTML Document Content"
                },
                "css": {
                  "type": "string",
                  "x-ms-summary": "Optional CSS Stylesheet"
                },
                "pageFormat": {
                  "type": "string",
                  "enum": [
                    "A4",
                    "Letter"
                  ],
                  "default": "A4",
                  "x-ms-summary": "Paper Format"
                },
                "landscape": {
                  "type": "boolean",
                  "default": false,
                  "x-ms-summary": "Landscape Orientation"
                },
                "marginMm": {
                  "type": "integer",
                  "default": 14,
                  "x-ms-summary": "Page Margin (mm)"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generated PDF document",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "pageCount": {
                  "type": "integer",
                  "x-ms-summary": "Page Count"
                },
                "byteSize": {
                  "type": "integer",
                  "x-ms-summary": "Byte Size"
                },
                "pdfBase64": {
                  "type": "string",
                  "x-ms-summary": "PDF Base64 ContentBytes"
                },
                "dataUri": {
                  "type": "string",
                  "x-ms-summary": "PDF Data URI"
                }
              }
            }
          }
        }
      }
    },
    "/api/studio/pdf-tools": {
      "post": {
        "operationId": "ProcessPdfDocument",
        "summary": "Merge PDFs stamp diagonal watermark or extract pages",
        "description": "Merges multiple Base64 PDFs, applies diagonal security watermarks with page numbers, or extracts page ranges.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "operation"
              ],
              "properties": {
                "operation": {
                  "type": "string",
                  "enum": [
                    "merge",
                    "watermark",
                    "extract"
                  ],
                  "x-ms-summary": "PDF Operation"
                },
                "pdfBase64": {
                  "type": "string",
                  "x-ms-summary": "Source PDF Base64"
                },
                "pdfsBase64": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "x-ms-summary": "PDFs Array (for merge)"
                },
                "watermarkText": {
                  "type": "string",
                  "x-ms-summary": "Diagonal Watermark Text"
                },
                "addPageNumbers": {
                  "type": "boolean",
                  "default": true,
                  "x-ms-summary": "Add Footer Page Numbers"
                },
                "pages": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  },
                  "x-ms-summary": "1-Based Page Numbers (for extract)"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Processed PDF document",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "pageCount": {
                  "type": "integer",
                  "x-ms-summary": "Page Count"
                },
                "pdfBase64": {
                  "type": "string",
                  "x-ms-summary": "Processed PDF Base64"
                }
              }
            }
          }
        }
      }
    },
    "/api/studio/email-signature": {
      "post": {
        "operationId": "GenerateEmailSignature",
        "summary": "Generate Outlook HTML email signature and QR vCard",
        "description": "Builds an Outlook-compatible HTML email signature, RFC-6350 .vcf contact file, and QR vCard SVG.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "fullName"
              ],
              "properties": {
                "fullName": {
                  "type": "string",
                  "x-ms-summary": "Employee Full Name"
                },
                "jobTitle": {
                  "type": "string",
                  "x-ms-summary": "Job Title"
                },
                "department": {
                  "type": "string",
                  "x-ms-summary": "Department"
                },
                "companyName": {
                  "type": "string",
                  "x-ms-summary": "Company Name"
                },
                "email": {
                  "type": "string",
                  "x-ms-summary": "Work Email"
                },
                "phone": {
                  "type": "string",
                  "x-ms-summary": "Work Phone"
                },
                "website": {
                  "type": "string",
                  "x-ms-summary": "Company Website"
                },
                "brandColor": {
                  "type": "string",
                  "default": "#0067b8",
                  "x-ms-summary": "Brand Hex Color"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generated signature and vCard",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "htmlSignature": {
                      "type": "string",
                      "x-ms-summary": "Outlook HTML Signature"
                    },
                    "vcardBase64": {
                      "type": "string",
                      "x-ms-summary": "vCard .vcf Base64"
                    },
                    "qrSvgDataUri": {
                      "type": "string",
                      "x-ms-summary": "QR vCard SVG Data URI"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/studio/banner-svg": {
      "post": {
        "operationId": "GenerateProgressBannerSvg",
        "summary": "Generate goal or SLA progress bar SVG banner",
        "description": "Renders a lightweight SVG progress thermometer banner for Power Apps, SharePoint, or reports.",
        "x-ms-visibility": "advanced",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "title",
                "currentValue",
                "targetValue"
              ],
              "properties": {
                "title": {
                  "type": "string",
                  "x-ms-summary": "Banner Title"
                },
                "currentValue": {
                  "type": "number",
                  "x-ms-summary": "Current Value"
                },
                "targetValue": {
                  "type": "number",
                  "x-ms-summary": "Target Value"
                },
                "unit": {
                  "type": "string",
                  "x-ms-summary": "Unit Label"
                },
                "accentColor": {
                  "type": "string",
                  "default": "#0078d4",
                  "x-ms-summary": "Accent Hex Color"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generated progress banner SVG",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "svg": {
                      "type": "string",
                      "x-ms-summary": "Raw SVG Markup"
                    },
                    "dataUri": {
                      "type": "string",
                      "x-ms-summary": "SVG Data URI"
                    },
                    "percent": {
                      "type": "number",
                      "x-ms-summary": "Calculated Percentage"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/studio/office-to-pdf": {
      "post": {
        "operationId": "ConvertOfficeToPdf",
        "summary": "Convert Word docx Excel xlsx or PowerPoint pptx to PDF",
        "description": "Converts OpenXML Office documents (.docx, .xlsx, .pptx) into print-ready PDFs via Zetaleap Document Engine (supports ?async=true HTTP 202 polling).",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "fileBase64",
                "fileName"
              ],
              "properties": {
                "fileName": {
                  "type": "string",
                  "default": "document.docx",
                  "x-ms-summary": "Source Filename (.docx/.xlsx/.pptx)"
                },
                "fileBase64": {
                  "type": "string",
                  "x-ms-summary": "Office File Base64 ContentBytes"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Converted PDF Base64 and page count"
          }
        }
      }
    },
    "/api/studio/pdf-security": {
      "post": {
        "operationId": "ProtectOrUnlockPdf",
        "summary": "Encrypt PDF with AES-256 password or unlock PDF",
        "description": "Protects PDF documents with 256-bit AES user/owner passwords via Zetaleap PDF Security Engine or unlocks password-protected PDFs.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "pdfBase64",
                "password"
              ],
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "protect",
                    "unlock"
                  ],
                  "default": "protect",
                  "x-ms-summary": "Security Mode"
                },
                "pdfBase64": {
                  "type": "string",
                  "x-ms-summary": "Source PDF Base64"
                },
                "password": {
                  "type": "string",
                  "x-ms-summary": "User Password"
                },
                "ownerPassword": {
                  "type": "string",
                  "x-ms-summary": "Optional Owner Password"
                },
                "allowPrint": {
                  "type": "boolean",
                  "default": true,
                  "x-ms-summary": "Allow Printing"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Encrypted or unlocked PDF Base64"
          }
        }
      }
    },
    "/api/studio/pdf-compress": {
      "post": {
        "operationId": "CompressPdfDocument",
        "summary": "Compress oversized PDF via high-ratio preset",
        "description": "Shrinks heavy or scanned PDF files using Zetaleap compression presets (screen 72dpi, ebook 150dpi, printer 300dpi).",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "pdfBase64"
              ],
              "properties": {
                "pdfBase64": {
                  "type": "string",
                  "x-ms-summary": "Source PDF Base64"
                },
                "preset": {
                  "type": "string",
                  "enum": [
                    "screen",
                    "ebook",
                    "printer"
                  ],
                  "default": "ebook",
                  "x-ms-summary": "Compression Quality Preset"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Compressed PDF Base64 and size reduction metrics"
          }
        }
      }
    },
    "/api/studio/pdf-images": {
      "post": {
        "operationId": "ConvertPdfAndImages",
        "summary": "Convert PDF pages to PNG/JPEG images or stitch images to PDF",
        "description": "Renders PDF pages to high-DPI PNG/JPEG images or combines multiple Base64 receipt/camera images into a single A4 PDF.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "pdf_to_images",
                    "images_to_pdf"
                  ],
                  "default": "pdf_to_images",
                  "x-ms-summary": "Conversion Mode"
                },
                "pdfBase64": {
                  "type": "string",
                  "x-ms-summary": "Source PDF Base64 (pdf_to_images)"
                },
                "format": {
                  "type": "string",
                  "enum": [
                    "png",
                    "jpeg"
                  ],
                  "default": "png",
                  "x-ms-summary": "Image Format"
                },
                "dpi": {
                  "type": "integer",
                  "default": 150,
                  "x-ms-summary": "Render DPI (72-300)"
                },
                "imagesBase64": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "x-ms-summary": "Images Base64 Array (images_to_pdf)"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rendered images[] or stitched pdfBase64"
          }
        }
      }
    },
    "/api/studio/pdf-stamp": {
      "post": {
        "operationId": "StampCorporateSealOnPdf",
        "summary": "Stamp corporate approval seal or PNG stamp onto PDF pages",
        "description": "Applies a crisp vector corporate approval badge or custom PNG stamp onto PDF corners.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "pdfBase64"
              ],
              "properties": {
                "pdfBase64": {
                  "type": "string",
                  "x-ms-summary": "Source PDF Base64"
                },
                "sealTitle": {
                  "type": "string",
                  "default": "APPROVED",
                  "x-ms-summary": "Seal Heading"
                },
                "sealSubtitle": {
                  "type": "string",
                  "x-ms-summary": "Approver / Department Subtitle"
                },
                "sealColor": {
                  "type": "string",
                  "default": "#059669",
                  "x-ms-summary": "Seal Hex Color"
                },
                "position": {
                  "type": "string",
                  "enum": [
                    "bottom-right",
                    "bottom-left",
                    "top-right",
                    "top-left",
                    "center"
                  ],
                  "default": "bottom-right"
                },
                "stampImageBase64": {
                  "type": "string",
                  "x-ms-summary": "Optional Custom PNG Stamp Base64"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Stamped PDF Base64"
          }
        }
      }
    },
    "/api/studio/pdf-form": {
      "post": {
        "operationId": "InspectOrFillPdfAcroForm",
        "summary": "Inspect fillable PDF AcroForm fields or auto-fill and flatten",
        "description": "Lists field names/types inside a fillable AcroForm PDF or populates form fields from JSON and flattens the document.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "pdfBase64"
              ],
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "inspect",
                    "fill"
                  ],
                  "default": "inspect",
                  "x-ms-summary": "Form Mode"
                },
                "pdfBase64": {
                  "type": "string",
                  "x-ms-summary": "Fillable PDF Base64"
                },
                "fields": {
                  "type": "object",
                  "x-ms-summary": "Field Key-Value Map (fill mode)"
                },
                "flatten": {
                  "type": "boolean",
                  "default": true,
                  "x-ms-summary": "Flatten Form Fields"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Inspected fields[] or filled/flattened PDF Base64"
          }
        }
      }
    },
    "/api/studio/pptx-merge": {
      "post": {
        "operationId": "MergePowerPointTemplate",
        "summary": "Populate PowerPoint pptx {{Tag}} slides and export PPTX or PDF",
        "description": "Replaces {{Key}} placeholders across PowerPoint slides and returns either the populated .pptx or a converted PDF deck.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "pptxBase64",
                "values"
              ],
              "properties": {
                "pptxBase64": {
                  "type": "string",
                  "x-ms-summary": "Template .pptx Base64"
                },
                "values": {
                  "type": "object",
                  "x-ms-summary": "Slide {{Tag}} Key-Value Map"
                },
                "outputFormat": {
                  "type": "string",
                  "enum": [
                    "pptx",
                    "pdf"
                  ],
                  "default": "pdf",
                  "x-ms-summary": "Output Format"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Populated pptxBase64 or converted pdfBase64"
          }
        }
      }
    },
    "/api/studio/image-tools": {
      "post": {
        "operationId": "ProcessConvertOrStripImage",
        "summary": "Resize image convert to WebP/JPEG/PNG watermark and strip EXIF GPS",
        "description": "Processes images on Zetaleap Image Studio: resizes dimensions, converts to WebP/JPEG/PNG, applies optional text watermark, and strips GDPR/KVKK EXIF/GPS metadata.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "imageBase64"
              ],
              "properties": {
                "imageBase64": {
                  "type": "string",
                  "x-ms-summary": "Source Image Base64"
                },
                "outputFormat": {
                  "type": "string",
                  "enum": [
                    "webp",
                    "jpeg",
                    "png"
                  ],
                  "default": "webp",
                  "x-ms-summary": "Target Image Format"
                },
                "width": {
                  "type": "integer",
                  "x-ms-summary": "Target Max Width (px)"
                },
                "height": {
                  "type": "integer",
                  "x-ms-summary": "Target Max Height (px)"
                },
                "quality": {
                  "type": "integer",
                  "default": 82,
                  "x-ms-summary": "Compression Quality (20-100)"
                },
                "stripExif": {
                  "type": "boolean",
                  "default": true,
                  "x-ms-summary": "Strip EXIF / GPS Metadata"
                },
                "watermarkText": {
                  "type": "string",
                  "x-ms-summary": "Optional Watermark Label"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Processed imageBase64, dimensions, and byte savings"
          }
        }
      }
    },
    "/api/studio/scan-ocr": {
      "post": {
        "operationId": "ScanThreatAndExtractOcr",
        "summary": "Scan uploaded file for threats/macros and extract multilingual OCR text",
        "description": "Performs binary magic-byte spoofing, VBA macro, PDF JS, and EICAR threat inspection plus multilingual (eng, tur, deu, eng+tur) neural OCR text extraction.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "fileBase64"
              ],
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "scan_and_ocr",
                    "scan_only",
                    "ocr_only"
                  ],
                  "default": "scan_and_ocr",
                  "x-ms-summary": "Operation Mode"
                },
                "fileName": {
                  "type": "string",
                  "default": "upload.png",
                  "x-ms-summary": "Uploaded File Name"
                },
                "fileBase64": {
                  "type": "string",
                  "x-ms-summary": "File Base64 ContentBytes"
                },
                "lang": {
                  "type": "string",
                  "enum": [
                    "eng+tur",
                    "eng",
                    "tur",
                    "deu"
                  ],
                  "default": "eng+tur",
                  "x-ms-summary": "OCR Language"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Threat scan verdict (safe, findings[]) and OCR text/confidence"
          }
        }
      }
    },
    "/api/jobs/{jobId}": {
      "get": {
        "operationId": "GetAsyncRenderJob",
        "summary": "Poll Asynchronous Render Job Status (HTTP 202 / 200)",
        "description": "Polls an asynchronous Celebration GIF or HTML-to-PDF render job created with ?async=true (HTTP 202 Accepted). Returns 202 while queued/running and 200 OK with Base64 output when completed.",
        "x-ms-visibility": "advanced",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "type": "string",
            "x-ms-summary": "Async Job ID (zljob_...)"
          }
        ],
        "responses": {
          "200": {
            "description": "Completed render job result"
          },
          "202": {
            "description": "Job still queued or running (Retry-After)"
          }
        }
      }
    },
    "/api/tools/convert": {
      "post": {
        "tags": [
          "AI Formatter"
        ],
        "operationId": "ConvertFormat",
        "summary": "Convert Markdown to HTML or HTML to Markdown",
        "description": "Converts LLM/AI Markdown output (ChatGPT, Azure OpenAI, Claude, Copilot) into sanitized HTML for Outlook/Teams/PDFs, or converts HTML into clean Markdown.",
        "x-ms-visibility": "important",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "x-ms-summary": "Conversion Payload",
            "schema": {
              "type": "object",
              "required": [
                "mode",
                "text"
              ],
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "md2html",
                    "html2md"
                  ],
                  "default": "md2html",
                  "x-ms-summary": "Conversion Mode",
                  "description": "Select md2html (Markdown to HTML) or html2md (HTML to Markdown)."
                },
                "text": {
                  "type": "string",
                  "x-ms-summary": "Input Content (Max 100KB)",
                  "description": "Raw Markdown or HTML string to transform."
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Converted content returned successfully",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "result": {
                  "type": "string",
                  "x-ms-summary": "Converted Output",
                  "description": "Clean HTML or Markdown string ready for Outlook, Teams, or Dataverse."
                }
              }
            }
          }
        }
      }
    },
    "/api/sftp/companies": {
      "get": {
        "tags": [
          "SFTP Gateway"
        ],
        "operationId": "ListSftpProfiles",
        "summary": "List saved SFTP and FTP connection profiles",
        "description": "Returns all saved SFTP/FTP server connection profiles accessible by the authenticated token.",
        "x-ms-visibility": "important",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "List of saved SFTP connection profiles",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "companies": {
                  "type": "array",
                  "x-ms-summary": "Connection Profiles",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "x-ms-summary": "Connection ID"
                      },
                      "display_name": {
                        "type": "string",
                        "x-ms-summary": "Display Name"
                      },
                      "protocol": {
                        "type": "string",
                        "x-ms-summary": "Protocol (sftp/ftp)"
                      },
                      "host": {
                        "type": "string",
                        "x-ms-summary": "Server Hostname"
                      },
                      "port": {
                        "type": "integer",
                        "format": "int32",
                        "x-ms-summary": "Port"
                      },
                      "username": {
                        "type": "string",
                        "x-ms-summary": "SSH/FTP Username"
                      },
                      "root_path": {
                        "type": "string",
                        "x-ms-summary": "Default Root Path"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/sftp/{companyId}": {
      "get": {
        "tags": [
          "SFTP Gateway"
        ],
        "operationId": "ListSftpDirectory",
        "summary": "List files in remote SFTP or FTP folder",
        "description": "Connects over SSH Private Key (PEM) or password via Zetaleap Gateway and lists files and folders in the target remote directory without Power Automate timeout errors.",
        "x-ms-visibility": "important",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "companyId",
            "in": "path",
            "type": "string",
            "required": true,
            "x-ms-summary": "Connection Profile ID",
            "description": "Saved connection slug (e.g. rebex or erp-prod)."
          },
          {
            "name": "path",
            "in": "query",
            "type": "string",
            "required": false,
            "default": "/",
            "x-ms-summary": "Remote Directory Path",
            "description": "Remote SFTP folder path to list (default: /)."
          }
        ],
        "responses": {
          "200": {
            "description": "Remote directory contents",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "target_path": {
                  "type": "string",
                  "x-ms-summary": "Resolved Remote Path"
                },
                "target_dir_files": {
                  "type": "array",
                  "x-ms-summary": "Remote Files and Folders",
                  "items": {
                    "type": "object",
                    "properties": {
                      "filename": {
                        "type": "string",
                        "x-ms-summary": "File or Folder Name"
                      },
                      "is_directory": {
                        "type": "boolean",
                        "x-ms-summary": "Is Directory"
                      },
                      "size": {
                        "type": "integer",
                        "format": "int64",
                        "x-ms-summary": "Size in Bytes"
                      },
                      "modified_time": {
                        "type": "string",
                        "x-ms-summary": "Last Modified ISO Date"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/sftp/{companyId}/download": {
      "get": {
        "tags": [
          "SFTP Gateway"
        ],
        "operationId": "DownloadSftpFile",
        "summary": "Download file from remote SFTP or FTP server",
        "description": "Streams a binary or text file directly from the remote SFTP/FTP server into Power Automate.",
        "x-ms-visibility": "important",
        "produces": [
          "application/octet-stream"
        ],
        "parameters": [
          {
            "name": "companyId",
            "in": "path",
            "type": "string",
            "required": true,
            "x-ms-summary": "Connection Profile ID",
            "description": "Saved connection slug (e.g. rebex or erp-prod)."
          },
          {
            "name": "file",
            "in": "query",
            "type": "string",
            "required": true,
            "x-ms-summary": "Remote File Path",
            "description": "Full remote file path to download (e.g. /outbound/readme.txt)."
          }
        ],
        "responses": {
          "200": {
            "description": "File binary stream",
            "schema": {
              "type": "string",
              "format": "binary"
            }
          }
        }
      }
    },
    "/api/sftp/vault/files": {
      "get": {
        "tags": [
          "SFTP Gateway"
        ],
        "operationId": "ListSftpVaultFiles",
        "summary": "List synced SFTP files in Zetaleap Storage Vault",
        "description": "Lists files archived into Zetaleap Storage Vault by automated SFTP sync schedules.",
        "x-ms-visibility": "advanced",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Archived vault files",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "files": {
                  "type": "array",
                  "x-ms-summary": "Vault Files",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string",
                        "x-ms-summary": "Storage Object Key"
                      },
                      "filename": {
                        "type": "string",
                        "x-ms-summary": "File Name"
                      },
                      "connection_id": {
                        "type": "string",
                        "x-ms-summary": "Source Connection ID"
                      },
                      "size": {
                        "type": "integer",
                        "format": "int64",
                        "x-ms-summary": "File Size (Bytes)"
                      },
                      "uploaded": {
                        "type": "string",
                        "x-ms-summary": "Uploaded Timestamp"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/rates": {
      "get": {
        "tags": [
          "Currency FX"
        ],
        "operationId": "GetExchangeRates",
        "summary": "Get real-time currency exchange rates",
        "description": "Returns live foreign exchange rates for 150+ ISO 4217 world currencies relative to the selected base currency.",
        "x-ms-visibility": "important",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "base",
            "in": "query",
            "type": "string",
            "required": false,
            "default": "USD",
            "x-ms-summary": "Base Currency (ISO 4217)",
            "description": "Three-letter base currency code such as USD, EUR, GBP, or TRY."
          },
          {
            "name": "targets",
            "in": "query",
            "type": "string",
            "required": false,
            "x-ms-summary": "Target Currencies (Comma-Separated)",
            "description": "Optional comma-separated ISO codes (e.g. EUR,GBP,TRY,CHF,JPY,CAD). Leave empty for all 150+ currencies."
          }
        ],
        "responses": {
          "200": {
            "description": "Exchange rates payload",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "base": {
                  "type": "string",
                  "x-ms-summary": "Base Currency"
                },
                "last_updated": {
                  "type": "string",
                  "x-ms-summary": "Last Updated Timestamp"
                },
                "rates": {
                  "type": "object",
                  "x-ms-summary": "Currency Rates Map",
                  "properties": {
                    "USD": {
                      "type": "number",
                      "format": "double",
                      "x-ms-summary": "USD Rate"
                    },
                    "EUR": {
                      "type": "number",
                      "format": "double",
                      "x-ms-summary": "EUR Rate"
                    },
                    "GBP": {
                      "type": "number",
                      "format": "double",
                      "x-ms-summary": "GBP Rate"
                    },
                    "TRY": {
                      "type": "number",
                      "format": "double",
                      "x-ms-summary": "TRY Rate"
                    },
                    "CHF": {
                      "type": "number",
                      "format": "double",
                      "x-ms-summary": "CHF Rate"
                    },
                    "JPY": {
                      "type": "number",
                      "format": "double",
                      "x-ms-summary": "JPY Rate"
                    },
                    "CAD": {
                      "type": "number",
                      "format": "double",
                      "x-ms-summary": "CAD Rate"
                    },
                    "AUD": {
                      "type": "number",
                      "format": "double",
                      "x-ms-summary": "AUD Rate"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/validate-url": {
      "post": {
        "tags": [
          "URL Validator"
        ],
        "operationId": "ValidateUrl",
        "summary": "Validate URL reachability and redirects",
        "description": "Checks URL syntax, live HTTP reachability (with 3-second timeout protection), HTTP status code, and final redirect URL.",
        "x-ms-visibility": "important",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "x-ms-summary": "URL Validation Request",
            "schema": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "x-ms-summary": "Target URL",
                  "description": "Full HTTP or HTTPS URL to inspect (e.g. https://microsoft.com)."
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validation result returned cleanly",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "isValidSyntax": {
                  "type": "boolean",
                  "x-ms-summary": "Valid URL Syntax"
                },
                "isReachable": {
                  "type": "boolean",
                  "x-ms-summary": "Is Reachable Online"
                },
                "statusCode": {
                  "type": "integer",
                  "format": "int32",
                  "x-ms-summary": "HTTP Status Code"
                },
                "isRedirected": {
                  "type": "boolean",
                  "x-ms-summary": "Was Redirected"
                },
                "finalUrl": {
                  "type": "string",
                  "x-ms-summary": "Final Destination URL"
                },
                "domain": {
                  "type": "string",
                  "x-ms-summary": "Hostname Domain"
                }
              }
            }
          }
        }
      }
    },
    "/api/shorten": {
      "post": {
        "tags": [
          "URL Shortener"
        ],
        "operationId": "CreateShortUrl",
        "summary": "Create a short link with click tracking",
        "description": "Shortens a long destination URL with an optional custom alias and campaign title.",
        "x-ms-visibility": "important",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "x-ms-summary": "Short Link Request",
            "schema": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "x-ms-summary": "Destination Long URL",
                  "description": "Full destination URL starting with https:// or http://."
                },
                "custom_code": {
                  "type": "string",
                  "x-ms-summary": "Custom Alias (Optional)",
                  "description": "Optional custom slug (3 to 32 alphanumeric/hyphen characters)."
                },
                "title": {
                  "type": "string",
                  "x-ms-summary": "Link Title (Optional)",
                  "description": "Optional friendly campaign or document label."
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Created short link",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "code": {
                  "type": "string",
                  "x-ms-summary": "Short Code"
                },
                "short_url": {
                  "type": "string",
                  "x-ms-summary": "Full Short URL"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "URL Shortener"
        ],
        "operationId": "ListShortUrls",
        "summary": "List created short links and click counts",
        "description": "Retrieves paginated short links and live click metrics for the authenticated account.",
        "x-ms-visibility": "advanced",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "type": "integer",
            "format": "int32",
            "default": 1,
            "required": false,
            "x-ms-summary": "Page Number"
          },
          {
            "name": "limit",
            "in": "query",
            "type": "integer",
            "format": "int32",
            "default": 20,
            "required": false,
            "x-ms-summary": "Items Per Page"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated short links list",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "total": {
                  "type": "integer",
                  "format": "int32",
                  "x-ms-summary": "Total Links"
                }
              }
            }
          }
        }
      }
    },
    "/api/drive/items": {
      "get": {
        "tags": [
          "Cloud Drive"
        ],
        "operationId": "ListDriveItems",
        "summary": "List folders and files in Zetaleap Drive",
        "description": "Lists folders and stored files inside Zetaleap Drive Cloud Vault.",
        "x-ms-visibility": "important",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "folderId",
            "in": "query",
            "type": "string",
            "required": false,
            "x-ms-summary": "Parent Folder ID (Optional)",
            "description": "Leave empty to list root Drive items, or pass a folder ID."
          }
        ],
        "responses": {
          "200": {
            "description": "Drive folders and files",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "folders": {
                  "type": "array",
                  "x-ms-summary": "Folders",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "format": "int32",
                        "x-ms-summary": "Folder ID"
                      },
                      "name": {
                        "type": "string",
                        "x-ms-summary": "Folder Name"
                      }
                    }
                  }
                },
                "files": {
                  "type": "array",
                  "x-ms-summary": "Files",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "format": "int32",
                        "x-ms-summary": "File ID"
                      },
                      "name": {
                        "type": "string",
                        "x-ms-summary": "File Name"
                      },
                      "mime_type": {
                        "type": "string",
                        "x-ms-summary": "MIME Type"
                      },
                      "size_bytes": {
                        "type": "integer",
                        "format": "int64",
                        "x-ms-summary": "Size in Bytes"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/drive/folders": {
      "post": {
        "tags": [
          "Cloud Drive"
        ],
        "operationId": "CreateDriveFolder",
        "summary": "Create a folder in Zetaleap Drive",
        "description": "Creates a new organized folder inside Zetaleap Drive Cloud Vault.",
        "x-ms-visibility": "important",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "x-ms-summary": "New Folder Details",
            "schema": {
              "type": "object",
              "required": [
                "name"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "x-ms-summary": "Folder Name"
                },
                "color": {
                  "type": "string",
                  "default": "#3b82f6",
                  "x-ms-summary": "Folder Hex Color"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Created folder response",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                }
              }
            }
          }
        }
      }
    }
  }
}