Remove a known PDF password by API before processing

Most PDF tools refuse encrypted files. How to remove a password you already know with one API call, what a wrong password costs, and what the API will not do.

A locked PDF opened with its known password and returned without encryption

Encrypted PDFs stop most document pipelines at the first step. Merge, split, compress and form fill all need to read the pages, and an encrypted file cannot be read without its password. If your workflow receives locked files and you know the password, the PDF Unlock API removes it in one call, so the rest of the pipeline can run.

curl https://api.justapi.tech/v1/pdf/unlock \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{"source": {"url": "https://files.example.com/statement-2026-10.pdf"}, "options": {"password": "19870412"}}'

The result is the same document with no encryption and no print or copy restrictions.

You need the password

This is the important part. The API opens the file with the password you send, the same way a PDF reader would. It does not guess, try common passwords, or crack anything. A wrong password returns encrypted_pdf (422), with no charge, and you can try again.

Where workflows usually get the password:

  • Bank and payroll exports often use a fixed rule, such as the account holder's date of birth or a tax ID. The user tells you once, you store it encrypted in your own system.
  • Partner portals send the password in a separate email or message.
  • Your own files, protected earlier with the PDF Protect API.

Files with only restrictions

Some PDFs open without a password but block printing or copying. They have only an owner password. Send them with an empty password and the restrictions are removed:

{ "source": { "url": "https://files.example.com/statement.pdf" }, "options": { "password": "" } }

Keep in mind why the author restricted the file. Removing restrictions from a document you have no right to edit is your responsibility, not a technical question.

Chain it

Unlock returns result.file_id. Pass it as the source of the next call, such as merge or compression, and the unlocked copy is read straight from storage. The unlocked copy is deleted within 24 hours, or as soon as you acknowledge it.

Cost

$0.005 per call at the first tier. Wrong passwords and unreadable files are free.

For a single file, the free PDF unlocker does the same in the browser.