Subjects

What is a Subject?

A Subject models something your business tracks that is made of several documents — a purchase, a patient, a shipment, a claim. Each instance is a Case, and Tavnit files every incoming document into the right Case and extracts it with the right flow.

A flow handles one kind of document. A Subject sits one level up: it says “a purchase is a quote, a purchase order and an invoice”, gives every purchase a reference such as PT-0042, and keeps all of that purchase's documents, runs and checks together on one page.

Beta

Subjects is a Beta feature. It is visible to every organisation, and its screens may still change.

ConceptWhat it is
SubjectThe definition: its document types, reference prefix, intake email and checks.
CaseOne instance of the Subject, with a reference (PT-0042), a unique name, a workflow status and an open or closed state.
Document typeA typed slot in every Case (Quote, Invoice…), each tied to the flow that extracts it.
Held documentA document Tavnit could not file with certainty. It waits for a person to assign it.

When to use a Subject

  • Several different documents belong to the same real-world thing, and you want them side by side
  • Documents arrive by email over days or weeks, and each one must land on the right file
  • You want to run comparisons or checklists across the documents of one Case — quotes against each other, an invoice against its order
  • A partner or an agent sends documents that carry your reference number
Subjects vs Collections

A Collection answers “what kind of document is this?” and sends it to a flow. A Subject also answers “which purchase does it belong to?” — and it answers that without AI, by reference or exact name.

Creating a Subject

  1. 1Open Subjects and click “New Subject”.
  2. 2Answer “What makes up each case?”: From your flows (pick the documents that make up a Case — one document type per flow), From an existing subject (duplicates its document types and checks) or Start from scratch.
  3. 3Give it a Name and a Reference prefix of 1–8 letters or digits, such as PT. Tavnit warns you if another Subject already uses the prefix.
  4. 4Optionally set the Case label (singular and plural) — for example “Purchase” and “Purchases”. The Subject's pages then say “New purchase” instead of the generic term.
  5. 5Click Create, then review the Document types tab.

The reference prefix cannot be changed after creation. References already issued have to stay valid, so choose a prefix you are happy to see on every email and filename.

Document types

Each document type is a slot in every Case, processed by one flow. When a document is filed into a slot, Tavnit starts a run of that flow, and the run's results appear on the Case.

Add a type from the Document types tab with a Name (e.g. “Quote”) and a Flow. Two switches control each type:

SwitchEffect
MultipleOff: a Case holds one document of this type, and a second one is held for review instead of being filed. On: the Case accepts any number (several quotes, for instance).
RequiredMarks the type as expected on every Case. The Case page shows a Required tag and a tick once a completed document of that type is present.

Cases

A Case is opened by hand, over the API, or by an agent. Its reference is issued automatically from the prefix and a counter — gap-free and never reused.

  1. 1On the Subject, click New <case label> (for example “New purchase”).
  2. 2Type a name. It must be unique within the Subject, because a document whose email subject or filename equals the name is filed into this Case.
  3. 3Click Create. The Case gets the next reference, such as PT-0043.

The Case page brings everything together:

  • The reference, name, workflow status and Open or Closed state
  • Its documents grouped by document type, each with its routing status and a View results link to the run
  • A drop zone to upload documents straight into the Case (you choose the document type when the Subject has more than one)
  • Email this <case label> — the Case's own address, when email intake is on
  • The Checks section, with the matches and inspections already run on the Case
Workflow status and open/closed are separate

Workflow statuses (Settings tab) are your own comma-separated labels, such as new, in_progress, done, with a Default status for new Cases. Change a Case's status from the selector on its page. Open and closed is a separate lifecycle that controls intake — see below.

How documents find their Case

Filing a document into a Case never uses AI. Tavnit looks for the Case reference, then for an exact Case name. If neither gives a single clear answer, the document is held for a person rather than guessed.

This applies to documents sent to the intake email, uploaded with Add docs on the Subject, or posted to the Subject over the API.

References are read tolerantly: PT-0042, pt 42 and PT0042 all mean Case 42. Tavnit checks the places a reference can appear in order of authority, and the first one that contains a reference decides:

SourceOrder checked
EmailCase address (plus-tag) → email subject → email body → attachment filename → document text
Upload or APIFilename → document text
  • One reference that matches a Case: the document is filed there.
  • Two different references in the same place: held as ambiguous.
  • A reference that matches no Case: held — a mistyped number never falls back to a name match.
  • No reference anywhere: Tavnit compares the email subject and the filename (without extension) with Case names — whole value, ignoring case and surrounding spaces. Never a partial match, never the body.

Once the Case is known, Tavnit picks the document type. A Subject with one document type needs no decision. With several types, an AI classifier reads the first page and chooses among them — this is the only AI step.

Uploading straight into a Case skips routing

