Skip to content

Endpoint reference

Every endpoint with its fields, limits, responses and a real example.

Every endpoint of the API, generated from openapi.json. Requests go to http://127.0.0.1:7341 with Authorization: Bearer <token> (see Authentication) and, for POST, a JSON body with Content-Type: application/json. TypeScript, Python and Go examples use the client file.

Tools answer when they’ve finished. For long work, send the same input to Create a job. Paths in requests are inside the allowed folders: relative paths start in the first one.

List tools

GET/v1/tools

Response

200 Every tool, with its MCP annotations.

FieldType
toolsarray of objects
tools[].namestring
tools[].titlestring
tools[].descriptionstring
tools[].reports_progressboolean
tools[].annotationsobject

Errors: 401, 403. See Errors.

Example

curl http://127.0.0.1:7341/v1/tools \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN"
Response
{
  "tools": [
    {
      "name": "pdf_list_files",
      "title": "List PDFs",
      "description": "List PDF files in an allowed folder (not recursive), with siz…",
      "reports_progress": false,
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    …
  ]
}

List PDFs

POST/v1/tools/pdf_list_files

List PDF files in an allowed folder (not recursive), with size and modification time.

Request body

FieldTypeDescription
folderstringFolder inside an allowed folder. Omit for the first allowed folder.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
folderstring
filesarray of objects
files[].pathstring
files[].bytesnumber
files[].modifiedstring

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_list_files \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Response
{
  "folder": "/Users/<you>/Documents/superPDF",
  "files": [
    {
      "path": "/Users/<you>/Documents/superPDF/appendix.pdf",
      "bytes": 971,
      "modified": "2026-10-14T22:08:06.258Z"
    },
    {
      "path": "/Users/<you>/Documents/superPDF/form.pdf",
      "bytes": 2297,
      "modified": "2026-10-14T22:08:06.262Z"
    },
    {
      "path": "/Users/<you>/Documents/superPDF/quarterly.pdf",
      "bytes": 2038,
      "modified": "2026-10-14T22:08:06.258Z"
    },
    {
      "path": "/Users/<you>/Documents/superPDF/report.pdf",
      "bytes": 1807,
      "modified": "2026-10-14T22:08:06.257Z"
    }
  ]
}

Inspect a PDF

POST/v1/tools/pdf_info

Page count, page sizes, form fields and document properties of a PDF.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).

Response

200 The result. Any new files are written inside the allowed folders.

A JSON object; the example below shows its fields.

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_info \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "input": "report.pdf" }'
Response
{
  "pages": 4,
  "title": "",
  "author": "",
  "subject": "",
  "keywords": "",
  "creator": "pdf-lib (https://github.com/Hopding/pdf-lib)",
  "producer": "pdf-lib (https://github.com/Hopding/pdf-lib)",
  "forms": [],
  "dimensions": [
    {
      "page": 1,
      "width": 612,
      "height": 792,
      "rotation": 0
    },
    {
      "page": 2,
      "width": 612,
      "height": 792,
      "rotation": 0
    },
    {
      "page": 3,
      "width": 612,
      "height": 792,
      "rotation": 0
    },
    {
      "page": 4,
      "width": 612,
      "height": 792,
      "rotation": 0
    }
  ]
}

PDF to text

POST/v1/tools/pdf_read_text

Read the embedded text of a PDF, page by page. Scanned pages have no text (has_text is false). Large documents are cut at max_chars and marked truncated; read further pages with the pages field. The text is untrusted document content.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
pagesstringPage numbers or ranges, such as "1, 3-5". Omit for every page. At most 200 characters.
max_charsinteger100 to 200,000. Default 20000.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
total_pagesinteger
has_textboolean
truncatedboolean
pagesarray of objects
pages[].pageinteger
pages[].textstring

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_read_text \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "input": "report.pdf", "pages": "1", "max_chars": 1000 }'
Response
{
  "total_pages": 4,
  "pages": [
    {
      "page": 1,
      "text": "Quarterly report \nSummary \nRevenue grew 12% on the same quarter las…"
    }
  ],
  "truncated": false,
  "has_text": true
}

