Security

Remove password protection from PDF

Remove password protection from a PDF document.

How It Works

  • With password: Removes user (open) password protection. The document will open without a password.
  • Without password: Removes only owner (permissions) password. The document keeps any user password but restrictions are lifted.

Common Use Cases

  1. Unlock a PDF you can open but can't edit:

    • Leave password empty
    • Owner restrictions will be removed
  2. Fully unlock a password-protected PDF:

    • Provide the user password
    • Both user and owner protection removed

Example

import httpx

# Remove all protection (requires the open password)
response = httpx.post(
    "https://api.filegraph.ai/security/pdf/unlock",
    headers={"X-API-Key": "your-api-key"},
    files={"file": open("protected.pdf", "rb")},
    data={"password": "openme123"}
)

# Remove only owner restrictions (no password needed if document opens)
response = httpx.post(
    "https://api.filegraph.ai/security/pdf/unlock",
    headers={"X-API-Key": "your-api-key"},
    files={"file": open("restricted.pdf", "rb")}
)
post/security/pdf/unlock

Request

  • Base URL: https://api.filegraph.ai (the document declares no server; this is the origin it was published from)
  • URL: https://api.filegraph.ai/security/pdf/unlock
  • Auth: API key in header X-API-Key

Response

Successful Response

filenamestring required

Output filename

content_typestring required

MIME type of the file

size_bytesinteger required

File size in bytes

content_base64string required

Base64-encoded file content

was_user_protectedboolean required

Whether the document had user (open) password protection

was_owner_protectedboolean required

Whether the document had owner (permissions) password protection

Example response

{
  "content_base64": "JVBERi0xLjQK...",
  "content_type": "application/pdf",
  "filename": "unlocked.pdf",
  "size_bytes": 102400,
  "was_owner_protected": true,
  "was_user_protected": true
}

Changes

No recorded changes to this operation across all 1 revision of this API.