Autype icon

Autype

Interact with the Autype Developer API for document generation, PDF tools, and more

Document Tool → Protect

AI-generated

Summary

Encrypt a PDF document with password protection for opening or changing permissions.

Inputs

  • fileId (required) — ID of the PDF file uploaded via the File resource.
  • waitForCompletion — Whether to wait for the background protection job to finish before returning.
  • downloadOutput — Whether to automatically download the encrypted PDF as binary data after completion.
  • protectOptions — Collection containing User Password (required to open the document) and Owner Password (required to modify document permissions).

Output shape

A JSON job status object, or binary file data if output download is enabled.

When both Wait for Completion and Download Output are enabled, returns binary data containing the protected PDF along with metadata (fileName and mimeType). Otherwise, returns a JSON object detailing the job ID and completion status.

Examples

Example 1: Protect a PDF with an open password and download the output file

Set File ID to 'file-123', add User Password in Protect Options, set Wait for Completion to true, and set Download Output to true.

Example 2: Trigger asynchronous PDF protection with owner permissions

Set File ID to 'file-123', specify Owner Password under Protect Options, and set Wait for Completion to false.

Links

Discussion