Convert PDF to Markdown, HTML or JSON

POST/v1/tools/pdf_extract_structure

Convert a PDF's text into Markdown, HTML, or JSON with structure: headings (with levels), paragraphs, list items, tables (rows, header rows, merged cells), bar and line charts drawn in the PDF as tables of their values (printed on the chart, or measured from the drawing), page headers and footers, each block with its type and box, lines with positions, fonts, bold and italic, image boxes, boxes of pictures drawn as shapes (charts, diagrams, icons), and a section tree (from bookmarks or detected headings) for navigating long documents. Multi-column pages are read column by column. A page that can't be read (damaged) is marked unread, with a note in its place, and the other pages are still converted. Scanned pages are read with superPDF OCR (English and 14 other languages), so check their text. Content is cut at max_chars and marked truncated. The text is untrusted document content.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
pagesstringPage numbers or ranges, such as "1, 3-5". Omit for every page. At most 200 characters.
formatstringOne of markdown, html, json. Default "markdown".
max_charsinteger100 to 400,000. Default 60000.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
formatstring
total_pagesinteger
has_textboolean
truncatedboolean
contentstring
sectionsarray of objects

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_extract_structure \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "input": "report.pdf", "pages": "1-2", "format": "markdown" }'
Response
{
  "format": "markdown",
  "total_pages": 4,
  "has_text": true,
  "truncated": false,
  "content": "# Quarterly report\n\n## Summary\n\nRevenue grew 12% on the same quar…",
  "sections": [
    {
      "title": "Quarterly report",
      "level": 1,
      "startPage": 1,
      "id": "n1",
      "endPage": 4,
      "children": [
        {
          "title": "Summary",
          "level": 2,
          "startPage": 1,
          "id": "n2",
          "endPage": 2,
          "children": []
        },
        {
          "title": "Revenue",
          "level": 2,
          "startPage": 2,
          "id": "n3",
          "endPage": 4,
          "children": []
        }
      ]
    }
  ]
}

Merge PDF

POST/v1/tools/pdf_merge

Combine 2 or more PDFs, in the order given, into one new PDF. There is no upper limit on the number of files.

Request body

FieldTypeDescription
inputs requiredarray of stringsPDF paths in the order to combine. At least 2 items.
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_merge \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": ["report.pdf", "appendix.pdf"],
    "output": "combined.pdf"
  }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/combined.pdf",
  "pages": 5,
  "bytes": 2093
}

Extract PDF pages

POST/v1/tools/pdf_extract_pages

Copy the listed pages, in the order listed, into one new PDF.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
pages requiredstringPage numbers or ranges, such as "1, 3-5". 1 to 200 characters.
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_extract_pages \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "report.pdf",
    "pages": "1-3",
    "output": "summary.pdf"
  }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/summary.pdf",
  "pages": 3,
  "bytes": 1547
}

Delete PDF pages

POST/v1/tools/pdf_remove_pages

Write a new PDF without the listed pages. At least one page must remain.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
pages requiredstringPage numbers or ranges, such as "1, 3-5". 1 to 200 characters.
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_remove_pages \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "report.pdf",
    "pages": "4",
    "output": "without-appendix.pdf"
  }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/without-appendix.pdf",
  "pages": 3,
  "bytes": 1804
}

Rotate PDF

POST/v1/tools/pdf_rotate_pages

Rotate PDF clockwise by 90, 180 or 270 degrees.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
pagesstringPage numbers or ranges, such as "1, 3-5". Omit for every page. At most 200 characters.
angle90 or 180 or 270Clockwise rotation in degrees. Default 90.
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_rotate_pages \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "report.pdf",
    "pages": "1",
    "angle": 90,
    "output": "rotated.pdf"
  }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/rotated.pdf",
  "pages": 4,
  "bytes": 1813
}

Add page labels

POST/v1/tools/pdf_add_page_labels

