Classify Document
Lightweight routing step that runs before /extract. Given a raw document
(file upload or file_url) and a set of caller-defined classifications,
it returns which classification the document belongs to — plus that classification’s
pipeline_id, so you can send the document to the right pipeline next.
By default, it evaluates the first five pages. For PDFs and images,
billing is based on the effective page_range. For Office and HTML
files, billing applies to every page.
Billed at 0.5 credits per page — half the /extract rate.
Accepted document types are identical to /extract, including the same
size limits and URL validation.
Set async: true to return immediately with a job_id for polling via
GET /job/. Otherwise processes synchronously.
Overview
/extract settings) a document should be routed to.POST /classify is a lightweight routing step that runs before /extract. Given a raw document and a set of caller-defined classifications, it returns which classification the document belongs to — plus that classification’s pipeline_id, so you can send the document to the right pipeline next.
Why classify before extract: extraction settings (chunking, schema, tables, …) differ per document type, so you need to know the type before you extract. By default, /classify evaluates the first five pages and costs 0.5 credits per page — half the /extract rate. See Credits.
Accepted Document Types
/classify uses the same upload path as /extract — the same accepted formats, the same size limits, and both direct file uploads and file_url.
.webp, .csv, .xlsb) are converted on upload before classification, exactly as they are for /extract.
page_range, while Office and HTML files are billed for every page. See Credits.Async Mode
Setasync: true to return immediately with a job ID for polling. See Polling for Results. On completion, the job’s result carries the same body as the sync response.
/classify is currently REST-only: it is not yet exposed as a Python/TypeScript SDK method, a CLI command, or an MCP tool. Call it over HTTP as shown below.Request
Provide eitherfile (multipart upload) or file_url (JSON body) — not both.
Request Body
Classify Config (classify_config)
<name>is any label you choose; Pulse returns exactly one of these names.descriptiontells Pulse what belongs in each class — make it specific and mutually distinct.pipeline_idis optional routing metadata. When provided, it must reference a pipeline your organization owns (otherwise the request is rejected withPIPELINE_003). The matched classification’spipeline_idis echoed back so you can route the document next.
Always include a catch-all classification
Define the escape hatch yourself: add a catch-all classification and leave off itspipeline_id.
null classify_output.pipeline_id then becomes your “don’t extract this” signal:
PROC_001 error in the case where Pulse answers off-list, since any name outside your classifications keys is rejected.
Response
Synchronous Response (200)
Async Response (202)
Example Usage
Example Response
classification is returned at the top level for quick access and repeated inside classify_output, which keeps the routing decision (classification, pipeline_id, page_range) self-contained for pipeline consumers. Both always hold the same value.Routing to a Pipeline
/classify only tells you which pipeline to use — it does not execute it. Take the returned pipeline_id and run that pipeline with the same document; its own extraction settings then apply.
classify can also be used as the first step of an ad-hoc pipeline, where it classifies the raw document before the downstream steps run. It cannot be combined with batch_extract (classify needs a single document), and it is currently supported with inline config only.
Credits
/classify is billed at 0.5 credits per page — half the /extract rate (1 credit/page).
- PDFs / images: billed for the pages in the (defaulted/clamped)
page_range. - Office / HTML: billed for every page, even when
page_rangeis smaller.
Error Responses
Best Practices
Include a catch-all classification
Include a catch-all classification
pipeline_id gives unexpected documents somewhere to land and gives you a null pipeline_id to branch on. See Always include a catch-all classification.Write specific, mutually distinct descriptions
Write specific, mutually distinct descriptions
Keep the default page range unless you have a reason not to
Keep the default page range unless you have a reason not to
page_range has no hard cap, but large ranges scale credits linearly.Treat the result as routing guidance
Treat the result as routing guidance
/classify is persisted — the routed pipeline’s /extract produces the durable output.Authorizations
Body
Request body for classifying a document. Provide exactly one of
file (multipart upload) or file_url (JSON body). In
multipart/form-data requests, classify_config is sent as a JSON
string form field.
Candidate classifications the document is matched against.
Document to upload directly (multipart/form-data only). Required unless file_url is provided.
Public or pre-signed URL that Pulse will download and classify. Required unless file is provided.
Pages to inspect, e.g. "1-5" or "1,3,5-7". Defaults to the first 5 pages, clamped to the document length. For Office/HTML formats, every page is billed.
If true, returns immediately with a job_id for polling via GET /job/{jobId}. Otherwise processes synchronously.
Optional parent job id for tracking.
Response
Classification result (when async=false or omitted)
Result of document classification.
The winning classification name — one of the keys from the request's classifications object.
Details of the winning classification.
Identifier of the request for tracking and support.
Number of credits consumed by this request.