Unlock PDF
Remove password protection from PDF documents.
https://api.morphopdf.com/v1/pdf/unlockAuthentication
Retrieve your API Key from Dashboard.
Request Body
Provide the protected PDF file and its password.
fileFilePassword-protected PDF file uploaded via multipart/form-data.
urlstringOptionalPublic URL pointing to a password-protected PDF file. Alternative to file upload.
passwordstringThe password to unlock the PDF. Can be either the user password or owner password.
Query Parameters
formatstringOptionalDefault: jsonResponse format. Use 'binary' to receive the unlocked PDF directly, or 'json' (default) to receive metadata with a download URL.
Password Required
You must provide the correct password to unlock the PDF. This API cannot bypass or crack PDF passwords - it requires the legitimate password to remove protection.
Response
When using format=json (default):
successbooleanIndicates whether the operation completed successfully.
messagestringHuman-readable status message.
fileNamestringName of the unlocked PDF document.
downloadUrlstringPresigned URL to download the file. Valid for 1 hour.
pageCountnumberNumber of pages in the PDF.
unlockedbooleanConfirms the document has been unlocked. Always true.
methodstringUnlocking method used (e.g., 'qpdf').
Binary Response
Add ?format=binary to receive the unlocked PDF directly with these headers:
Content-Type: application/pdfContent-Disposition: attachment; filename="unlocked.pdf"
Error Responses
| Status | Code | Description |
|---|---|---|
| 400 | INVALID_INPUT | No file provided or invalid file format |
| 400 | PDF_INVALID_PASSWORD | The provided password is incorrect |
| 400 | PDF_NOT_ENCRYPTED | The PDF is not password-protected |
| 401 | AUTHENTICATION_REQUIRED | Missing or invalid API key |
| 413 | FILE_TOO_LARGE | File exceeds maximum size limit |
| 500 | PROCESSING_FAILED | Internal processing error |
/v1/pdf/unlockcurl -X POST "https://api.morphopdf.com/v1/pdf/unlock?format=binary" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@protected.pdf" \
-F "password=secret123" \
--output unlocked.pdf{
"success": true,
"message": "File processed successfully",
"fileName": "unlocked.pdf",
"downloadUrl": "https://files.morphopdf.com/sessions/abc123/output/unlocked.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600&...",
"pageCount": 5,
"unlocked": true,
"method": "qpdf"
}