Add page numbers or a footer. Use {page} and {total} in the text.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
pagesstringPage numbers or ranges, such as "1, 3-5". Omit for every page. At most 200 characters.
textstring1 to 120 characters. Default "{page} / {total}".
positionstringWhere on the page the label goes. One of top, bottom. Default "bottom".
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_add_page_labels \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "report.pdf",
    "text": "Page {page} of {total}",
    "output": "numbered.pdf"
  }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/numbered.pdf",
  "pages": 4,
  "bytes": 2773
}

Add a watermark

POST/v1/tools/pdf_add_watermark

Stamp text diagonally across pages, such as DRAFT or CONFIDENTIAL.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
pagesstringPage numbers or ranges, such as "1, 3-5". Omit for every page. At most 200 characters.
text requiredstring1 to 60 characters.
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_add_watermark \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "report.pdf",
    "text": "DRAFT",
    "output": "draft.pdf"
  }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/draft.pdf",
  "pages": 4,
  "bytes": 2917
}

Split a PDF

POST/v1/tools/pdf_split

Split one PDF into several new files: one per comma-separated range (mode "ranges"), or one per page (mode "pages"). Files are written to output_folder.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
pagesstringPage numbers or ranges, such as "1, 3-5". Omit for every page. At most 200 characters.
modestringOne of ranges, pages. Default "ranges".
output_folder requiredstringFolder for the new files, inside an allowed folder; created if missing.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputsarray of objects
outputs[].outputstring
outputs[].pagesinteger
outputs[].bytesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_split \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "report.pdf",
    "mode": "pages",
    "output_folder": "pages"
  }'
Response
{
  "outputs": [
    {
      "output": "/Users/<you>/Documents/superPDF/pages/report-page-1.pdf",
      "pages": 1,
      "bytes": 1003
    },
    {
      "output": "/Users/<you>/Documents/superPDF/pages/report-page-2.pdf",
      "pages": 1,
      "bytes": 954
    },
    {
      "output": "/Users/<you>/Documents/superPDF/pages/report-page-3.pdf",
      "pages": 1,
      "bytes": 948
    },
    {
      "output": "/Users/<you>/Documents/superPDF/pages/report-page-4.pdf",
      "pages": 1,
      "bytes": 937
    }
  ]
}

Convert an Office file to PDF

POST/v1/tools/pdf_from_office

Convert a Word, Excel, PowerPoint or OpenDocument file (.docx, .xlsx, .pptx, .odt, .ods, .odp) to a new PDF with LibreOffice installed on this computer. Fails with an install hint when LibreOffice isn't installed.

Request body

FieldTypeDescription
input requiredstringPath to the Office file inside an allowed folder (absolute, or relative to the first allowed folder).
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger
engine"LibreOffice"

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_from_office \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "input": "budget.xlsx", "output": "budget.pdf" }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/budget.pdf",
  "pages": 2,
  "bytes": 28304,
  "engine": "LibreOffice"
}

Remove document properties

POST/v1/tools/pdf_remove_metadata

Write a copy without author, title, subject, keywords, creator and producer properties.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_remove_metadata \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "input": "report.pdf", "output": "clean.pdf" }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/clean.pdf",
  "pages": 4,
  "bytes": 1759
}

Repair a PDF

POST/v1/tools/pdf_repair

Rewrite a damaged PDF and rebuild its cross-reference table. Reports what was fixed.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger
fixedarray of strings

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_repair \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "input": "report.pdf", "output": "repaired.pdf" }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/repaired.pdf",
  "pages": 4,
  "bytes": 1872,
  "fixed": []
}

Password-protect a PDF

POST/v1/tools/pdf_protect

Encrypt a copy with AES-256 so it needs a password to open. Only use a password the user gave you for this purpose.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
password requiredstring1 to 127 characters.
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_protect \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "report.pdf",
    "password": "correct horse battery",
    "output": "protected.pdf"
  }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/protected.pdf",
  "pages": 4,
  "bytes": 2648
}

