PDF Password API
Send a PDF URL and a password, and get back an encrypted PDF that asks for it before it opens. A second endpoint takes the password off again.
- Free plan
- No credit card
Request
curl -X POST https://apdf.io/api/pdf/security/add \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d owner_password="OWNER_PASSWORD" \
-d user_password="USER_PASSWORD"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('owner_password', 'OWNER_PASSWORD');
data.append('user_password', 'USER_PASSWORD');
fetch('https://apdf.io/api/pdf/security/add', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/security/add', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'owner_password' => 'OWNER_PASSWORD',
'user_password' => 'USER_PASSWORD'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/security/add',
{
'file' => 'FILE_URL',
'owner_password' => 'OWNER_PASSWORD',
'user_password' => 'USER_PASSWORD'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/security/add',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'owner_password': 'OWNER_PASSWORD',
'user_password': 'USER_PASSWORD'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"owner_password": "OWNER_PASSWORD",
"user_password": "USER_PASSWORD"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/security/add")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("owner_password", "OWNER_PASSWORD")
.add("user_password", "USER_PASSWORD")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/security/add")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Two passwords.
Two jobs.
The user password is what a reader types to open the file.
The owner password is the master key that opens it as well.
user_password
optional
Asked for before the file opens
owner_password
required
The master key: also opens the file
- Encryption
- AES with a 256-bit key
- Opening the file
- User password or owner password
- Owner password only
- Opens without a prompt, stays encrypted
- Removing
- Either password unlocks the file
- Wrong password
- Rejected, no file is returned
Only for the right eyes.
Lock documents with personal data on the way out, and unlock the ones you receive before you process them.
Payslips and statements
Encrypt every payslip or account statement with a password only its recipient knows, before your app sends it by email.
Contracts and offers
Lock contracts, offers and NDAs before they leave your system, and share the password with the recipient on a second channel.
Health and HR records
Protect files with health, salary or other personal data, so an attachment forwarded by mistake stays closed to the wrong person.
Unlock for processing
Take the password off files you receive, so the next step in your pipeline can merge, compress or search them as usual.
Lock from anywhere.
Add or remove passwords right where your files pass.
One account and one monthly allowance behind every route.
One authenticated POST from any language. Copy-paste samples in cURL, Node.js, Python and more.
POST /api/pdf/security/add
Pick the action in any Zap and map files from earlier steps. No code and no servers to run.
Add PDF Password
Remove PDF Password
Add the Apdf node to any workflow, on n8n Cloud or self-hosted, and chain it with your automation.
Add PDF security
Remove PDF security
Let Claude, ChatGPT, Gemini or your own agent run it through the MCP server, on any paid plan.
add-pdf-security
remove-pdf-security
1,000 password operations
a month. Free.
Start on the free plan and move up only when your volume does — up to 1,000,000 operations a month on Business.
- One call is one operation, however many pages.
- Only calls that do the work are counted.
- Hard limits, so no surprise overage charges.
PDF passwords, answered
PDF password and security tutorials
Password-Protect PDFs in an Agent Workflow
Encryption as a step the agent runs, not a desktop-tool detour: lock a client statement with owner and user passwords, have the agent probe the result to prove the lock held (encrypted: true, everything else hidden), and unlock the archive copy in the same conversation.
Batch Password Protect PDFs for GDPR Compliance
This tutorial shows how to automatically password-protect sensitive documents like payslips and medical records before emailing. Using JavaScript and the Apdf Security API, you can batch-process documents with user-specific passwords for GDPR compliance.
Remove Password Protection from Archived PDFs with Ruby
Batch remove password protection from PDF documents using Ruby when you have the known password. Ideal for migrating protected archives to new systems or simplifying access to legacy documents protected with standard organizational passwords.
Your code made the PDF.
Then it went dark.
Opened, read, signed or ignored — you never see any of it. Send the PDFs you generate as personal links, and every open, page read, comment and signature comes back to your software as a webhook. Need it signed? Same link. Same account, same API key, one more call.
API · Webhook · MCP