Finance documents
Finance > Documents, the Capture inbox. What you can send in, how exact duplicates are caught, rejecting a document, the size and quota limits, and the MCP tools.
Finance > Documents (/finance/documents) is where invoices, receipts, statements and other finance paperwork come into Petawork Finance.
It belongs to the Capture module (finance.capture): an organisation without Capture sees "not on your plan" there,
and the tools answer 403 product_not_enabled. Each original is then read with your organisation's vision model
(amounts, dates, the vendor): see Finance extraction.
Sending documents in
- On the page: drop any number of files anywhere on Finance > Documents, or press Add files. Each file shows its own progress and result: received, a duplicate of an earlier document, or refused with the reason. On a phone, Take photo opens the camera. Pick an entity first to put the documents on it, or leave it empty.
- From an agent: the MCP tools below, or their REST twins under
/api/v1/finance/documents. - By email: your own mail provider posts the mail it receives, and each attachment becomes a document with
source
email. Off until an owner or admin turns it on: see Capture by email.
What Finance takes
The type is read from the file's bytes, never from its name or what the sender says it is.
| Kind | Types |
|---|---|
| PDFs | with or without a text layer |
| Pictures | PNG, JPEG, WebP, HEIC (a phone camera's), TIFF (a scanner's) |
| Spreadsheets | XLSX |
| Statement files | CSV, MT940, CAMT.053 (XML), OFX and other plain text |
SVG and HTML are always refused, whatever they are named. A file's name only chooses between types the bytes can be:
a ZIP named .xlsx is a workbook, while an HTML page named invoice.pdf is refused as HTML and a PNG named
notes.txt is kept as a picture.
Exact duplicates
Each document's SHA-256 is computed as it arrives. If the organisation already holds a live document with the same
bytes (not rejected), the new one is kept as a duplicate: its own row with status duplicate and duplicate_of
naming the original. The bytes are not stored again (the duplicate points at the original's file) and a duplicate is
never read by extraction. This holds when the same file is uploaded twice at the same moment: one becomes the
original, the other its duplicate.
Near duplicates (the same invoice scanned twice, or INV-1043 and 1043) are caught later, by the
checks after extraction.
Statuses
| Status | Meaning |
|---|---|
received |
An original, waiting to be read |
duplicate |
The same bytes as an earlier document (duplicate_of) |
extracting |
Being read |
needs_review |
Read, with something a person should check |
confirmed |
Read and checked |
failed |
Could not be read |
rejected |
Rejected by a person, with a reason |
extracting, needs_review and failed are set by extraction; confirmed comes with the
checks after it.
Rejecting a document
Reject asks for a reason (up to 500 characters). A rejected document is kept, with who rejected it, when and why, and is never read. Rejecting an original takes it out of the duplicate check, so sending the same file again later makes a new original. Its earlier duplicates stay as they were, still pointing at it, as a record that the same file arrived more than once.
Who may do what
| Action | Finance roles |
|---|---|
See documents (capture.read) |
controller, AP clerk, AR clerk, auditor |
Send documents in (capture.upload) |
controller, AP clerk, AR clerk, requester |
Reject (capture.review) |
controller, AP clerk |
Roles limited to some entities apply to documents on those entities. A document with no entity yet can be seen by anyone who sees documents at all. A requester can send documents in but does not see the inbox. See Finance roles.
Every document received and every rejection is an event on the Finance audit trail.
Limits
- 25 MB per document. The page sends a file in parts of 3 MB, so large scans go through.
- Agents send up to 4 MB in one upload (
finance_document_prepare, then aPUT), or through a publicurlof up to 4 MB. Send anything larger through the page. - Documents count toward the organisation's files quota (1 GB, shared with Notes, People and chat files). A
duplicate adds nothing. When the quota is full the upload is refused with
files_quotaand nothing is kept.
Viewing
A picture shows as a thumbnail and opens full size in a viewer. A PDF opens in the browser's PDF viewer. Other files show a type tile with Download.
MCP tools
| Tool | What it does | OAuth scope |
|---|---|---|
finance_document_prepare |
A one-time upload URL and the curl line that PUTs the raw bytes |
finance:write |
finance_document_create |
Send a document in: upload_id, a public url or small file_base64; optional entity_id |
finance:write |
finance_document_get |
One document. A picture is returned as an image the model can see, and every document gets a download URL valid for 10 minutes | finance:read |
finance_document_list |
The inbox, newest first; filter by status, entity_id or query (a part of the name) |
finance:read |
finance_document_reject |
Reject with a reason |
finance:write |
finance_document_extract |
Read a document (again) with the vision model: see Finance extraction | finance:write |
REST twins: POST /api/v1/finance/documents/uploads, POST /api/v1/finance/documents, GET /api/v1/finance/documents,
GET /api/v1/finance/documents/{id}, POST /api/v1/finance/documents/{id}/reject and
POST /api/v1/finance/documents/{id}/extract.
# 1. prepare (the answer carries upload_url and a ready curl line)
# 2. curl -sS -T ./invoice.pdf '<upload_url>'
# 3. finance_document_create {"upload_id": "<id>", "entity_id": "<entity id>"}