Remove a PDF password

POST/v1/tools/pdf_unlock

Write a decrypted copy using a password the user knows. Never guesses passwords.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
passwordstringAt most 127 characters. Default "".
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_unlock \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "protected.pdf",
    "password": "correct horse battery",
    "output": "unlocked.pdf"
  }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/unlocked.pdf",
  "pages": 4,
  "bytes": 1976
}

Run a pipeline

POST/v1/tools/pdf_run_pipeline

Apply 1–10 steps in order and write one new PDF. Step actions: extract, remove, rotate, crop, scale, flatten, labels, watermark, metadata-clear; options as in the matching tools (e.g. {"action":"rotate","options":{"pages":"1","angle":90}}).

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
steps requiredarray of objectsSteps run in order, such as [{"action":"rotate","options":{"pages":"1","angle":90}}]. 1 to 10 items.
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_run_pipeline \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "report.pdf",
    "steps": [
      {"action": "extract", "options": {"pages": "1-2"}},
      {"action": "labels", "options": {"text": "{page} / {total}"}}
    ],
    "output": "brief.pdf"
  }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/brief.pdf",
  "pages": 2,
  "bytes": 1843
}

Run a batch

POST/v1/tools/pdf_run_batch

Apply the same 1–10 pipeline steps to each of 1–50 PDFs, one file at a time. Each result is written to output_folder as <name>-<suffix>.pdf. A file that fails is skipped and listed in failed with the reason; the rest continue.

Request body

FieldTypeDescription
inputs requiredarray of stringsPDF paths to process. 1 to 50 items.
steps requiredarray of objectsSteps run in order, such as [{"action":"rotate","options":{"pages":"1","angle":90}}]. 1 to 10 items.
output_folder requiredstringFolder for the new files, inside an allowed folder; created if missing.
suffixstringAdded to each output file name. Matches ^[A-Za-z0-9_-]{1,40}$. Default "processed".

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputsarray of objects
outputs[].outputstring
outputs[].pagesinteger
outputs[].bytesinteger
outputs[].inputstring
failedarray of objects
failed[].inputstring
failed[].errorstring

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_run_batch \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": ["report.pdf", "appendix.pdf"],
    "steps": [{"action": "watermark", "options": {"text": "DRAFT"}}],
    "output_folder": "drafts"
  }'
Response
{
  "outputs": [
    {
      "input": "/Users/<you>/Documents/superPDF/report.pdf",
      "output": "/Users/<you>/Documents/superPDF/drafts/report-processed.pdf",
      "pages": 4,
      "bytes": 2917
    },
    {
      "input": "/Users/<you>/Documents/superPDF/appendix.pdf",
      "output": "/Users/<you>/Documents/superPDF/drafts/appendix-processed.pdf",
      "pages": 1,
      "bytes": 1405
    }
  ],
  "failed": []
}

PDF to Word

POST/v1/tools/pdf_to_docx

Convert a PDF to an editable Word document (.docx): headings, paragraphs with bold and italic, lists and tables. Scanned pages are read with OCR. Page layout and images are not reconstructed.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
pagesstringPage numbers or ranges, such as "1, 3-5". Omit for every page. At most 200 characters.
output requiredstringPath for the new Word document (ending in .docx), inside an allowed folder. Must not exist yet.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
bytesinteger
pagesinteger
paragraphsinteger
tablesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_to_docx \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "input": "quarterly.pdf", "output": "quarterly.docx" }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/quarterly.docx",
  "bytes": 10116,
  "pages": 1,
  "paragraphs": 3,
  "tables": 2
}

Extract tables from a PDF

POST/v1/tools/pdf_extract_tables

