Inspecting Content

Document AI provides read-only endpoints for reviewing processed document content without downloading the original file.

Use them to retrieve:

  • A document outline
  • Extracted text and fields for one page
  • Key-value fields across the document
  • Detected signatures

These endpoints are available after processing has produced results.

View content in Shipwell

Open a completed run in the Run Inspector. The document viewer can display extracted values and their locations alongside the source page.

Get the document outline

The outline is the best starting point for programmatic inspection:

curlpython
Copy
Copied
curl "https://sandbox-api.shipwell.com/document-store/documents/<document-id>/outline" \
  -H "Authorization: Token <user-token>"
Copy
Copied
import requests

response = requests.get(
    "https://sandbox-api.shipwell.com/document-store/documents/<document-id>/outline",
    headers={"Authorization": "Token <user-token>"},
    timeout=30,
)
response.raise_for_status()
outline = response.json()

It returns:

  • Document and filename identifiers
  • Page count
  • Aggregated schema results
  • Per-page text, key-value, and signature counts
  • A result breakdown for split documents

For a split document, use result_breakdown[].result_id and page_numbers to identify the result slice containing a page.

Add run_id to inspect one run:

Copy
Copied
GET /document-store/documents/<document-id>/outline?run_id=<run-id>

Add result_id to inspect one result slice:

Copy
Copied
GET /document-store/documents/<document-id>/outline?result_id=<result-id>

Get one page

Use GET /document-store/documents/{id}/pages/{page_number} to retrieve extracted text, key-value fields, and signatures for one page. Add result_id when the document contains multiple result slices.

extracted_text_truncated indicates whether the returned page text reached the response limit.

List key-value fields

Retrieve key-value fields across the document:

Use GET /document-store/documents/{id}/kv-fields.

Available filters include:

  • page_number
  • key_contains
  • page
  • page_size — defaults to 200 and supports up to 1000
  • run_id
  • result_id

total reports the number of matches before pagination is applied.

See Signatures for detected regions and structured signature results.

Geometry

Geometry uses normalized coordinates from 0 to 1, with the origin at the top-left:

  • left — horizontal offset
  • top — vertical offset
  • width — region width
  • height — region height

Multiply these values by the rendered page dimensions to draw an overlay.

Geometry can be empty when a source format does not provide spatial coordinates. Build review interfaces that can still display the extracted value without a highlight.

Page numbering

Page numbers always refer to the uploaded parent document. A result created from pages 10–16 continues to use page numbers 10–16 rather than restarting at page 1.

For a split document, first retrieve the outline and select the result whose page_numbers contains the requested page.

Copyright © Shipwell 2025. All right reserved.