We’ll walk through classifying a single document end to end. For parsing the document into Markdown or extracting structured fields instead, see the Parse Quickstart or Getting Started With Extract.Documentation Index
Fetch the complete documentation index at: https://docs.unsiloed.ai/llms.txt
Use this file to discover all available pages before exploring further.
Before You Start
- Get an Unsiloed AI API key by signing up.
- Have a document to classify (PDF, DOCX, PPTX, JPG, PNG, etc.).
- Decide on the candidate categories you want the document scored against.
Keep your API key out of source control. The examples below read it from the
UNSILOED_API_KEY environment variable.1. Submit a Document With Categories
The/classify endpoint accepts a multipart upload with two fields: pdf_file (the document) and categories (a JSON list of category objects, each with a name and an optional description). It returns a job_id you can poll for results.
The JavaScript example uses ES modules (top-level
await, import). Save it as script.mjs or add "type": "module" to your package.json. You’ll also need Node.js 18 or newer, which exposes fetch, FormData, and Blob as globals.2. Poll for Results
PollingGET /classify/{job_id} returns the job’s current state. A status of completed indicates the result is ready, failed indicates the job errored, and any other value (such as processing) means the job is still running.