Find the tables in a PDF (ruled, shaded and borderless, plus charts drawn as vectors, as tables of their values) and write them as Excel (.xlsx, one sheet per table), CSV, JSON or Markdown. The output name must end in the format's extension (.xlsx, .csv, .json, .md).

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
pagesstringPage numbers or ranges, such as "1, 3-5". Omit for every page. At most 200 characters.
formatstringOne of xlsx, csv, json, markdown. Default "xlsx".
output requiredstringPath for the new file, ending in .xlsx, .csv, .json or .md to match the format, inside an allowed folder. Must not exist yet.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
bytesinteger
formatstring
tablesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_extract_tables \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "quarterly.pdf",
    "format": "csv",
    "output": "tables.csv"
  }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/tables.csv",
  "bytes": 115,
  "format": "csv",
  "tables": 2
}

Fill a PDF form

POST/v1/tools/pdf_fill_form

Fill form fields by name (pdf_info lists them): text fields take text, check boxes true or false, choices one of their options. With flatten, the filled values become part of the page and can no longer be edited.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
values requiredobjectField name → value, such as {"Name": "Ada Lovelace", "Agree": true}.
flattenbooleanMake the filled values part of the page (no longer editable). Default false.
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_fill_form \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "form.pdf",
    "values": {"Name": "Ada Lovelace", "Agree": true},
    "output": "filled.pdf"
  }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/filled.pdf",
  "pages": 1,
  "bytes": 2715
}

Add text or a typed signature

POST/v1/tools/pdf_add_text

Draw text (such as a typed signature, a date or a note) at a position on the chosen pages. x and y are in points from the bottom-left corner of the page. Latin characters only.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
pagesstringPage numbers or ranges, such as "1, 3-5". Omit for every page. At most 200 characters.
text requiredstring1 to 200 characters.
xnumberPoints from the left edge. Default 36.
ynumberPoints from the bottom edge. Default 36.
sizenumberFont size in points. 6 to 72. Default 12.
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_add_text \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "report.pdf",
    "pages": "1",
    "text": "Approved: Ada Lovelace",
    "x": 72,
    "y": 72,
    "output": "approved.pdf"
  }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/approved.pdf",
  "pages": 4,
  "bytes": 2196
}

Flatten a PDF

POST/v1/tools/pdf_flatten

Make form fields part of the page, so their values show everywhere and can no longer be edited.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_flatten \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "input": "form.pdf", "output": "flat.pdf" }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/flat.pdf",
  "pages": 1,
  "bytes": 2465
}

Crop or scale pages

POST/v1/tools/pdf_resize_pages

Crop a margin from each edge (mode crop, margin in points) or scale page content (mode scale, factor 0.1–4).

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
pagesstringPage numbers or ranges, such as "1, 3-5". Omit for every page. At most 200 characters.
mode requiredstringOne of crop, scale.
marginnumberPoints trimmed from each edge (crop). 0 to 500. Default 24.
factornumberScale factor (scale). 0.1 to 4. Default 1.
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_resize_pages \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "report.pdf",
    "mode": "crop",
    "margin": 36,
    "output": "cropped.pdf"
  }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/cropped.pdf",
  "pages": 4,
  "bytes": 1818
}

Images to PDF

POST/v1/tools/pdf_from_images

Make a PDF from JPG or PNG images, one page per image, in the order given.

Request body

FieldTypeDescription
inputs requiredarray of strings1 to 200 items.
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_from_images \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "inputs": ["photo.jpg"], "output": "photo.pdf" }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/photo.pdf",
  "pages": 1,
  "bytes": 2165
}

Markdown to PDF

POST/v1/tools/pdf_from_markdown

Typeset a Markdown file (headings, paragraphs, lists, tables, code, links) as a PDF on A4 or Letter pages.

Request body

FieldTypeDescription
input requiredstringPath to a Markdown file (.md) inside an allowed folder.
page_sizestringOne of A4, Letter. Default "A4".
titlestringAt most 200 characters.
output requiredstringPath for the new PDF, inside an allowed folder. Must not exist yet; superPDF never overwrites files.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
pagesinteger
bytesinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_from_markdown \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "notes.md",
    "page_size": "Letter",
    "output": "notes.pdf"
  }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/notes.pdf",
  "pages": 1,
  "bytes": 1318
}

PDF to PowerPoint

