Loading
Loading
Apply permission restrictions on a PDF file, such as disabling printing, copying, or editing.
The PDF Restrict API lets you control what end users can do with your PDF. Apply granular restrictions like disabling printing, preventing content copying, blocking edits, and more. Supports both user and owner passwords.
Authorize every request with your API key, passed either as a header or as a query parameter:
X-apiKeyapiKeyThis is version v1.0 of the API.
The PDF Restrict API accepts a file upload, query parameters, and webhook headers described below.
The request body is a single optional file upload sent as multipart/form-data. All other parameters (including file_id, restrictions, and user_password) are passed as query parameters, not in the request body.
{
"file": "/path/to/document.pdf"
}fileoptionalmultipart/form-dataThe PDF file to process.
All parameters must be included as query parameters. Any parameters sent in the form data will be ignored.
formatoptionalStringdefault: jsonResponse format: 'json' (default) or 'xml'.
restrictionsrequiredArrayA list of restrictions to apply. These define what the end user is not allowed to do with the PDF. See available restrictions below table.
user_passwordrequiredStringSets the password users will use to open the PDF. Password must be between 6 and 128 characters. If not set, only owner password will be set and anyone can open the PDF with the provided restrictions enabled.
owner_passwordoptionalStringSets the password that allows full access (e.g., removing restrictions). If not provided, user_password (if set) is used as the owner password. Password must be between 6 and 128 characters.
file_passwordoptionalStringPassword to unlock the input file if it is already secured. Provide the owner password if available, otherwise the user password. Owner password takes precedence.
file_idoptionalStringThe unique ID of a file already present on our server. Use this instead of uploading the file again.
outputoptionalStringdefault: restricted_outputName of the output PDF (without extension).
destroyoptionalBooleandefault: falseIf true, we delete the input file immediately after generating the output.
webhook_urloptionalStringThe URL where we'll send the webhook notification after the task completes. Authentication parameters in the URL (e.g., ?auth=token123) are passed as-is.
webhook_failure_notificationoptionalBooleandefault: falseIf true, we'll send an email notification if the webhook request fails after 3 retries. The email goes to the requesting user or their org admin if user is part of an organization.
Pass one or more restriction values via the restrictions query parameter.
Disables high-quality printing.
Disables low-resolution printing.
Prevents reordering or inserting pages.
Disallows filling in PDF form fields.
Disables adding or modifying annotations or comments.
Prevents modifying existing content in the PDF.
Disables copying text or images from the PDF.
Prevents screen readers or accessibility tools from accessing content.
Optional custom headers for webhook authorization.
X-Webhook-AuthorizationoptionalStringCustom authorization header sent with the webhook request. Format: Key:Value (e.g., Authorization:Bearer token123).
A successful request returns a 200 OK response with a JSON object containing the task ID and input file IDs.
taskIdUnique identifier for the PDF task, used to check status.
inputIdsArray of file IDs referencing input files used for the task. Not returned when destroy=true.
Besides the response body, every response carries custom headers you can use to track credit usage, and concurrency usage on endpoints that enforce a concurrency limit. See the Custom Response Headers documentation and the endpoints with concurrency limits for more details.
X-Concurrent-Threadsheaderconcurrency-limited endpointsSpecifies the maximum number of concurrent requests allowed.
X-Concurrent-Threads-Activeheaderconcurrency-limited endpointsIndicates the number of active concurrent requests being processed.
X-AF-Credits-Costheaderall responsesSpecifies the number of credits consumed by the current request.
See the HTTP Status Codes documentation for a complete reference of common API errors and HTTP status codes.
Please provide a valid PDF file. Other file types are not supported.
Please provide either a file or a file ID.
Invalid parameter value provided for 'param_name'.
Please provide a valid file ID.
Please provide a user password for security operations.
Please provide valid PDF restrictions. Refer to the documentation for valid PDF restrictions.
Please provide a password for security operations.
Please provide a strong password. Refer to the documentation for password requirements.
These errors might appear in the task-status response if the background job fails.
The provided file is not a valid PDF file.
An unknown error occurred while saving the file. Try again later.
An unknown error occurred while generating the PDF. Try again later.
Internal Server Error Occurred.
The provided PDF file is encrypted. Please decrypt it first to perform operations.
Please provide the correct file password for security operations. Refer to documentation for valid password selection.
Please provide an owner password for security operations. You have provided a user password which is not valid for this operation.
An error occurred while creating the ZIP file. Please try again later.