[ CLASSIFY API ]

Classify PDFs before you process them.

Send a PDF and a list of categories to /classify. The completed job returns a document-level classification and confidence score, plus per-page results for up to the first four pages.

[ OVERVIEW ]
What it does

Classify assigns a PDF to one of the categories you provide. The result includes the selected classification, its confidence score, and per-page classifications for up to the first four pages.

Who it's for

Teams building conditional pipelines that need to identify a document before choosing its extraction schema, storage destination, or review workflow.

What it solves

Sending every document through the same workflow wastes processing and produces mismatched output. Classify gives each document a routing signal before the next job starts.

[ USE CASES ]

Decide what it is before you decide what to do.

Document triage at upload

Assign an incoming PDF to a known category before the rest of its workflow runs.

Schema routing for Extract

Pick the extraction schema that matches the document type before a single field is pulled.

Conditional parse settings

Choose parsing options based on the returned category instead of applying one configuration to every file.

Pipeline branching

Fork the workflow on category: invoices to AP, contracts to legal, everything else to review.

Confidence-based review

Auto-process high-confidence matches and hold ambiguous ones for a human.

Custom routing categories

Choose category names that reflect the distinctions your workflow needs to make.

[ WHY UNSILOED ]

Why teams start their pipeline with Classify.

  • 01

    Categories you define

    Pass a name for each category. Descriptions are accepted, but classification is driven by distinct category names.

  • 02

    Document-level confidence

    The selected classification includes a score you can compare with a routing or review threshold.

  • 03

    Page-level results

    Multi-page responses show how each processed page was classified alongside the overall document result.

  • 04

    Threshold-based routing

    Set a confidence bar and send anything below it to human review instead of guessing.

  • 05

    Single- and multi-page PDFs

    Get a per-page breakdown alongside the overall result. Classification reads up to the first four pages, so test larger packets against your own files.

  • 06

    Ready for pipeline branching

    Feed the returned classification into conditional Parse, Extract, storage, or review steps.

[ HOW IT WORKS ]

4 steps from raw file to structured output.

  1. 1

    Send a PDF and categories

    POST pdf_file and a JSON categories array to /classify with your api-key header.

  2. 2

    Pages are analyzed

    Classify evaluates up to the first four pages against the supplied categories and records page-level results.

  3. 3

    Poll for completion

    GET /classify/{job_id} until the status is completed or failed.

  4. 4

    Route on the result

    Read result.classification and result.confidence, then apply your processing or review threshold.

classify.py
1 import os, json, time, requests
2
3 BASE = "https://prod.visionapi.unsiloed.ai"
4 HEADERS = {"api-key": os.environ["UNSILOED_API_KEY"]}
5
6 categories = [
7 {"name": "invoice"},
8 {"name": "purchase_order"},
9 {"name": "contract"}
10 ]
11
12 with open("unknown_document.pdf", "rb") as file:
13 response = requests.post(
14 f"{BASE}/classify", headers=HEADERS,
15 files={"pdf_file": file},
16 data={"categories": json.dumps(categories)}
17 )
18 response.raise_for_status()
19 job_id = response.json()["job_id"]
20
21 for _ in range(60):
22 response = requests.get(
23 f"{BASE}/classify/{job_id}", headers=HEADERS)
24 response.raise_for_status()
25 job = response.json()
26 if job["status"] == "completed": break
27 if job["status"] == "failed":
28 raise RuntimeError(job.get("error", "Classify failed"))
29 time.sleep(5)
30 else:
31 raise TimeoutError("Classify did not finish in 5 minutes")
32
33 result = job["result"]
34 print(result["classification"], result["confidence"])
[ BUILT FOR PRODUCTION ]

The same API from
prototype to scale.

Use the same submit-and-poll workflow from prototype through production. Page-based pricing starts with a free tier, with managed, VPC, on-premises, and air-gapped deployment options for larger workloads.

Read the docs
99.9%

uptime target on enterprise plans.

SOC 2GDPRVPC availableOn-premises availableAir-gapped available
[ THE PLATFORM ]

One API for the document pipeline.

Classify uses the same authentication and billing as every other capability. Combine it with Parse, Extract, Split, and Classify, or call it on its own.

[ FAQS ]

Classify
questions

  • Classify assigns the PDF to one of your supplied categories. Extract returns schema-defined fields from inside a PDF. Use classification first when the category determines which extraction schema or workflow should run.
  • Pass a JSON array of category objects, each with a name and an optional description. Classification is driven by the names, so choose distinct, unambiguous labels for the document types you expect.
  • Compare the returned confidence with a threshold validated on your own documents. Route low-confidence results to a fallback category or human review instead of processing them automatically.
  • The result object contains the document classification and confidence score. Multi-page jobs also include page_results with a classification and confidence for each processed page.
  • Yes. Classify returns an overall document result plus per-page classifications for up to the first four pages. Test larger packets from your own workflow. Processing is asynchronous, so poll the job endpoint for completion.
  • Pricing is based on pages processed, with a free tier and custom plans for higher-volume classification workflows.

See Unsiloed AI work on your own documents.

Tell us a little about your workflow and share a sample document. We’ll use it to show you a structured output during the call.

The accuracy, especially on tables, is meaningfully better than anything we tested. We evaluated over 15 solutions and Unsiloed was the only one that worked reliably.

Head of AI

Fortune 150 Bank, NY

Upload sample files you'd like us to run through Unsiloed. We'll use them to show you a sample structured output once we meet.