POST/v1/tools/pdf_to_pptx

Convert a PDF to a PowerPoint file (.pptx) with one slide per page and its text as editable text boxes.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
pagesstringPage numbers or ranges, such as "1, 3-5". Omit for every page. At most 200 characters.
output requiredstringPath for the new PowerPoint file (ending in .pptx), inside an allowed folder. Must not exist yet.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
bytesinteger
slidesinteger
empty_pagesarray of integers

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_to_pptx \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "input": "quarterly.pdf", "output": "quarterly.pptx" }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/quarterly.pptx",
  "bytes": 68790,
  "slides": 1,
  "empty_pages": []
}

PDF to EPUB

POST/v1/tools/pdf_to_epub

Convert a PDF's text into an EPUB 3 e-book, split into chapters at headings (or every few pages).

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
titlestringAt most 200 characters.
authorstringAt most 200 characters.
languagestringLanguage tag, such as en or pt-BR. Matches ^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$. Default "en".
splitstringOne of headings, pages. Default "headings".
output requiredstringPath for the new e-book (ending in .epub), inside an allowed folder. Must not exist yet.

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
outputstring
bytesinteger
chaptersinteger

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_to_epub \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "report.pdf",
    "author": "Finance team",
    "output": "report.epub"
  }'
Response
{
  "output": "/Users/<you>/Documents/superPDF/report.epub",
  "bytes": 2572,
  "chapters": 1
}

Compare two PDFs

POST/v1/tools/pdf_compare

Compare the text of two versions of a PDF page by page: which pages changed, were added or removed, and the words that changed, marked [-removed-] and {+added+}.

Request body

FieldTypeDescription
before requiredstringPath to the earlier PDF inside an allowed folder.
after requiredstringPath to the revised PDF inside an allowed folder.
max_charsintegerMost characters of marked text returned per page. 100 to 400,000. Default 20000.

Response

200 The result. Any new files are written inside the allowed folders.

FieldTypeDescription
summarystringNone
pagesarray of objectsNone
pages[].pageintegerNone
pages[].statusstringOne of same, changed, added, removed.
pages[].words_removedintegerNone
pages[].words_addedintegerNone
pages[].changesstringNone

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_compare \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "before": "report.pdf", "after": "approved.pdf" }'
Response
{
  "summary": "1 of 4 pages changed: page 1.",
  "pages": [
    {
      "page": 1,
      "status": "changed",
      "words_removed": 0,
      "words_added": 3,
      "changes": "Quarterly report Summary Revenue grew 12% on the same quarter last…"
    },
    {
      "page": 2,
      "status": "same",
      "words_removed": 0,
      "words_added": 0,
      "changes": ""
    },
    {
      "page": 3,
      "status": "same",
      "words_removed": 0,
      "words_added": 0,
      "changes": ""
    },
    {
      "page": 4,
      "status": "same",
      "words_removed": 0,
      "words_added": 0,
      "changes": ""
    }
  ]
}

Outline of a PDF

POST/v1/tools/pdf_outline

The document's outline (from bookmarks or detected headings) as a Markdown list or JSON tree, with the pages each section covers.

Request body

FieldTypeDescription
input requiredstringPath to a PDF inside an allowed folder (absolute, or relative to the first allowed folder).
formatstringOne of markdown, json. Default "markdown".

Response

200 The result. Any new files are written inside the allowed folders.

FieldType
formatstring
contentstring
sectionsarray of anys

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500. See Errors.

Example

