Skip to content

Structured output

The same fields out of every document, checked against the page they came from.

Pull the same fields out of every document as JSON, using a schema you define, then check each value against its source page. Add an outputSchema to a project pipeline, and DocSlurp writes a :structured JSON artifact for each document it processes, next to the Markdown, HTML and page images.

On this page

What you get

outputSchemaJSON Schema
{
  "type": "object",
  "properties": {
    "fiscalYear": { "type": "string" },
    "revenueUsdM": { "type": "number" },
    "operatingMarginPct": { "type": "number" }
  }
}
  1. Line 1: Set this as outputSchema in the project pipeline.
  2. Line 5: Ask for exactly the fields you need. Each one comes back under fields with its value, a confidence score and the page it was found on.

Artifactgrowth-plan-2027.pdf:structured

{ "overallPolicy": "auto-accept", "fields": { "revenueUsdM": { "value": 48.2, "confidence": 0.94, "evidence": [{ "text": "$48.2M", "pageNumber": 12 }] }, "fiscalYear": { … }, "operatingMarginPct": { … } }}

FY2027 Growth PlanSection 4

4.3 FY2027 projection

FY2027 revenue is projected at $48.2M, 12% ahead of plan.

12

growth-plan-2027.pdfp. 12 where revenueUsdM came from

Each field also carries a policy (auto-accept, needs-review or reject) and any validation errors. The values above are illustrative; the shape is the real artifact, shortened.

Over HTTP, GET /v1/documents/:id/structured returns { structured, uri }, or 404 when the document has no structured artifact. Server keys need the artifacts scope. Structured fields cost 1 credit per started 10 pages per document.

Extract and review

  1. Add a schema

    Set outputSchema in the project pipeline to a JSON Schema object that lists the fields you want.

  2. Upload a document

    Upload from the dashboard, SDK, CLI or HTTP API, and wait for the run to finish.

  3. Open the JSON

    Open the document from the project, then choose Structured JSON in its Preview tab.

  4. Check it against the page

    Search or ask about a field. Citations point to the page, with highlighted regions when available.

Find the source

Search results and chat responses carry citations with page numbers, heading paths, and optional regionBoxes. Open a result to see the page image with the cited regions highlighted.

Jump to