Which PDF operations are supported?
merge, split, extract, rotate, watermark, compress, encrypt, and inspect. GET /api/v1/pdf-toolkit lists the operation catalog and example bodies.
Merge, split, inspect, watermark, and encrypt PDFs in memory. No third-party document provider and no persistent storage.
This calls operation=inspect on the live PDF Toolkit API. The playground uses a canned one-page PDF. File uploads are not accepted.
Run the request to inspect a canned one-page PDF.
Why PDF Toolkit API
Merge and split
Combine two or more PDFs, or split a document into one file per page, all as base64 JSON.
Extract and rotate
Page selectors such as 1,3-5 pull a subset. Rotate in 90-degree steps without a desktop tool.
Watermark and compress
Stamp text with opacity, RGB color, angle, and font size, or shrink a file in memory.
Password encrypt
User passwords are 8-128 characters. An optional owner password is supported on encrypt.
Structural inspect
Page count, byte size, PDF version, and encryption state without extracting document content.
Bounded in-memory work
64 MB bodies, 128 MB decompressed streams, 500 pages. Bytes are not persisted or logged.
/api/v1/pdf-toolkit
Run an operation
merge, split, extract, rotate, watermark, compress, encrypt, or inspect a base64 PDF.
Operation catalog
Lists supported operations and example JSON bodies.
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string | yes | merge, split, extract, rotate, watermark, compress, encrypt, or inspect. |
| file | string | yes* | Base64 PDF. Required except for merge. |
| files | array | yes* | At least two PDFs for merge, each with data as base64. |
| pages | string | no | Page selector such as 1 or 1,3-5. |
| angle | number | no | Rotation angle, multiple of 90. |
| text | string | yes* | Watermark text. Required for watermark. |
| password | string | yes* | 8-128 character user password for encrypt. |
Error reference
Invalid operation, missing file, or unsupported PDF options.
Missing or invalid gateway API key. Send x-api-key or api_key with every request.
Unknown route under /api/v1/pdf-toolkit.
Request body exceeds 64 MB.
More than 40 requests in a 15-minute window.
Example error response
{
"success": false,
"error": { "code": "VALIDATION_ERROR", "message": "Please provide an 'operation' field." },
"correlationId": "1784849006651-pdfkit01"
}FAQ
merge, split, extract, rotate, watermark, compress, encrypt, and inspect. GET /api/v1/pdf-toolkit lists the operation catalog and example bodies.
POST a JSON body with operation and a base64 file (or files for merge). Page selectors such as 1,3-5 work on extract, rotate, and watermark.
No. inspect returns bounded structural metadata such as page count, byte size, PDF version, and encryption state without extracting document content.
Request bodies are capped at 64 MB, decompressed object streams at 128 MB, and documents at 500 pages with a page-tree depth of 64.
Send your Datpaq API key as an x-api-key header or an api_key query parameter. Keys are created in the Datpaq dashboard and a free tier is included.
Page counts, encryption flags, and metadata without standing up a document pipeline of your own.