Skip to main content

Protect Document

SecurityProtect Document

The Protect Document API adds password protection and permissions to a PDF. You send the PDF as Base64 (docContent), docName, password, pdfPermission (e.g. All), and optionally async. The API returns a password-protected PDF with the specified permissions. Use the tester below to try it; more details are in the sections that follow.

Try the Protect Document API

Quick reference

Endpoint: POST /api/v2/Protect · Required: api-key, docContent, docName, password, pdfPermission

Try it live

Use the form below to send your API key, PDF (Base64), password, and permissions. The response is the password-protected PDF. No code required—fill the fields and click Send request.

Loading API Tester...

Overview, parameters, and use cases

What is Protect Document?

This endpoint protects a PDF with a password and sets document permissions. You provide the PDF (Base64), docName, password (user/owner password), and pdfPermission (e.g. All). The API returns a PDF that requires the password to open and enforces the chosen permissions (e.g. printing, copying). Use it to restrict access or editing.

Key features

  • Password protectionpassword is required to open the PDF; content is encrypted.
  • PermissionspdfPermission controls what users can do (e.g. All or restricted).
  • Async – Use async for large PDFs.
  • Single request – Send docContent (Base64), docName, password, pdfPermission; no extra steps.
Best for

Use when you need to restrict who can open or edit a PDF. To remove protection use Unlock PDF with the correct password.

Prerequisites

Before using this endpoint, make sure you have:

Response Format

The API returns a password-protected PDF file with the specified permissions applied.

Get Help