A document dropped on a Case page, sent to the Case's own address, or posted to the Case over the API already knows its Case. Uploads on the Case page and over the API also name the document type, so nothing is classified.

Email intake

  1. 1Open the Subject's Email intake tab and turn the switch on.
  2. 2Copy the Intake address and forward documents to it, or give it to suppliers and partners.
  3. 3Optionally restrict which senders are accepted with the sender whitelist on the same tab.

Three things route an emailed attachment to its Case:

  • A reference such as PT-0042 in the subject, body or filename. Replies keep the subject line, so a whole thread follows the Case automatically.
  • The Case's own address: the intake address with the reference added as a plus-tag, e.g. intake+PT-0042@…. It is shown on the Case page as Email this <case label>.
  • An email subject or filename that exactly equals a Case name.

Each attachment is handled separately. For the address formats and the attachment types Tavnit accepts, see email integration.

Held documents and manual triage

Anything Tavnit cannot file with certainty lands in Held documents, with the reason written under it. Nothing is processed until someone decides.

For each held document you can:

  • Assign it: pick a Case and a document type. Tavnit starts the flow run on the stored file — no new upload. Assigning to a closed Case is allowed, because a person chose it explicitly.
  • New <case label> from doc: open a new Case and file the document into it in one step.
  • Discard it.

A file Tavnit cannot process at all — an unsupported type or an invalid file — shows as Failed instead of Held. Document statuses are Queued, Routing, Routed, Held, Failed and Discarded.

Closing and reopening a Case

Click Close on a Case when its file is complete. From then on, documents routed to it automatically are held instead of filed, so a late reply cannot reopen finished work by accident. The Case page says it is closed, and uploads on the Case page are hidden.

Reopen restores automatic intake. Closing is always reversible.

Case checks: Matchers and Inspectors

Bind Matchers and Inspectors to the Subject once, then run them on any Case from its page. They work on the Case's completed runs — nothing is uploaded or extracted again.

CheckSet up on the Checks tabRun from the Case
MatcherBind a matcher. It compares documents of the matcher's flow — for example quotes side by side.Needs at least two completed documents of that flow on the Case. The row shows how many eligible runs there are.
InspectorBind an inspector and map each of its inputs to a document type (by default, the type that uses the same flow).Adopts the Case's completed runs. If a required input has no completed document, Tavnit lists what is missing.

Click Run next to a check. Its result is listed on the Case with its status and, for inspections, the verdict; open it for the full comparison or checklist.

Agents that deliver to a Subject

An agent can file what it collects straight into a Subject. In the agent's delivery settings, choose the Subject, the field that gives the Case name, which captured files to file as which document type, optional fields to Store as case params, and what to do If the case already exists: Skip or Add missing documents.

Cases are matched by name, so running the agent again never creates a duplicate. Documents filed this way show an Agent link back to the agent run.

API

The Subject endpoints use the same X-API-Key header as the rest of the REST API:

EndpointWhat it does
POST /api/subjects/<subject_id>/processSend a document to the Subject; it is routed to a Case exactly like an upload. Returns 202 with a subject_doc_id.
POST /api/cases/<case_id>/docsUpload straight into a Case (doc_type_id is required when the Subject has several types). Returns the run_id.
POST /api/subjects/<subject_id>/casesOpen a Case with a name and optional params object. The reference is issued for you.
GET /api/subjects/<subject_id>/casesList Cases, filtered by state, status or search, up to 200 per page.
GET /api/cases/<case_id>Read a Case and its documents, each with the run_id to poll for results.
POST /api/cases/<case_id>/closeClose a Case; /reopen reopens it.

Who can do what

  • Admins and Owners create Subjects and bind Matchers and Inspectors. The creator of a Subject can also edit or delete it.
  • Every member except HITL Only users works Cases: opens them, uploads, triages held documents, changes status, closes, reopens and runs checks.

A Subject can be deactivated instead of deleted: it stops accepting new documents and Cases, and Reactivate brings it back. See user roles.

Troubleshooting

Held reasonWhat to do
No case reference or case name foundAsk senders to include the reference, use the Case's own address, or assign it by hand.
Ambiguous: multiple case references foundThe email or file mentions two Cases. Assign it to the right one.
Reference … matches no caseThe number is wrong or the Case doesn't exist yet. Open the Case, then assign the document.
Case … is closedReopen the Case, or assign the document to it explicitly.
Document type … already filledTurn on Multiple for that type, or discard the duplicate.
No clear document typeThe classifier could not choose. Assign the type by hand; clearer flow names and descriptions help it next time.
Flow for document type … is unavailableThe type's flow was deleted or deactivated. Point the type at an active flow.
Document types need an active flow

A document type whose flow is inactive or deleted cannot take documents. Check the Document types tab after reorganising your flows.