Skip to content

Add password

Encrypt a PDF with an open password. MCP tool add_password / HTTP POST /v1/password/add.

Encrypt a PDF so it can only be opened with the password you set.

MCP tool add_password
HTTP endpoint POST /v1/password/add
Price $0.05
Input One PDF + a password
Output An encrypted PDF requiring the password to open
Parameter Type Required Description
file file yes Source PDF.
password string yes The open (user) password required to view the document.

Password-protect https://example.com/contract.pdf with the password s3cret.

{
"file": "https://example.com/contract.pdf",
"password": "s3cret"
}
Terminal window
curl -i -X POST https://api.pdfasyougo.com/v1/password/add \
-H "Content-Type: application/json" \
-H "X-PAYMENT: <base64-encoded-payment-payload>" \
-d '{"file":"https://example.com/contract.pdf","password":"s3cret"}'
{
"output": {
"url": "https://files.pdfasyougo.com/o/a17c…?token=…",
"expires_at": "2026-06-29T12:00:00Z",
"pages": 8,
"bytes": 73728
},
"operation": "password.add",
"cost": "0.05 USDC"
}
  • This sets an open (user) password — required to view the document.
  • To control what a viewer can do (print, copy, modify) rather than whether they can open it, use Add restrictions.
  • The password you supply is used only to encrypt the output and is not retained — see Privacy & retention.