PDF Toolkit API
8 Operations
In-Memory
Base64 JSON

PDF operations. Kept private.

Merge, split, inspect, watermark, and encrypt PDFs in memory. No third-party document provider and no persistent storage.

inspect · structure only1,3-5 · page selectors64 MB · body cap500 · page limit

Inspect a PDF live.

This calls operation=inspect on the live PDF Toolkit API. The playground uses a canned one-page PDF. File uploads are not accepted.

Request builder
Click to run. Binary fields in the JSON are truncated.
POST /pdf-toolkit
Canned sample only
The demo always inspects a tiny embedded PDF. Merge, split, and other operations stay on the production API.
Output preview
Live response from the API, plus the exact request to reproduce it.

Run the request to inspect a canned one-page PDF.

Why PDF Toolkit API

Private PDF ops, predictable results.

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

Endpoints, at a glance.

POST a JSON operation with base64 PDFs. GET lists every supported operation and example body.
POST/api/v1/pdf-toolkit

Run an operation

merge, split, extract, rotate, watermark, compress, encrypt, or inspect a base64 PDF.

PRIMARY
GET/api/v1/pdf-toolkit

Operation catalog

Lists supported operations and example JSON bodies.

ParameterTypeRequiredDescription
operationstringyesmerge, split, extract, rotate, watermark, compress, encrypt, or inspect.
filestringyes*Base64 PDF. Required except for merge.
filesarrayyes*At least two PDFs for merge, each with data as base64.
pagesstringnoPage selector such as 1 or 1,3-5.
anglenumbernoRotation angle, multiple of 90.
textstringyes*Watermark text. Required for watermark.
passwordstringyes*8-128 character user password for encrypt.

Error reference

Failures you can plan for.

Failures return a structured error object plus a correlationId.
400Validation Error

Invalid operation, missing file, or unsupported PDF options.

401Authentication Error

Missing or invalid gateway API key. Send x-api-key or api_key with every request.

404Not Found

Unknown route under /api/v1/pdf-toolkit.

413Payload Too Large

Request body exceeds 64 MB.

429Rate Limit Error

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

API questions developers ask first.

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.

How do I send a PDF?

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.

Does inspect return the file contents?

No. inspect returns bounded structural metadata such as page count, byte size, PDF version, and encryption state without extracting document content.

What size and page limits apply?

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.

How do I authenticate requests?

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.

Inspect PDFs in one request.

Page counts, encryption flags, and metadata without standing up a document pipeline of your own.