40+ pre-built document types across 7 categories — ready to use with zero configuration
Library Overview
The 9thSense Library is a curated set of 40+ pre-built document types that ship with every workspace. Each type encodes years of domain knowledge: which fields to extract, how to validate them, which model to invoke, and how to auto-detect the document from a raw file.
You pass a context_id to the extraction API and get back a structured JSON object. No prompt engineering. No schema design.
Categories at a glance
| Category | Count | Examples |
|---|---|---|
| Identity | 7 | Aadhaar, PAN, Passport, Driving License, Voter ID, Ration Card, Vehicle RC |
| Financial | 10 | Bank Statement, Cheque, Salary Slip, Form 16, ITR, Invoice, DP Statement, Utility Bill |
| Business | 8 | GST Certificate, CIN, UDYAM, FSSAI, Drug License, Board Resolution, Shop Establishment, Labour Certificate |
| Travel | 3 | Flight Ticket, Hotel Booking, Visa |
| Scene | 6 | Merchant Shopfront, Merchant Interior, Merchant Neighbourhood, Shop Inventory, Site Safety Audit, Vehicle Inspection |
| Classification | 3 | Deepfake Detection, Synthetic Document Check, Face Liveness |
| Other | 3 | Marksheet, University Offer Letter, Election Affidavit |
How each type works
Every library document type has four components:
context_id — The API identifier you pass when requesting extraction. Example: kyc_aadhaar, bank_statement, gst_certificate.
output_schema — The exact fields the model extracts. Each field has a name, type, and description. For example, Aadhaar extracts aadhaar_number, name, date_of_birth, address, gender, photo_present, and more.
validation_rules — Deterministic checks applied after extraction — the same rule family that powers Goal Rules. Rules include:
required— field must be present and non-nullregex— value must match a pattern (e.g. PAN must match^[A-Z]{5}[0-9]{4}[A-Z]$)format— value must conform to a format likedate_isooruppercasemask— field is masked in logs and audit output (applies to Aadhaar number, account numbers, PAN)
Analysis type — Most types perform structured extraction (printed/handwritten text, photos, stamps, tables, mixed layouts). The Classification category instead runs fraud checks — deepfake detection, liveness, and synthetic document detection — returning a verdict + confidence rather than extracted fields.
Using a library type
Pass context_id to the extraction endpoint from any SDK or directly via the API.
import { NinthSense } from "@9thsense/sdk";
const client = new NinthSense({ apiKey: process.env.NINTHSENSE_API_KEY });
const result = await client.verify.document({
doc_type: "kyc_aadhaar",
file_url: "https://storage.example.com/docs/aadhaar.jpg",
});
console.log(result.output);
// {
// aadhaar_number: "XXXX XXXX 5678",
// name: "Priya Sharma",
// date_of_birth: "1990-04-15",
// gender: "F",
// address: "123 MG Road, Bengaluru, Karnataka 560001",
// photo_present: true,
// qr_code_present: true
// }
Or via the REST API directly:
curl -X POST https://api.9thsense.ai/v1/verify \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"context_id": "kyc_aadhaar",
"file_url": "https://storage.example.com/docs/aadhaar.jpg"
}'
Creating custom document types
If the library does not cover a document type you need, you can create your own.
Option 1 — Define it manually:
POST /v1/document-types
{
"context_id": "employee_id_card",
"display_name": "Employee ID Card",
"output_schema": {
"employee_name": "string",
"employee_id": "string",
"department": "string or null",
"valid_until": "YYYY-MM-DD or null"
},
"validation_rules": {
"employee_name": { "required": true },
"employee_id": { "required": true }
}
}
Option 2 — Generate from samples:
Upload two or more example documents to the discover endpoint and let 9thSense infer the schema automatically:
POST /v1/document-types/discover
{ "sample_urls": ["https://...", "https://..."] }
Option 3 — Generate from description:
POST /v1/document-types/generate
{ "description": "A car insurance policy page showing policy number, premium amount, insured vehicle, and validity period" }
Custom types follow the same API surface as library types — same extraction call, same validation rules.
Explore by category
- Identity Documents — Aadhaar, PAN, Passport, Driving License, Voter ID, Ration Card, Vehicle RC
- Financial Documents — Bank Statement, Cheque, Salary Slip, Form 16, ITR, Invoice, and more
- Business Documents — GST, CIN, UDYAM, FSSAI, Drug License, Board Resolution, and more
- Travel Documents — Flight Ticket, Hotel Booking, Visa
- Scene Understanding — Merchant verification, site safety, vehicle inspection
- Classification — Deepfake, synthetic document, and liveness checks
- Other — Marksheet, University Offer Letter, Election Affidavit