curl -s http://127.0.0.1:7341/v1/tools/pdf_outline \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "input": "report.pdf" }'
Response
{
  "format": "markdown",
  "content": "# report\n\n- Quarterly report (pp. 1–4)\n  - Summary (pp. 1–2)\n  - …",
  "sections": [
    {
      "title": "Quarterly report",
      "level": 1,
      "startPage": 1,
      "id": "n1",
      "endPage": 4,
      "children": [
        {
          "title": "Summary",
          "level": 2,
          "startPage": 1,
          "id": "n2",
          "endPage": 2,
          "children": []
        },
        {
          "title": "Revenue",
          "level": 2,
          "startPage": 2,
          "id": "n3",
          "endPage": 3,
          "children": []
        },
        {
          "title": "Outlook",
          "level": 2,
          "startPage": 3,
          "id": "n4",
          "endPage": 4,
          "children": []
        },
        {
          "title": "Appendix",
          "level": 2,
          "startPage": 4,
          "id": "n5",
          "endPage": 4,
          "children": []
        }
      ]
    }
  ]
}

Run a tool in the background

POST/v1/jobs

Queues a tool call and returns at once with the job. Jobs run one at a time. Poll GET /v1/jobs/{id}, or pass callback_url to receive a signed event when it finishes. Failed callback deliveries are retried up to 5 times with exponential backoff (1, 2, 4 and 8 seconds).

Request body

FieldTypeDescription
tool requiredstringThe tool to run: any name from GET /v1/tools.
input requiredobjectThe tool’s input: the same fields as its own endpoint below.
callback_urlstringWhere to POST a signed event when the job finishes. Loopback addresses (127.0.0.1, localhost, [::1]) are allowed by default; other origins only when the API was started with --webhook-allow <origin>. At most 2,048 characters.

Response

202 Queued.

FieldTypeDescription
idstringNone
toolstringNone
statusstringOne of queued, running, succeeded, failed.
progressobject or nullLatest progress from tools that report it (merge, split, pipelines, batches).
progress.progressnumberNone
progress.totalnumberNone
progress.messagestringNone
created_atstringISO 8601 time.
started_atstring or nullNone
finished_atstring or nullNone
resultanyOnce succeeded: the same result POST /v1/tools/{tool} returns.
errorproblem details objectRFC 9457 Problem Details.
callbackobjectNone
callback.urlstringNone
callback.statusstringOne of pending, delivering, delivered, failed.
callback.attemptsintegerNone
callback.last_statusinteger or nullHTTP status of the last attempt; null when the receiver could not be reached.

Errors: 400, 401, 403, 413, 415, 422, 429. See Errors.

Example

curl http://127.0.0.1:7341/v1/jobs \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "pdf_run_batch",
    "input": {
      "inputs": ["report.pdf", "appendix.pdf"],
      "steps": [{ "action": "watermark", "options": { "text": "DRAFT" } }],
      "output_folder": "drafts"
    },
    "callback_url": "http://127.0.0.1:8080/hooks/superpdf"
  }'
Response
HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/jobs/job_f5a4c3fc-c43f-4655-8a35-f8821bf7cd4f

{
  "id": "job_f5a4c3fc-c43f-4655-8a35-f8821bf7cd4f",
  "tool": "pdf_run_batch",
  "status": "running",
  "progress": null,
  "created_at": "2026-10-11T01:39:03.888Z",
  "started_at": "2026-10-11T01:39:03.889Z",
  "finished_at": null,
  "callback": {
    "url": "http://127.0.0.1:8080/hooks/superpdf",
    "status": "pending",
    "attempts": 0,
    "last_status": null
  }
}

List jobs

GET/v1/jobs

Response

200 Jobs from this server process, newest first. Finished jobs are kept for an hour.

FieldTypeDescription
jobsarray of objectsNone
jobs[].idstringNone
jobs[].toolstringNone
jobs[].statusstringOne of queued, running, succeeded, failed.
jobs[].progressobject or nullLatest progress from tools that report it (merge, split, pipelines, batches).
jobs[].progress.progressnumberNone
jobs[].progress.totalnumberNone
jobs[].progress.messagestringNone
jobs[].created_atstringISO 8601 time.
jobs[].started_atstring or nullNone
jobs[].finished_atstring or nullNone
jobs[].resultanyOnce succeeded: the same result POST /v1/tools/{tool} returns.
jobs[].errorproblem details objectRFC 9457 Problem Details.
jobs[].callbackobjectNone
jobs[].callback.urlstringNone
jobs[].callback.statusstringOne of pending, delivering, delivered, failed.
jobs[].callback.attemptsintegerNone
jobs[].callback.last_statusinteger or nullHTTP status of the last attempt; null when the receiver could not be reached.

