API Docs

    Generate images/PDFs and run PDF tools (merge, split, compress, lock/unlock, parse, watermark) via simple JSON requests—use it from no-code tools (n8n, Make, Zapier, Pipedream) or your own app.

    Overview

    Call endpoints with JSON + an API key.

    All endpoints require the CLIENT-API-KEY header. Most endpoints accept a url (and sometimes html) and return an output url you can download or embed.

    Authentication

    Auto-load your API key (when signed in).

    Header: CLIENT-API-KEY
    Tip: keep keys server-side; don't ship them in client code.

    HTML/URL → Image

    Create a PNG from a URL or raw HTML. Best for thumbnails, social cards, and screenshots.

    POST
    /v1/generateImage
    Use cases
    • Generate OG images for SEO/social sharing
    • Create thumbnails for HTML reports or landing pages
    • Render HTML templates into images for notifications
    Attributes
    NameTypeRequiredDescription
    CLIENT-API-KEYstring
    Yes
    API key used for authentication.
    Location: header
    urlstring (uri)No
    Public URL to capture. Provide either `url` or `html_content` (not both).
    Example: https://example.com
    Location: body
    html_contentstringNo
    Raw HTML to render. Provide either `url` or `html_content` (not both).
    Example: <div style='padding:24px'><h1>Hello</h1></div>
    Location: body
    css_contentstringNo
    Optional CSS to apply to `html_content`.
    Example: body { font-family: Inter; }
    Location: body
    output_formatstringNo
    Output mode. Common values: `url`, `base64`, `both`.
    Example: url
    Location: body
    widthintegerNo
    Output image width in pixels.
    Example: 1280
    Location: body
    heightintegerNo
    Output image height in pixels.
    Example: 720
    Location: body
    qualityinteger (30..100)No
    Compression quality for output modes that support it.
    Example: 90
    Location: body
    full_pagebooleanNo
    If true, captures the full page (URL mode only).
    Example: false
    Location: body
    wait_tillintegerNo
    Wait time in seconds before capturing (helps with animations/data loading).
    Example: 2
    Location: body
    wait_untilstringNo
    Navigation ready state for URLs: `load`, `domcontentloaded`, `networkidle`.
    Example: networkidle
    Location: body
    fontstringNo
    Google Font name(s) to include, separated with `|` for multiple.
    Example: Poppins|Montserrat
    Location: body
    dynamic_paramsobjectNo
    Key/value replacements for templated HTML (e.g., {{name}}).
    Example: {"name":"Alice"}
    Location: body
    Example Payload
    Code Samples
    Example Response

    HTML/URL → PDF

    Create a PDF from a URL or raw HTML. Best for invoices, reports, and printable documents.

    POST
    /v1/generatePdf
    Use cases
    • Generate invoices and receipts
    • Create printable reports from dashboards
    • Produce shipping labels and forms
    Attributes
    NameTypeRequiredDescription
    CLIENT-API-KEYstring
    Yes
    API key used for authentication.
    Location: header
    urlstring (uri)No
    Public URL to convert. Provide either `url` or `html_content` (not both).
    Example: https://example.com
    Location: body
    html_contentstringNo
    Raw HTML to convert. Provide either `url` or `html_content` (not both).
    Example: <html><body><h1>Invoice</h1></body></html>
    Location: body
    css_contentstringNo
    Optional CSS to apply to `html_content`.
    Example: body { font-family: Arial; }
    Location: body
    output_formatstringNo
    Output mode. Common values: `url` (hosted), `pdf`/`file` (binary response).
    Example: url
    Location: body
    paper_sizestringNo
    Paper size preset (A4, Letter, Legal, etc.).
    Example: A4
    Location: body
    landscapebooleanNo
    Render in landscape orientation.
    Example: false
    Location: body
    printBackgroundbooleanNo
    Include background graphics. Usually `true` for branded PDFs.
    Example: true
    Location: body
    preferCSSPageSizebooleanNo
    Prefer @page size from CSS. Useful for pixel-perfect templates.
    Example: true
    Location: body
    viewPortWidthintegerNo
    Viewport width used when rendering.
    Example: 1920
    Location: body
    viewPortHeightintegerNo
    Viewport height used when rendering.
    Example: 1080
    Location: body
    wait_tillintegerNo
    Wait time in seconds before generating the PDF.
    Example: 2
    Location: body
    dynamic_paramsobjectNo
    Key/value replacements for templated HTML (e.g., {{invoice_id}}).
    Example: {"invoice_id":"INV-1001"}
    Location: body
    Example Payload
    Code Samples
    Example Response

    Merge PDFs

    Merge multiple PDFs into one.

    POST
    /v1/pdf/merge
    Use cases
    • Combine invoices into one statement
    • Merge a cover page with generated pages
    • Create a single archive PDF
    Attributes
    NameTypeRequiredDescription
    CLIENT-API-KEYstring
    Yes
    API key used for authentication.
    Location: header
    urlsstring[] (uri)No
    Array of PDF URLs to merge (2..15).
    Example: ["https://.../doc1.pdf","https://.../doc2.pdf"]
    Location: body
    filesstring[] (base64)No
    Alternative to `urls`: base64-encoded PDFs to merge.
    Example: ["JVBERi0xLjc...","JVBERi0xLjc..."]
    Location: body
    outputstringNo
    Return mode: `url`, `file`, or `base64`.
    Example: url
    Location: body
    Example Payload
    Code Samples
    Example Response

    Split / Extract Pages

    Split a PDF into parts or extract a page range.

    POST
    /v1/pdf/split
    Use cases
    • Extract only the signature page
    • Split large PDFs per section
    • Create per-customer statements from a batch
    Attributes
    NameTypeRequiredDescription
    CLIENT-API-KEYstring
    Yes
    API key used for authentication.
    Location: header
    urlstring (uri)No
    URL of the PDF to split.
    Example: https://pdfmunk.com/sample1.pdf
    Location: body
    filestring (base64)No
    Alternative input: base64-encoded PDF.
    Location: body
    pagesstringNo
    Page selector: "3", "1-5", "1-3,5,7-10", "10-".
    Example: 1-2,3-
    Location: body
    modestringNo
    Split strategy (optional): `each` (one file per page).
    Example: each
    Location: body
    chunksintegerNo
    Alternative to pages: number of chunks to split into.
    Example: 4
    Location: body
    outputstringNo
    Return mode: `url`, `file`, or `base64`.
    Example: url
    Location: body
    Example Payload
    Code Samples
    Example Response

    Compress PDF

    Best-effort optimization pass to reduce PDF file size.

    POST
    /v1/compressPdf
    Use cases
    • Shrink PDFs before emailing
    • Reduce storage and bandwidth costs
    • Prepare files for size-limited uploads
    Attributes
    NameTypeRequiredDescription
    CLIENT-API-KEYstring
    Yes
    API key used for authentication.
    Location: header
    urlstring (uri)
    Yes
    Public URL to a PDF.
    Example: https://pdfmunk.com/sample1.pdf
    Location: body
    compressionstringNo
    Compression strength: `low`, `medium`, `high`, `max`.
    Example: high
    Location: body
    outputstringNo
    Return mode: `url`, `file`, or `base64`.
    Example: url
    Location: body
    output_namestringNo
    Optional output file name.
    Example: compressed.pdf
    Location: body
    Example Payload
    Code Samples
    Example Response

    Lock PDF (Encrypt)

    Add password protection to a PDF.

    POST
    /v1/lockPdf
    Use cases
    • Securely distribute reports
    • Protect invoices before sharing
    • Require a password for sensitive documents
    Attributes
    NameTypeRequiredDescription
    CLIENT-API-KEYstring
    Yes
    API key used for authentication.
    Location: header
    urlstring (uri)
    Yes
    Public URL to a PDF.
    Example: https://pdfmunk.com/sample1.pdf
    Location: body
    passwordstring
    Yes
    Password to set on the PDF.
    Example: secret123
    Location: body
    input_passwordstringNo
    If the input PDF is already encrypted, provide its password.
    Example: existingPassword
    Location: body
    outputstringNo
    Return mode: `url`, `file`, or `base64`.
    Example: url
    Location: body
    output_namestringNo
    Optional output file name.
    Example: locked_document.pdf
    Location: body
    Example Payload
    Code Samples
    Example Response

    Unlock PDF

    Remove password protection from a PDF.

    POST
    /v1/unlockPdf
    Use cases
    • Process protected PDFs in automation
    • Unlock before parsing/merging/splitting
    • Recover access for downstream tools
    Attributes
    NameTypeRequiredDescription
    CLIENT-API-KEYstring
    Yes
    API key used for authentication.
    Location: header
    urlstring (uri)
    Yes
    Public URL to an encrypted PDF.
    Example: https://pdfmunk.com/sampleprotected.pdf
    Location: body
    passwordstring
    Yes
    Password to unlock the PDF.
    Example: secret123
    Location: body
    outputstringNo
    Return mode: `url`, `file`, or `base64`.
    Example: url
    Location: body
    output_namestringNo
    Optional output file name.
    Example: unlocked_document.pdf
    Location: body
    Example Payload
    Code Samples
    Example Response

    Parse PDF → JSON

    Extract text, layout blocks, tables, and image metadata from a PDF.

    POST
    /v1/pdf/parse
    Use cases
    • Search indexing
    • Table extraction
    • RAG pipelines / document understanding
    Attributes
    NameTypeRequiredDescription
    CLIENT-API-KEYstring
    Yes
    API key used for authentication.
    Location: header
    urlstring (uri)
    Yes
    Public URL to a PDF.
    Example: https://pdfmunk.com/sample1.pdf
    Location: body
    modestringNo
    Extraction mode: `text`, `layout`, `tables`, or `full`.
    Example: full
    Location: body
    pagesstringNo
    Page selection: 'all', a single page ('2'), or a range ('1-3').
    Example: 1-3
    Location: body
    Example Payload
    Code Samples
    Example Response

    Watermark PDF/Image

    Adds a diagonal text watermark to a PDF or image. This "Try it" runner sends JSON, so use `file_url` or `base64_file` here (multipart upload is also supported).

    POST
    /v1/watermark
    Use cases
    • Add CONFIDENTIAL/DRAFT stamps
    • Brand PDFs before sharing
    • Watermark images before publishing
    Attributes
    NameTypeRequiredDescription
    CLIENT-API-KEYstring
    Yes
    API key used for authentication.
    Location: header
    output_formatstringNo
    Output format: `file`, `url`, `base64`, or `both`.
    Example: url
    Location: body
    file_urlstring (uri)No
    Publicly accessible PDF/image URL.
    Example: https://example.com/file.pdf
    Location: body
    base64_filestring (base64)No
    Base64-encoded file contents (raw base64 or data URL).
    Location: body
    textstringNo
    Watermark text.
    Example: DRAFT
    Location: body
    opacitynumber (0.0..1.0)No
    Watermark opacity.
    Example: 0.2
    Location: body
    angleintegerNo
    Rotation angle in degrees.
    Example: 45
    Location: body
    font_sizeintegerNo
    Optional font size override.
    Example: 48
    Location: body
    Example Payload
    Code Samples
    Example Response

    Support

    Need help integrating?

    Include a sanitized example payload and the HTTP status/response.