pdfedge
API reference › Protect

Encrypt a PDF with AES-256: a password to open it, and permissions (print, copy, edit)

POST/v1/protect

POST/v1/protect

Encrypt a PDF with AES-256: a password to open it, and permissions (print, copy, edit)

Without owner_password, a random one is set and not returned, so the permissions cannot be lifted. Chain after other operations by passing the earlier result's id.

REQUEST BODY · APPLICATION/JSON · REQUIRED
{
  "file": "fil_8kq2wzm4tnb7hdc3vrex",
  "user_password": "open-sesame",
  "permissions": {
    "copy": false,
    "modify": false
  }
}
In the full reference
REQUEST
curl -X POST "https://api.pdfedge.com/v1/protect" \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "file": "fil_8kq2wzm4tnb7hdc3vrex",
  "user_password": "open-sesame",
  "permissions": {
    "copy": false,
    "modify": false
  }
}'
RESPONSE
200With response=binary: the file itself, with X-File-Id and X-File-Url headers
201Created
{
  "id": "fil_8kq2wzm4tnb7hdc3vrex",
  "object": "file",
  "kind": "result",
  "operation": "protect",
  "name": "contract-protected.pdf",
  "format": "pdf",
  "content_type": "application/pdf",
  "pages": 12,
  "bytes": 284113,
  "url": "https://files.pdfedge.com/f/fil_8kq2wzm4tnb7hdc3vrex.pdf",
  "keep": "1d",
  "created": "2026-10-11T18:10:40Z",
  "expires": "2026-10-12T18:10:40Z",
  "units": 1,
  "encrypted": true,
  "algorithm": "AES-256",
  "opens_with_password": true
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.