Errors: 401, 403. See Errors.

Example

Terminal
curl -s http://127.0.0.1:7341/v1/jobs \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN"
Response
{
  "jobs": [
    {
      "id": "job_c5ece8a8-5f0f-4121-97ec-9ca994a94c10",
      "tool": "pdf_run_batch",
      "status": "succeeded",
      "progress": {
        "progress": 2,
        "total": 2,
        "message": "2 of 2 files"
      },
      "created_at": "2026-10-11T01:55:36.410Z",
      "started_at": "2026-10-11T01:55:36.410Z",
      "finished_at": "2026-10-11T01:55:36.414Z",
      "result": {
        "outputs": [
          {
            "input": "/Users/<you>/Documents/superPDF/report.pdf",
            "output": "/Users/<you>/Documents/superPDF/drafts/report-processed.pdf",
            "pages": 4,
            "bytes": 2916
          },
          {
            "input": "/Users/<you>/Documents/superPDF/appendix.pdf",
            "output": "/Users/<you>/Documents/superPDF/drafts/appendix-processed.pdf",
            "pages": 1,
            "bytes": 1405
          }
        ],
        "failed": []
      }
    }
  ]
}

Get a job

GET/v1/jobs/{id}

Path parameters

ParameterTypeDescription
idstringThe job id from POST /v1/jobs.

Response

200 The job, with its result once it has succeeded.

FieldTypeDescription
idstringNone
toolstringNone
statusstringOne of queued, running, succeeded, failed.
progressobject or nullLatest progress from tools that report it (merge, split, pipelines, batches).
progress.progressnumberNone
progress.totalnumberNone
progress.messagestringNone
created_atstringISO 8601 time.
started_atstring or nullNone
finished_atstring or nullNone
resultanyOnce succeeded: the same result POST /v1/tools/{tool} returns.
errorproblem details objectRFC 9457 Problem Details.
callbackobjectNone
callback.urlstringNone
callback.statusstringOne of pending, delivering, delivered, failed.
callback.attemptsintegerNone
callback.last_statusinteger or nullHTTP status of the last attempt; null when the receiver could not be reached.

Errors: 401, 403, 404. See Errors.

Example

Terminal
curl -s http://127.0.0.1:7341/v1/jobs/$JOB \
  -H "Authorization: Bearer $SUPERPDF_API_TOKEN"
Response
{
  "id": "job_c5ece8a8-5f0f-4121-97ec-9ca994a94c10",
  "tool": "pdf_run_batch",
  "status": "succeeded",
  "progress": {
    "progress": 2,
    "total": 2,
    "message": "2 of 2 files"
  },
  "created_at": "2026-10-11T01:55:36.410Z",
  "started_at": "2026-10-11T01:55:36.410Z",
  "finished_at": "2026-10-11T01:55:36.414Z",
  "result": {
    "outputs": [
      {
        "input": "/Users/<you>/Documents/superPDF/report.pdf",
        "output": "/Users/<you>/Documents/superPDF/drafts/report-processed.pdf",
        "pages": 4,
        "bytes": 2916
      },
      {
        "input": "/Users/<you>/Documents/superPDF/appendix.pdf",
        "output": "/Users/<you>/Documents/superPDF/drafts/appendix-processed.pdf",
        "pages": 1,
        "bytes": 1405
      }
    ],
    "failed": []
  }
}

This document

GET/openapi.json

Response

200 The OpenAPI 3.1 document. No token needed.

A JSON object; the example below shows its fields.

Example

Terminal
curl -s http://127.0.0.1:7341/openapi.json | jq .info
Output
{
  "title": "superPDF local API",
  "version": "0.4.1",
  "description": "The superPDF tools over HTTP, served by `superpdf serve --allow-di…"
}