{
  "swagger": "2.0",
  "info": {
    "title": "Zetaleap PDF & OCR Suite",
    "description": "14 enterprise document & media actions (with HTTP 202 async polling): convert Word/Excel/PPTX & HTML to print-ready PDF, AES-256 password protect/unlock, high-ratio PDF compress, PDF<->Images, corporate seal stamping, AcroForm inspect/fill, PPTX merge, WebP/EXIF strip, file threat scan + multilingual OCR, and Outlook QR signatures.",
    "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;Content and Files"
    }
  ],
  "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/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)"
          }
        }
      }
    }
  }
}