← All updates

Inspect any PDF's structure tree with /api/v1/pdf/tags

A new endpoint that walks an existing PDF's StructTreeRoot and gives you back the full tag tree — as JSON for agents and tooling, or as a human-readable outline PDF. Every enhance run now leaves one too.

apiaccessibilityenhancetagging

/api/v1/pdf/validate answers "is this PDF compliant?". POST /api/v1/pdf/tags answers a different question: "what is the structure?" Useful even when nothing is failing — you can finally see what tags a PDF actually carries, what alt-text it ships with, and which figures are missing alt entirely.

Drop a PDF on /tags for the interactive form, or call the API directly.

By default the endpoint returns the tag tree as JSON. The nested tree field mirrors the PDF's StructTreeRoot — each node has a role (H1, P, Figure, Table, …), a 1-based page, the mcids attached, and the four accessibility text properties screen readers care about (alt, actualText, lang, title). Role-mapped custom tags resolve through the document's RoleMap so authoring-specific names collapse to their standard parents. The summary block surfaces elementCount, figureCount, figuresMissingAlt, and a roleCounts histogram — enough to spot a problem at a glance.

curl -X POST https://makespdf.com/api/v1/pdf/tags \
  -H "Authorization: Bearer $MAKESPDF_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"pdfBase64\":\"$(base64 -i sample.pdf)\"}"

Pass Accept: application/pdf instead and you get back a rendered indented-outline PDF of the same tree — the same structure data, but shaped for skimming on screen or sending to a reviewer. Untagged PDFs return tagged: false, which is a cheap pre-flight before /enhance.

Enhance now emits one too. Every successful in-place enhance attaches a tag-report artifact alongside the existing alt-text-report, so you can pull the full structure record of the remediated PDF without re-uploading. List artifacts the usual way:

curl -H "Authorization: Bearer $MAKESPDF_API_KEY" \
  "https://makespdf.com/api/v1/artifacts?kind=tag-report"

The endpoint is free, capped at 25 MB and 200 requests/hour, and requires a Bearer token or session — see the API docs for the full contract.