---
title: "Unlock a password-protected PDF"
method: POST
path: "/pdf/unlock"
tags: ["PDF tools"]
---

# Unlock a password-protected PDF

`POST /pdf/unlock`

## Request

- Base URL: `https://api.podpdf.com`
- URL: `https://api.podpdf.com/pdf/unlock`
- Auth: API key in header `X-API-Key`

Returns a copy of a protected PDF with no password and no restrictions, which the merge,
split and edit endpoints accept.

A correct password is always required. A PDF with a password to open is unlocked by
that password or by its owner password. A PDF that opens without a password but
restricts printing, copying or editing needs its owner password.

Send the PDF in the request (up to 4 MB) or by `source_key` (up to 150 MB and 5000
pages). A wrong password is `422 PDF_PASSWORD_INCORRECT` and is not charged.

## Request body

- UnlockRequest: The protected PDF — `input` inline or `source_key` — and its password.
  - `input` InlinePdf: A PDF sent with the request instead of uploaded first. Up to 4 MB.
    - `pdf_base64` string, byte, required
    - `filename` string
  - `source_key` string: Key from `/pdf/upload-url`. Give this or `input`.
  - `filename` string
  - `password` string, password, required: The password to open the PDF, or its owner password.
  - `options` object
    - `output_filename` string: Without `.pdf`. Defaults to the input name with `-unlocked`.
  - `store` boolean

## Response `200`

The unlocked PDF, or JSON when `store` is true or the PDF was given by `source_key`

- PdfSecurityResult: A stored protect or unlock result. The one output's link is also given as `download_url`.
  - `job_id` string
  - `operation` 'pdf_protect' | 'pdf_unlock'
  - `status` 'completed'
  - `input_pages` integer
  - `output_count` 1
  - `download_url` string, uri: Signed link, valid one hour.
  - `outputs` PdfOutputFile[]
    - `index` integer
    - `name` string
    - `pages` integer
    - `page_range` string: The pages of the input this file holds.
    - `size_bytes` integer
    - `warnings` string[]
    - `download_url` string, uri: Signed link, valid one hour.
  - `zip_url` string, nullable: Always null, as there is one output.
  - `download_url_expires_at` string, date-time
  - `warnings` string[]: `SIGNATURE_INVALIDATED`, `SOURCE_REPAIRED` or `NON_ASCII_PASSWORD`.

## Other responses

- `400`: The request was invalid
- `401`: Missing or invalid API key
- `403`: `INSUFFICIENT_CREDITS`, `CONVERSION_TYPE_NOT_ENABLED`, `PDF_TOOLS_NOT_ENABLED`, `RATE_LIMIT_EXCEEDED` or `ACCOUNT_NOT_FOUND`. Note that a plan's rate limit is a 403, not a 429.
- `404`: No such resource for this account
- `408`: `PDFOP_TIMEOUT` — the request took longer than 25 seconds. Nothing is charged.
- `413`: The request body is over the limit
- `422`: The request is well formed but this PDF or password cannot satisfy it: `INVALID_PDF`, `PDF_NO_PAGES`, `PDF_ENCRYPTED` (already protected; unlock it first), `PDF_PASSWORD_INCORRECT` (also when the owner password is needed: `details.needs`), `PDF_NOT_ENCRYPTED`, `PDF_ENCRYPTION_UNSUPPORTED` or `PDF_SECURITY_FAILED`.

---

[API](https://skmtc.dev/podpdf/apis/podpdf-api.md) · [All operations](https://skmtc.dev/podpdf/apis/podpdf-api/llms.txt) · [OpenAPI document](https://skmtc.dev/podpdf/apis/podpdf-api/revisions/84eb21f3ee27?raw)
