PDF Password API

Our API is 100% free to use – no fees, no subscriptions.

Secure your PDF documents by adding password protection with our API. Simply set a password, and our API ensures your files are encrypted and accessible only to authorized users. Perfect for safeguarding sensitive information and enhancing document security.


Benefits of our PDF Password API

Secure your PDF documents effortlessly with our robust PDF Password API. Add custom passwords to encrypt your files and control access, ensuring that sensitive information remains protected. This feature enhances document security while maintaining a professional appearance, seamlessly integrating into your workflow for secure and efficient file management.

Read our API documentation to learn how to protect PDFs.

No-Code PDF Protection

Integrate our PDF API with Zapier Webhooks to automate your PDF protection workflows effortlessly. Whether you're securing sensitive contracts, invoices, or confidential reports, you can trigger PDF protection from hundreds of apps supported by Zapier. Automatically apply password encryption to your documents, safeguarding your data and eliminating the need for manual security settings.

Multi-language Code Example

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());
  }
}

Start using our API today — no trial needed!
Get Started for Free