Unlock PDF

Remove password protection from PDF documents.

POSThttps://api.morphopdf.com/v1/pdf/unlock

Authentication

AuthorizationBearer

Retrieve your API Key from Dashboard.

Request Body

Provide the protected PDF file and its password.

fileFile

Password-protected PDF file uploaded via multipart/form-data.

urlstringOptional

Public URL pointing to a password-protected PDF file. Alternative to file upload.

passwordstring

The password to unlock the PDF. Can be either the user password or owner password.

Query Parameters

formatstringOptionalDefault: json

Response 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):

successboolean

Indicates whether the operation completed successfully.

messagestring

Human-readable status message.

fileNamestring

Name of the unlocked PDF document.

downloadUrlstring

Presigned URL to download the file. Valid for 1 hour.

pageCountnumber

Number of pages in the PDF.

unlockedboolean

Confirms the document has been unlocked. Always true.

methodstring

Unlocking method used (e.g., 'qpdf').

Binary Response

Add ?format=binary to receive the unlocked PDF directly with these headers:

  • Content-Type: application/pdf
  • Content-Disposition: attachment; filename="unlocked.pdf"

Error Responses

StatusCodeDescription
400INVALID_INPUTNo file provided or invalid file format
400PDF_INVALID_PASSWORDThe provided password is incorrect
400PDF_NOT_ENCRYPTEDThe PDF is not password-protected
401AUTHENTICATION_REQUIREDMissing or invalid API key
413FILE_TOO_LARGEFile exceeds maximum size limit
500PROCESSING_FAILEDInternal processing error
POST/v1/pdf/unlock
curl -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
200OK
{
  "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"
}