documents

PDF Tools API

Inspect, check, split, merge, extract pages, rotate, linearize, optimize, strip metadata, encrypt, decrypt or repair PDFs from public HTTPS URLs. POST /v1/pdf with operation, input_urls and options. Answers JSON: document facts, and for transforms temporary HTTPS URLs to the result PDFs, kept one hour. Up to 50 MB per input. Pay per request in USDC; no account, no API key.

post/v1/pdf-tools

Request

  • Base URL: https://agent.pocket.network
  • URL: https://agent.pocket.network/v1/pdf-tools
  • Auth: none required

Request body

operation'inspect' | 'check' | 'split' | 'merge' | 'extract_pages' | 'rotate' | 'linearize' | 'optimize_structure' | 'remove_metadata' | 'encrypt' | 'decrypt' | 'repair' required

What to do with the PDF.

input_urlsstring[] required

Public HTTPS PDFs on port 443. merge takes 2 to 10; every other operation takes exactly one.

optionsobject

The operation's options. extract_pages needs {pages}; rotate needs {angle: 90, 180 or 270} and takes pages; split takes pages_per_file; encrypt needs owner_password and user_password (8 to 127 bytes, AES-256). Any operation takes password for an encrypted input; merge takes passwords, one per input.

Response

The upstream response, served after payment settles.

object required

A JSON object with ok, service, operation, data, outputs and notes. data carries the document facts (page_count, pdf_version, encrypted, linearized, structurally_valid, ...); outputs lists each result PDF with url, bytes, page_count and expires_at. A refused request answers ok false with error.code and error.message, e.g. unsafe_url.

Changes

No recorded changes to this operation across all 1 revision of this API.