Send a PDF and the passwords or restrictions you want; get back the same PDF encrypted with AES-256 (or AES-128 on request).
See the Protect PDF tool page, or the docs index for authentication, the shared request/webhook contract, and the generic error table.
POST /webhooks/trigger — same endpoint and fields as every tool, with tool="protect-pdf" set explicitly (it's not the default).
curl -X POST https://api.anyconvert.app/webhooks/trigger \ -H "x-api-key: your_api_key_here" \ -F "file=@contract.pdf" \ -F "fileId=document-001" \ -F "referenceId=reference-001" \ -F "tool=protect-pdf"
An optional options multipart field carrying a JSON object, validated synchronously before a credit is charged — a bad value is rejected with 400, not charged and not queued. Passwords are never logged or echoed back, in any response or error message.
| userPassword | string, optional | Needed to open the file. 0 to 127 UTF-8 bytes. If omitted, the file opens without a password but keeps any restrictions. |
| ownerPassword | string, optional | Needed to change restrictions later. If omitted and a restriction is set, a random owner password is generated and never returned — restrictions then can't be changed by anyone. |
| permissions | object, optional | print ("none", "low", or "high", default "high"); modify, extract, annotate, fillForms, assemble (booleans, default true). Accessibility extraction always stays allowed. |
| currentPassword | string, optional | Required when the input is already encrypted and doesn’t open with an empty password. |
| compat | string, optional | Default "aes256", or "aes128" for older readers. |
Billed per document — $1 (1 credit) per protected PDF.
Delivered via the webhook as outcome=failure with a reason below — see the docs index for the full delivery shape.
| invalid_options | Neither a password nor any restriction was given, or a password couldn't be represented. |
| encrypted_file | The input is already encrypted and the correct currentPassword wasn't given. |
| invalid_file | The file could not be read, or was not the format this tool expects. |
| render_failed | Something failed during conversion that wasn’t a problem with the input itself. |
| timeout | The job did not finish within its time budget. |
| internal_error | An unexpected error on our side. |