Skip to main content
POST
/
classify
curl -X POST "https://prod.visionapi.unsiloed.ai/classify" \
  -H "api-key: your-api-key" \
  -F "[email protected]" \
  -F 'categories=[{"name":"invoice","description":"Financial invoices"},{"name":"contract","description":"Legal contracts"},{"name":"receipt"}]'
{
  "job_id": "7e10f5cd-6d83-4b8e-9f80-ac103fd9b2f1",
  "status": "processing",
  "message": "Classification started",
  "quota_remaining": 450
}

Overview

The Classify Document endpoint analyzes PDF documents and assigns them to predefined categories based on their content, structure, and visual characteristics. This endpoint uses job-based processing where files are uploaded to cloud storage and processed asynchronously.
The endpoint supports both single-page and multi-page classification with detailed confidence scoring for each page. Files are uploaded to Supabase storage and processed in the background.

Request

pdf_file
file
required
The PDF file to classify. Maximum file size: 50MB
categories
string
required
JSON string containing array of category objects with name and optional description (e.g., [{"name":"invoice","description":"Financial invoices"}])

Response

job_id
string
Unique identifier for the classification job
status
string
Current status of the job (“processing”)
message
string
Human-readable status message
quota_remaining
number
Remaining API quota after this request

Examples

curl -X POST "https://prod.visionapi.unsiloed.ai/classify" \
  -H "api-key: your-api-key" \
  -F "[email protected]" \
  -F 'categories=[{"name":"invoice","description":"Financial invoices"},{"name":"contract","description":"Legal contracts"},{"name":"receipt"}]'
{
  "job_id": "7e10f5cd-6d83-4b8e-9f80-ac103fd9b2f1",
  "status": "processing",
  "message": "Classification started",
  "quota_remaining": 450
}

Job Status Checking

After starting a classification job, you can check its status using the job ID by making a GET request to /classify/{job_id}.

Job Status Values

  • processing: Job is currently being processed
  • completed: Job completed successfully with results available
  • failed: Job failed with error details

Authorizations

api-key
string
header
required

Body

multipart/form-data
categories
string
required

JSON string containing array of category objects with name and optional description. Example: [{"name":"invoice","description":"Financial invoices with itemized charges"},{"name":"contract","description":"Legal contracts and agreements"},{"name":"receipt"}]

pdf_file
file

PDF file to classify. Either pdf_file or file_url must be provided.

file_url
string

URL to a PDF file to classify. Either pdf_file or file_url must be provided. Example: https://example.com/document.pdf

Response

202 - application/json

Accepted - classification job started

job_id
string

Unique identifier for the classification job

status
string

Current job status (typically 'processing')

message
string

Status message about the job

quota_remaining
number

Remaining API quota after this request