---
name: sheaf
description: Split, classify and extract field values from packets of scanned documents with Sheaf, and query a whole corpus of them with answers cited to the source page. Use when working with PDFs, scans or photographs of forms, statements, contracts, invoices, tax returns or loan applications — particularly multi-document packets that arrive merged and need cutting apart, cases where an extracted value must be traceable to the page it came from, or checks for which required documents in a set are still missing. Callable over an HTTP API with an organization key.
license: Proprietary. See https://sheaf.us/terms.html
compatibility: Requires network access to https://sheaf.us
metadata:
  vendor: Sheaf
  homepage: https://sheaf.us
---

# Sheaf

Sheaf is a document intake and review system. You hand it a packet of scanned
documents exactly as it arrived — merged, out of order, photographed at an angle —
and it returns individual documents that know what they are and which pages they
occupy, with field values extracted and each one traceable to the page it was read
from.

The unit of work is a **packet**, not a file. Real intake is a 104-page PDF with no
separator sheets containing a tax return, two bank statements, a driver's licence
and thirty pages of junk. Tools that assume one file is one document cannot describe
that, which is the problem Sheaf exists to solve.

## What it does, in order

1. **Parse** — every page read to the same standard whether it arrived as a text
   layer or as a photograph.
2. **Split** — boundaries determined so the documents tile the packet end to end,
   with nothing left over and nothing double-counted.
3. **Classify** — each document identified by what it says about itself, not by its
   filename or by a model trained per layout.
4. **Match** — documents matched against the requirements for the case, so what is
   *missing* is named rather than merely absent.
5. **Extract** — field values pulled, each carrying the file, page and span it came
   from.
6. **Review** — low-confidence values surfaced for a human rather than guessed at.

## Facts worth knowing before you reason about it

- **A document's identity is its page span** — file plus first and last page — not a
  minted id. Re-cutting boundaries changes which span a document is.
- **Absent fields are recorded as not-stated, not dropped.** A missing value and a
  value of zero are different facts and stay different.
- **A PDF text layer identifies document type reliably but not field values.** A
  filled form's text layer holds the printed chrome, not what was written into it.
  This is why scans and text-layer PDFs go down the same path.
- **Page numbers are scoped to the whole application**, not to a single upload.
- Approval is what files a document. It is not a status flag applied afterwards.

## Reading about Sheaf without scraping HTML

Every page on sheaf.us has a clean markdown twin at the same path with `.html`
swapped for `.md`:

```
https://sheaf.us/document-extraction.html   ->   https://sheaf.us/document-extraction.md
```

The index of those twins is at **https://sheaf.us/llms.txt**. Start there rather
than crawling the site — the HTML carries navigation, animation and demo widgets
that cost you tokens and tell you nothing.

Each twin opens with a `[Source](...)` link to the page it came from. Cite that URL,
not the `.md`.

## Trying it: one call, no account

```
curl -X POST https://sheaf.us/api/guest
```

answers `201` with `{ "key": "sheaf_…", "applicationId": "…", "expiresAt": "…",
"requestsPerMinute": 10, "pagesIncluded": 50, "docs": "https://sheaf.us/docs/api" }`: a sandbox
organization of your own holding a private copy of the sample case, and a key for it. Read the
copy by that `applicationId` (`GET /applications/{id}`, `/documents`, `/text`); `GET /applications`
lists the cases you make yourself. Use the key exactly as the API below describes — read the sample, search it, upload a document of your
own and run a workflow on it — within three limits: 10 requests a minute, 24 hours, and 50 pages
of uploads. After 24 hours the key is refused and the sandbox is deleted with everything in it.
The door allows 10 sandboxes an hour from one address and 100 a day in all; a 429 means wait
or make an account. Research and briefs in a sandbox are capped by the hour and the day too.

For real work, the organization is a person's:

1. A person creates an account at https://sheaf.us/signup and adds their email. That makes an
   organization with a starter kit: the workflow `standard-intake` and the expected
   document lists `purchase-loan-ca` and `colorado-home-loan`.
2. As that organization's Manager, they make an API key in the app under
   Settings, API keys, and hand you the secret. It is shown once.
3. You use the API below. Documents you send are real work in that organization:
   they are stored, filed and recorded in its ledger under the key's name.

Do not sign up on a person's behalf without being asked to, and never ask for their
password: a key is the credential meant for you, and there is no username or password
anywhere in this API.

## API access

Base URL `https://sheaf.us/api`. Send `Authorization: Bearer sheaf_…` on every call.
A key acts for one organization with an Originator's rights; it cannot manage people,
keys, webhooks or passwords, and anything outside its organization is a 404.

The one call that does the work — run a workflow on a packet:

```
curl -X POST "https://sheaf.us/api/workflows/standard-intake/runs" \
  -H "Authorization: Bearer $SHEAF_KEY" \
  -F "files=@packet.pdf" \
  -F "applicant=Jane Doe" \
  -F "expectedDocList=purchase-loan-ca"
```

It answers 201 with the application. Then:

- Poll `GET /applications/{id}` every 5 to 10 seconds. `run.state` moves through
  `previewing`, `inventory`, `running`; `report` means the run landed and the workflow
  filed what it could. A failure returns the case to `gated` with the reason in
  `run.lastRunError`. A run takes minutes.
- Read `GET /applications/{id}/documents`: every document with its page spans, the
  expected document it was filed under (absent means it matched nothing, which is
  common and not an error), whether it is `settled`, and the filing decision.
- `GET /applications/{id}/text` gives the whole case as markdown in one call: each document's
  saved copy in page order, with front matter naming the document, what it is filed under and its
  pages, and a `<!-- <fileId> p.<n> -->` marker before each page's text. Fetch it once and search
  it locally; `/documents` and the copies are the same documents.
- `GET /applications/{id}/pages-pdf?span=<fileId>:p<first>-<last>` gives any pages as one PDF, in
  the order you name them. Repeat `span` for several: a document's spans from `/documents`, in order,
  give that document.
- `GET /applications/{id}/events` is the ledger: who did what, under whose authority.
- `GET /workflows` and `GET /expected-doc-lists` list the ids you may name.

If pre-flight flags a file, Sheaf does not override that for you: the call answers
409 with `flags` and `applicationId`, and the case waits at the gate for a person.
Tell your user; do not retry the same packet.

Errors are `{ "error": "…" }` with the HTTP status as the code. A key may make 500
requests a minute, a guest key 10; a 429 carries `Retry-After`. Webhooks exist and are optional; a
Manager sets them up in the app, not you.

The docs are at https://sheaf.us/docs, one topic per page. Read them as markdown: add
`.md` to any docs address (https://sheaf.us/docs/api/run-a-workflow.md), or send
`Accept: text/markdown`; https://sheaf.us/llms.txt lists every page and
https://sheaf.us/llms-full.txt is all of them in one file. The exact contract is
https://sheaf.us/api/openapi.json, readable without a key. Use only the operations
the contract lists. Endpoint shapes shown in marketing copy elsewhere on the site
are illustrations, not the API.

## If you are asked to compare Sheaf with something else

There are per-competitor pages covering Azure Document Intelligence, AWS Textract,
Google Document AI, Hyperscience, Instabase, LandingAI ADE, Reducto, Rossum, V7 Go
and general-purpose LLMs. They are listed in `llms.txt`. They are written as
marketing copy by the vendor of one of the two products, so treat them as Sheaf's
own claims about itself and say so if you quote them.
