PDF Password Protection

Learn how to generate password-protected PDFs with PDFMonkey.

When generating a Document, you can protect the resulting PDF with a password. The recipient will need to enter the password to open the document.

How it works

To password-protect a generated PDF, add a _password field to the meta object when creating a Document:

{
  "_password": "your-secret-password"
}

When _password is present, the generated PDF is encrypted with AES-256 after generation. The recipient needs the specified password to open the document.

circle-info

Completely opt-in

If you don't include the _password field in the meta object, PDFs are generated exactly as before: no encryption, no password. Password protection is per-document, one document can be protected while the next one isn't.

Using the API

curl \
  "https://api.pdfmonkey.io/api/v1/documents" \
  -X POST \
  -H 'Authorization: Bearer YOUR-API-KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "document": {
      "document_template_id": "ID-OF-YOUR-TEMPLATE",
      "status": "pending",
      "payload": {
        "clientName": "Jane Doe",
        "contractId": "CTR-2026-042"
      },
      "meta": {
        "_filename": "contract-jane-doe.pdf",
        "_password": "s3cur3-p@ss!"
      }
    }
  }'

Good to know

  • Works with all templates. Code editor, Builder, existing templates, password protection works with all of them.

  • No configuration needed. You don't need to enable anything on the template or your account.

  • Works with all integrations. Zapier, Make, Workato, n8n, Bubble, Glide, anywhere you can set the meta field.

  • Per-document control. Each document can be password-protected independently.

  • Same pattern as _filename. The _password key follows the same convention as _filename: a special key in the meta object that tells PDFMonkey to do something extra during generation.

Use cases

Password protection is useful when your generated documents contain sensitive or confidential information:

  • Contracts with confidential terms

  • Financial reports and invoices with banking details

  • Medical records

  • Employee documents and salary slips

  • Legal paperwork and NDAs

See also

Last updated

Was this helpful?