This guide covers the server-side API, where your backend uploads files and finalizes the collection. It’s a separate integration path from Truv Bridge — the client-side widget where users connect a payroll or bank account directly.
Intelligent intake
Document Processing handles whatever your users actually have. Instead of forcing them to label each file or upload one document at a time, you collect everything they send and Truv sorts out what counts.- Upload anything, get feedback up front. Users submit any mix of supported files — including phone photos. Truv checks each file on upload and reports problems through the
validationsflags and filestatusyou poll in Step 4: an unreadable file returnsis_readable: false, an oversized one returnsis_viable_size: false, and itsstatusbecomesinvalid. Surface that feedback so a user can retake a blurry photo before they finish, instead of failing verification hours later. - Truv recognizes what each file is. Every uploaded file is classified into recognized
documents, each with adocument_type. Files that aren’t a verification document are classified asOTHERand left out of finalization. The user doesn’t label anything. - Proceed as soon as the minimum is met. Because every document is classified, your app can check the recognized
documentsagainst your requirement, finalize only the documents that matter, and let the user continue once it’s satisfied.
Example — SNAP income verification. A requirement of two recent pay stubs is met even if the applicant uploads five files. Truv recognizes the two pay stubs among them; you finalize those two
document_ids and let the applicant proceed, ignoring the rest.How document processing works
Document Processing is a collection-based workflow. You group a user’s files into a collection, Truv recognizes what each file is, and you finalize the documents you want into a report.| Object | What it is |
|---|---|
| Collection | The container for one or more users’ uploaded files. Created once, then reused for every call. |
| Uploaded file | A raw file you sent (is_valid, is_readable, size, type checks). One file can contain several documents. |
| Recognized document | An AI-classified document found inside a file — a PAYSTUB, a W2, a page range, and the user it belongs to. |
| Link | The result of finalizing documents. Processed asynchronously into the standard income/employment report. |
Step 1: Identify or create a user [Server-side]
Retrieve an existinguser_id or create a new user.
If AIM Check will be used, ensure at least the last 4 digits of the SSN are included during user creation.
id. You’ll need it in subsequent steps.
Step 2: Create a document collection [Server-side]
Initialize the collection and upload documents in a single call. Each file is Base64-encoded and queued for validation and AI classification automatically.collection_id. Save this for all subsequent calls.
Accepted formats and limits
Users rarely have a clean PDF. Truv accepts photos taken on a phone alongside scanned documents:| Constraint | Value |
|---|---|
File formats (mime_type) | application/pdf, image/jpeg, image/png, image/tiff, image/webp, image/x-ms-bmp, image/heic, image/heif |
| File size | 1 KB – 10 MB per file |
| Files per request | Up to 10 |
Assign documents to users
Each document can be tied to a user with eitheruser_id (Truv ID) or external_user_id (your system’s ID) — never both on the same document. To create or update users in the same call, pass a users array; Truv can also match documents to those users by name.
Step 3: Add files incrementally (Optional) [Server-side]
For save-and-resume workflows, add up to 10 more files to an existing collection:Step 4: Monitor validation and classification [Server-side]
Document processing is asynchronous. Poll the collection until every uploaded file reaches a terminalstatus.
uploaded_files — file-level validation. Each file carries a validations object:
| Field | Meaning |
|---|---|
is_valid | Overall validation status |
is_unique | Not a duplicate of another file in the collection |
is_readable | File can be opened and parsed |
is_accessible | File is not password-protected |
is_viable_size | File is within the 1 KB – 10 MB range |
is_supported_type | MIME type is on the accepted list |
status moves through these values:
| Status | Meaning |
|---|---|
pending / validating / processing | Still in flight — keep polling |
validated | Passed validation, classification in progress |
successful | Validated and classified — ready to finalize |
invalid | Failed one or more validation checks (see validations) |
duplicate | Matches a file already in the collection |
failed | Could not be processed |
documents — AI-recognized records, each with a document_type (and document_subtype where relevant), the borrower’s name, page range, and the user it’s matched to. A recognized document’s status is successful, failed, or rejected.
Example response:
How duplicate detection works
Truv flags duplicates by file content, not file name. A file is markedis_unique: false with status: "duplicate" when its content matches another file already in the same collection.
- Identical content, different file names — flagged as duplicates.
- Same file name, different content — both treated as unique.
- Detection is scoped to a single collection: Truv compares each file against the others in that collection only.
is_unique: true) and flags every additional copy as a duplicate. A duplicate is not an error — the file is returned in the normal response, and you choose which documents to process by passing their document_ids to finalize.
Step 5: Finalize the collection [Server-side]
Once documents are validated, finalize to trigger report generation. Finalize the whole collection, or passdocument_ids to select only the documents you need — this is how you proceed with the valid documents and ignore everything else a user uploaded.
Use all recognized documents:
product_type is income (default) or employment. The response groups results by user and returns a link_id for each:
link_id.
Step 6: Retrieve verified data [Server-side]
Truv processes the Link asynchronously. Wait for the Task to complete before fetching the report. Recommended: Listen for a webhook Wait for atask-status-updated webhook with status: done and the matching link_id, then fetch the report.
Alternative: Poll finalization status
status of done means the report is ready. no_data, config_error, error, and unavailable are the other terminal states.
Fetch the report:
- Income & Employment
- Employment Only
Supported document types
AI classification returns adocument_type for each recognized document. Income and employment documents drive verification reports; the remaining types are recognized for routing and identity workflows.
document_type | Description |
|---|---|
PAYSTUB | Pay statements / pay stubs |
W2 | W-2 wage and tax statements |
F1099 | 1099 forms (see subtypes below) |
F1040 | Individual income tax return |
BANK_STATEMENT | Bank statements |
DRIVER_LICENSE | Driver’s licenses |
PASSPORT | Passports |
GREEN_CARD | Permanent resident cards |
UTILITY_BILL | Utility bills |
LEASE_AGREEMENT | Lease agreements |
INSURANCE_HOME_POLICY | Home insurance policies |
INSURANCE_AUTO_POLICY | Auto insurance policies |
LETTER_OF_VERIFICATION | Letters of verification |
VOLUNTEER_LETTER | Volunteer / community service letters |
OTHER | Recognized file that isn’t a verification document |
Document subtypes
When Truv recognizes a more specific variant, the recognized document also carries adocument_subtype:
document_subtype | Description |
|---|---|
F1099_MISC | 1099-MISC — miscellaneous income |
F1099_NEC | 1099-NEC — nonemployee compensation |
F1099_DIV | 1099-DIV — dividends and distributions |
F1099_INT | 1099-INT — interest income |
F1099_G | 1099-G — government payments |
F1099_R | 1099-R — retirement distributions |
F_SSA1099 | SSA-1099 — Social Security benefit statement |
VOL_TRANSCRIPT | Volunteer transcript |
VOL_HOURS_LOG | Volunteer hours log |
For sandbox testing, use the test documents — the sandbox uses file names to determine results rather than actual file contents.
Detect suspicious documents
Truv runs fraud detection on every document and may setis_suspicious: true on the report while still returning results, or fail the document outright for high-confidence fraud. See Fraud and Manual Review for how to handle flagged and failed documents.
API Reference
Create Collection
Initialize a document collection
Upload Files
Add files to an existing collection
Get Collection
Check validation and AI classification status
Finalize Collection
Trigger report generation
Next steps
Test Documents
Sample PDFs for sandbox testing
Income Data Guide
Interpret income and employment data from reports
Webhooks
Set up notifications for processing completion
Document Processing Demo
Upload pay stubs, W-2s, and tax returns. See structured data extraction in action.