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.
Routing step (optional, runs before extraction) — Classify takes a raw document, not a saved extraction. Use it to decide which pipeline (and therefore which /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.
Category
Extensions
PDF
.pdf
Images
.jpg, .jpeg, .png, .tif, .tiff, .webp, .gif, .bmp
Office
.docx, .pptx, .xlsx, .xlsm, .xls, .xlsb
Data
.csv
Web
.html, .htm
Formats that need normalizing (.webp, .gif, .bmp, .csv, .xlsb) are converted on upload before classification, exactly as they are for /extract.
How a format is handled affects billing, not acceptance: PDFs and images are billed only for the pages in the effective page_range, while Office and HTML files are billed for every page. See Credits.
Async Mode
Set async: 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) orfile_url (JSON body) — not both.
Request Body
Field
Type
Required
Description
file
file
XOR
The document to classify (multipart/form-data upload).
file_url
string
XOR
URL of the document to classify (application/json body).
classify_config
object
Yes
Candidate classifications (JSON string when sent as a multipart form field).
page_range
string
No
Pages to inspect, e.g. "1-5" or "1,3,5-7". Default: first 5 pages, clamped to the document length.
async
boolean
No
If true, returns immediately with a job_id for polling. Default: false.
parent_job_id
uuid
No
Optional parent job ID for tracking.
Classify Config (classify_config)
{ "classifications": { "<name>": { "description": "string, required — what documents belong to this class", "pipeline_id": "string, optional — pipeline to route matches to" } // ... one entry per candidate classification }}
<name> is any label you choose; Pulse returns exactly one of these names.
description tells Pulse what belongs in each class — make it specific and mutually distinct.
pipeline_id is optional routing metadata. When provided, it must reference a pipeline your organization owns (otherwise the request is rejected with PIPELINE_003). The matched classification’s pipeline_id is echoed back so you can route the document next.
Always include a catch-all classification
Classification is forced-choice./classify always returns one of the names you supplied — there is no built-in “none of the above”, no null result, and no confidence score. A document that matches none of your classifications is not rejected: it is assigned to whichever class comes closest, with nothing in the response to flag it as a poor match.
Define the escape hatch yourself: add a catch-all classification and leave off its pipeline_id.
{ "classifications": { "bank_statement": { "description": "Bank or account statements: balances, transaction lists, deposits and withdrawals.", "pipeline_id": "b1a2c3d4-..." }, "invoice": { "description": "Invoices or bills requesting payment: line items, amounts due, payment terms.", "pipeline_id": "e5f6a7b8-..." }, "unrecognized": { // No pipeline_id — so classify_output.pipeline_id comes back null "description": "Any document that does not clearly match one of the other classifications — including unrelated document types, blank or illegible scans, and standalone cover pages." } }}
A nullclassify_output.pipeline_id then becomes your “don’t extract this” signal:
Branch on it before you route — send those documents to manual review instead of into a pipeline built for a different document type.
Give the catch-all a description that says what it absorbs, not just the word “other”. A thin description competes poorly against your detailed classes, and Pulse will keep preferring a wrong-but-well-described class over a vague catch-all. For the same reason, keep the specific descriptions tight — a broad description like “financial documents” pulls in documents the catch-all should have caught.
Without a catch-all there is no clean “no match” outcome — you get either a confidently wrong classification, or a PROC_001 error in the case where Pulse answers off-list, since any name outside your classifications keys is rejected.
Response
Synchronous Response (200)
Field
Type
Description
classification
string
The winning classification name — always one of your classifications keys (never a “no match” value)
curl -X POST https://api.runpulse.com/classify \ -H "x-api-key: YOUR_API_KEY" \ -F "file=@document.pdf" \ -F 'classify_config={ "classifications": { "bank_statement": { "description": "Bank or account statements: balances, transaction lists, deposits and withdrawals.", "pipeline_id": "b1a2c3d4-..." }, "invoice": { "description": "Invoices or bills requesting payment: line items, amounts due, payment terms.", "pipeline_id": "e5f6a7b8-..." }, "unrecognized": { "description": "Any document that does not clearly match one of the other classifications, including unrelated types and illegible scans." } } }'
curl -X POST https://api.runpulse.com/classify \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "file_url": "https://example.com/document.pdf", "page_range": "1-5", "classify_config": { "classifications": { "bank_statement": { "description": "Bank or account statements: balances, transaction lists.", "pipeline_id": "b1a2c3d4-..." }, "invoice": { "description": "Invoices or bills requesting payment.", "pipeline_id": "e5f6a7b8-..." }, "unrecognized": { "description": "Any document that does not clearly match one of the other classifications, including unrelated types and illegible scans." } } } }'
import jsonimport requestsresp = requests.post( "https://api.runpulse.com/classify", headers={"x-api-key": "YOUR_API_KEY"}, files={"file": open("document.pdf", "rb")}, data={ "classify_config": json.dumps({ "classifications": { "bank_statement": { "description": "Bank or account statements: balances, transaction lists.", "pipeline_id": "b1a2c3d4-...", }, "invoice": { "description": "Invoices or bills requesting payment.", "pipeline_id": "e5f6a7b8-...", }, "unrecognized": { "description": "Any document that does not clearly match one of the other classifications, including unrelated types and illegible scans.", }, } }) },)result = resp.json()print(result["classification"], result["classify_output"]["pipeline_id"])
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_range is smaller.
A classification’s pipeline_id doesn’t exist for your organization
400
FILE_*
Unsupported file type, file too large, or bad/blocked URL (same as /extract)
401
Unauthorized
Invalid or missing API key
429
Rate limit exceeded
Too many requests
500
PROC_001
Processing failed — including the case where Pulse returns a name that isn’t one of your classifications keys (add a catch-all)
Best Practices
Include a catch-all classification
Classification is forced-choice, so a document that fits none of your classes is still assigned to one of them. A catch-all with no pipeline_id gives unexpected documents somewhere to land and gives you a nullpipeline_id to branch on. See Always include a catch-all classification.
Write specific, mutually distinct descriptions
The description tells Pulse what belongs in each class. Describe what the documents contain, not just their name, and make classes clearly distinguishable from each other. This matters most for the catch-all, which loses to better-described classes when its own description is vague.
Keep the default page range unless you have a reason not to
The first 5 pages are usually enough to identify a document type. An explicit page_range has no hard cap, but large ranges scale credits linearly.
Treat the result as routing guidance
Classification is a probabilistic hint, not a guarantee, and the response carries no confidence score — a borderline guess and a certain match look identical. Validate downstream where correctness matters. Nothing from /classify is persisted — the routed pipeline’s /extract produces the durable output.
Authorizations
x-api-key
string
header
required
Headers
Pulse-Version
enum<string>
default:1
The API version. These pages document version 1.
Available options:
1
Body
multipart/form-dataapplication/json
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.
classify_config
object
required
Candidate classifications the document is matched against.
Show child attributes
file
file
Document to upload directly (multipart/form-data only). Required unless file_url is provided.
file_url
string<uri>
Public or pre-signed URL that Pulse will download and classify. Required unless file is provided.
page_range
string
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.
async
boolean
default:false
If true, returns immediately with a job_id for polling via GET /job/{jobId}. Otherwise processes synchronously.
parent_job_id
string<uuid>
Optional parent job id for tracking.
Response
Classification result (when async=false or omitted), or the single-use download stub when force_url was set.
Option 1
Option 2
Result of document classification.
classification
string
required
The winning classification name — one of the keys from the request's classifications object.
classify_output
object
required
Details of the winning classification.
Show child attributes
job_id
string<uuid>
Identifier of the request for tracking and support.
credits_used
number<float> | null
Number of credits consumed by this request.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Pulse API","colors":{"primary":"#3573f6","light":"#4a90f9","dark":"#2561ef"},"logo":{"light":"https://mintcdn.com/pulseai/OJ897TEZf8bV6lk8/logo-icon.svg?fit=max\u0026auto=format\u0026n=OJ897TEZf8bV6lk8\u0026q=85\u0026s=1062873c6d0f5dd9971e379f2210c1cb","dark":"https://mintcdn.com/pulseai/OJ897TEZf8bV6lk8/logo-icon.svg?fit=max\u0026auto=format\u0026n=OJ897TEZf8bV6lk8\u0026q=85\u0026s=1062873c6d0f5dd9971e379f2210c1cb"},"favicon":"https://mintcdn.com/pulseai/OJ897TEZf8bV6lk8/logo-icon.svg?fit=max\u0026auto=format\u0026n=OJ897TEZf8bV6lk8\u0026q=85\u0026s=1062873c6d0f5dd9971e379f2210c1cb","api":{"openapi":{"source":"api-reference/openapi.yml","overlays":["api-reference/pulse-version.overlay.yaml"]}},"appearance":{"default":"light","strict":true},"background":{"color":{"light":"#ffffff","dark":"#000000"}},"navbar":{"links":[{"href":"https://platform.runpulse.com","label":"Platform"},{"href":"mailto:support@trypulse.ai","label":"Support"}],"primary":{"type":"button","label":"Get API Key","href":"https://platform.runpulse.com/"}},"footer":{"socials":{"x":"https://x.com/Pulse__AI","linkedin":"https://www.linkedin.com/company/pulse-ai-corp"}},"fonts":{"heading":{"family":"Inria Serif"},"body":{"family":"Geist"}},"icons":{"library":"fontawesome"},"integrations":{"posthog":{"apiKey":"phc_FutnpUqAQasGvZ2zQSA1mt9uu14YLiO85JV69tm0cYz"}},"banner":{"content":"**Pulse API v2 is here.** Upgrading from v1? Read [Moving from V1](/v2/moving-from-v1).","dismissible":true},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"pulseai","hasAudioNarration":false,"actualSubdomain":"pulseai","customDomains":["docs.runpulse.com"],"gitSource":{"type":"github","owner":"pulse-software-corp","repo":"pulse-api","deployBranch":"pulse-dev","contentDirectory":"docs-site","isPrivate":true,"mountPath":"","label":"","_id":"6aea3a8ca753b7b0d57a1a6e"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af7adea73417820f2ea77c4","clientVersion":"0.0.4377","searchFilterCounts":[{"language":"default","tag":"API Reference","count":201},{"language":"default","tag":"Documentation","count":84},{"language":"default","tag":"Errors","count":46},{"language":"default","tag":"Codes","count":45},{"language":"default","tag":"Configs","count":42},{"language":"default","tag":"Cookbooks","count":40},{"language":"default","tag":"Platform Reference","count":28},{"language":"default","tag":"Core Concepts","count":19},{"language":"default","tag":"Agent Tools","count":16},{"language":"default","tag":"Pipeline Steps","count":14}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":".build-examples{position:relative;padding-left:48px}.build-examples::before{content:'';position:absolute;left:23px;top:48px;bottom:48px;width:2px;background-color:rgba(255, 255, 255, 0.1)}.example{display:flex;align-items:flex-start;margin-bottom:48px;position:relative}.icon-container{position:relative;left:-48px;margin-right:-24px;width:46px;height:46px;border-radius:12px;background:#1c1c1c;border:1px solid rgba(255, 255, 255, 0.1);display:flex;align-items:center;justify-content:center;z-index:1}.icon-container i{font-size:20px;color:#ffffff}.content{flex:1}.content h3{margin:0 0 8px 0;font-size:20px;font-weight:500}.content p{margin:0;color:rgba(255, 255, 255, 0.7);line-height:1.5}.nav-logo-name{display:flex!important;color:#ffffff;font-size:1.2rem;font-weight:500}.logo-title{display:block!important;visibility:visible!important;opacity:1!important}img[src*=\"/images/platform/\"]{display:block;width:auto;max-width:100%;height:auto;margin:16px auto 24px;background:#ffffff;border:1px solid rgba(15, 23, 42, 0.14);border-radius:8px;box-shadow:0 1px 1px rgba(15, 23, 42, 0.04)}html[class~=\"dark\"] img[src*=\"/images/platform/\"]{background:#020617;border-color:rgba(226, 232, 240, 0.16);box-shadow:0 1px 1px rgba(0, 0, 0, 0.28)}figure.frame img{max-height:440px;width:auto}.mdx-content[data-page-href*=\"/v2/\"] .mermaid svg{max-height:460px}#content-area:has(.api-section) #page-title{font-size:28px;line-height:1.25}#content-area:has(.api-section) .mt-2.text-lg.prose,#content-area:has(.api-section) .mt-2.text-lg.prose p{font-size:14px;line-height:1.6}.api-section-heading-title{margin-top:1rem}.api-section-heading{row-gap:0.5rem}.api-section .pt-6.pb-4{padding-top:0.25rem;padding-bottom:0.25rem}.primitive-param-field>.py-6,.object-param-field>.py-6{padding-top:0.75rem;padding-bottom:0.75rem}.primitive-param-field>.py-6>.mt-4,.object-param-field>.py-6>.mt-4{margin-top:0.25rem}[data-component-part=\"field-info-pill\"]{word-break:normal;overflow-wrap:anywhere}[data-pulse-more]>div>.param-head{cursor:pointer}[data-pulse-more]>div>.param-head::before{content:'';position:absolute;left:-16px;top:8px;width:6px;height:6px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;color:rgb(120 113 108);transform:rotate(-45deg);transition:transform 0.15s}[data-pulse-open]>div>.param-head::before{transform:rotate(45deg);top:6px}[data-pulse-extra]:not([data-pulse-shown]){display:none}[data-pulse-extra]{margin-top:0.5rem}details[data-pulse-children]{margin-top:0.25rem;border:0}details[data-pulse-children]>summary{display:none}details[data-pulse-children]>.expandable-content{margin:0;padding:0 0 0 1rem;border-top:0;border-left:1px solid rgb(231 229 228)}html.dark details[data-pulse-children]>.expandable-content{border-left-color:rgb(255 255 255 / 0.1)}.method-nav-pill{width:auto}.method-nav-pill>[data-pulse-method]{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border-radius:5px;font-size:0;color:var(--pulse-method-color);background:var(--pulse-method-tint)}.method-nav-pill>[data-pulse-method]::before{content:'';width:13px;height:13px;background-color:currentColor;-webkit-mask:var(--pulse-method-icon) center / contain no-repeat;mask:var(--pulse-method-icon) center / contain no-repeat}[data-pulse-method=\"post\"]{--pulse-method-color: #1d4ed8;--pulse-method-tint: #dbeafe;--pulse-method-icon: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10'/%3E%3Cpath d='M7 17 17 7'/%3E%3C/svg%3E\")}[data-pulse-method=\"get\"]{--pulse-method-color: #15803d;--pulse-method-tint: #dcfce7;--pulse-method-icon: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 7 7 17'/%3E%3Cpath d='M17 17H7V7'/%3E%3C/svg%3E\")}[data-pulse-method=\"del\"],[data-pulse-method=\"delete\"]{--pulse-method-color: #b91c1c;--pulse-method-tint: #fee2e2;--pulse-method-icon: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E\")}[data-pulse-method=\"patch\"],[data-pulse-method=\"put\"]{--pulse-method-color: #b45309;--pulse-method-tint: #fef3c7;--pulse-method-icon: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z'/%3E%3Cpath d='m15 5 4 4'/%3E%3C/svg%3E\")}html.dark [data-pulse-method=\"post\"]{--pulse-method-color: #93c5fd;--pulse-method-tint: rgb(59 130 246 / 0.2)}html.dark [data-pulse-method=\"get\"]{--pulse-method-color: #86efac;--pulse-method-tint: rgb(34 197 94 / 0.2)}html.dark [data-pulse-method=\"del\"],html.dark [data-pulse-method=\"delete\"]{--pulse-method-color: #fca5a5;--pulse-method-tint: rgb(239 68 68 / 0.2)}html.dark [data-pulse-method=\"patch\"],html.dark [data-pulse-method=\"put\"]{--pulse-method-color: #fcd34d;--pulse-method-tint: rgb(245 158 11 / 0.2)}[data-testid=\"try-it-button\"]{display:none}#content-area div:has(>div>div>.method-pill),#content-area div:has(>.method-pill){border:0;padding:0;background:none}#content-area div:has(>.method-pill){gap:0.5rem}.method-pill[data-pulse-method]{display:inline-flex;align-items:center;gap:4px;padding:1px 6px;border-radius:5px;font-size:12px;font-weight:500;line-height:18px;color:var(--pulse-method-color);background:var(--pulse-method-tint)}.method-pill[data-pulse-method]::before{content:'';width:12px;height:12px;background-color:currentColor;-webkit-mask:var(--pulse-method-icon) center / contain no-repeat;mask:var(--pulse-method-icon) center / contain no-repeat}#content-area div:has(>.method-pill) [data-component-part=\"scroll-area-content\"] div{font-size:13px;font-weight:400;color:rgb(82 81 78)}html.dark #content-area div:has(>.method-pill) [data-component-part=\"scroll-area-content\"] div{color:rgb(255 255 255 / 0.6)}"}]}
{"page":{"pagePath":"api-reference/endpoint/classify","slug":"/api-reference/endpoint/classify","pageMetadata":{"title":"Classify Document","openapi":"api-reference/openapi.yml POST /classify","description":"Lightweight routing step that runs **before** `/extract`. Given a raw document\n(file upload or `file_url`) and a set of caller-defined classifications,\nit returns which classification the document belongs to — plus that classification's\n`pipeline_id`, so you can send the document to the right pipeline next.\n\nBy default, it evaluates the first five pages. For PDFs and images,\nbilling is based on the effective `page_range`. For Office and HTML\nfiles, billing applies to every page.\n\nBilled at **0.5 credits per page** — half the `/extract` rate.\n\nAccepted document types are identical to `/extract`, including the same\nsize limits and URL validation.\n\nSet `async: true` to return immediately with a job_id for polling via\nGET /job/{jobId}. Otherwise processes synchronously.","href":"/api-reference/endpoint/classify"},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n strong: \"strong\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"Lightweight routing step that runs \", _jsx(_components.strong, {\n children: \"before\"\n }), \" \", _jsx(_components.code, {\n children: \"/extract\"\n }), \". Given a raw document\\n(file upload or \", _jsx(_components.code, {\n children: \"file_url\"\n }), \") and a set of caller-defined classifications,\\nit returns which classification the document belongs to — plus that classification’s\\n\", _jsx(_components.code, {\n children: \"pipeline_id\"\n }), \", so you can send the document to the right pipeline next.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"By default, it evaluates the first five pages. For PDFs and images,\\nbilling is based on the effective \", _jsx(_components.code, {\n children: \"page_range\"\n }), \". For Office and HTML\\nfiles, billing applies to every page.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Billed at \", _jsx(_components.strong, {\n children: \"0.5 credits per page\"\n }), \" — half the \", _jsx(_components.code, {\n children: \"/extract\"\n }), \" rate.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Accepted document types are identical to \", _jsx(_components.code, {\n children: \"/extract\"\n }), \", including the same\\nsize limits and URL validation.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Set \", _jsx(_components.code, {\n children: \"async: true\"\n }), \" to return immediately with a job_id for polling via\\nGET /job/\", \". Otherwise processes synchronously.\"]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,hr:`hr`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Accordion,AccordionGroup,CodeBlock,CodeGroup,Heading,Info,Note,Table,Tip,Warning}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!AccordionGroup)_missingMdxReference(`AccordionGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Routing step (optional, runs before extraction)`}),` — Classify takes a `,_jsx(_components.strong,{children:`raw document`}),`, not a saved extraction. Use it to decide which pipeline (and therefore which `,_jsx(_components.a,{href:`/api-reference/endpoint/extract`,children:_jsx(_components.code,{children:`/extract`})}),` settings) a document should be routed to.`]})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`POST /classify`}),` is a lightweight routing step that runs `,_jsx(_components.strong,{children:`before`}),` `,_jsx(_components.code,{children:`/extract`}),`. Given a raw document and a set of caller-defined classifications, it returns which classification the document belongs to — plus that classification’s `,_jsx(_components.code,{children:`pipeline_id`}),`, so you can send the document to the right pipeline next.`]}),`\n`,_jsxs(_components.p,{children:[`Why classify `,_jsx(_components.em,{children:`before`}),` extract: extraction settings (chunking, schema, tables, …) differ per document type, so you need to know the type before you extract. By default, `,_jsx(_components.code,{children:`/classify`}),` evaluates the first five pages and costs `,_jsx(_components.strong,{children:`0.5 credits per page`}),` — half the `,_jsx(_components.code,{children:`/extract`}),` rate. See `,_jsx(_components.a,{href:`#credits`,children:`Credits`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`accepted-document-types`,children:`Accepted Document Types`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`/classify`}),` uses the same upload path as `,_jsx(_components.a,{href:`/api-reference/endpoint/extract`,children:_jsx(_components.code,{children:`/extract`})}),` — the same accepted formats, the same size limits, and both direct file uploads and `,_jsx(_components.code,{children:`file_url`}),`.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Category`}),_jsx(_components.th,{children:`Extensions`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`PDF`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`.pdf`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Images`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`.jpg`}),`, `,_jsx(_components.code,{children:`.jpeg`}),`, `,_jsx(_components.code,{children:`.png`}),`, `,_jsx(_components.code,{children:`.tif`}),`, `,_jsx(_components.code,{children:`.tiff`}),`, `,_jsx(_components.code,{children:`.webp`}),`, `,_jsx(_components.code,{children:`.gif`}),`, `,_jsx(_components.code,{children:`.bmp`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Office`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`.docx`}),`, `,_jsx(_components.code,{children:`.pptx`}),`, `,_jsx(_components.code,{children:`.xlsx`}),`, `,_jsx(_components.code,{children:`.xlsm`}),`, `,_jsx(_components.code,{children:`.xls`}),`, `,_jsx(_components.code,{children:`.xlsb`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Data`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`.csv`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Web`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`.html`}),`, `,_jsx(_components.code,{children:`.htm`})]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Formats that need normalizing (`,_jsx(_components.code,{children:`.webp`}),`, `,_jsx(_components.code,{children:`.gif`}),`, `,_jsx(_components.code,{children:`.bmp`}),`, `,_jsx(_components.code,{children:`.csv`}),`, `,_jsx(_components.code,{children:`.xlsb`}),`) are converted on upload before classification, exactly as they are for `,_jsx(_components.code,{children:`/extract`}),`.`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`How a format is handled affects billing, not acceptance: PDFs and images are billed only for the pages in the effective `,_jsx(_components.code,{children:`page_range`}),`, while Office and HTML files are billed for every page. See `,_jsx(_components.a,{href:`#credits`,children:`Credits`}),`.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`async-mode`,children:`Async Mode`}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`async: true`}),` to return immediately with a job ID for polling. See `,_jsx(_components.a,{href:`/api-reference/endpoint/poll`,children:`Polling for Results`}),`. On completion, the job’s result carries the same body as the sync response.`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`/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.`]})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`request`,children:`Request`}),`\n`,_jsxs(_components.p,{children:[`Provide `,_jsx(_components.strong,{children:`either`}),` `,_jsx(_components.code,{children:`file`}),` (multipart upload) `,_jsx(_components.strong,{children:`or`}),` `,_jsx(_components.code,{children:`file_url`}),` (JSON body) — not both.`]}),`\n`,_jsx(Heading,{level:`3`,id:`request-body`,children:`Request Body`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Required`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`file`})}),_jsx(_components.td,{children:`file`}),_jsx(_components.td,{children:`XOR`}),_jsx(_components.td,{children:`The document to classify (multipart/form-data upload).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`file_url`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`XOR`}),_jsx(_components.td,{children:`URL of the document to classify (application/json body).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`classify_config`})}),_jsx(_components.td,{children:`object`}),_jsx(_components.td,{children:`Yes`}),_jsxs(_components.td,{children:[`Candidate classifications (JSON `,_jsx(_components.strong,{children:`string`}),` when sent as a multipart form field).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`page_range`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[`Pages to inspect, e.g. `,_jsx(_components.code,{children:`\"1-5\"`}),` or `,_jsx(_components.code,{children:`\"1,3,5-7\"`}),`. Default: first 5 pages, clamped to the document length.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`async`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[`If `,_jsx(_components.code,{children:`true`}),`, returns immediately with a `,_jsx(_components.code,{children:`job_id`}),` for `,_jsx(_components.a,{href:`/api-reference/endpoint/poll`,children:`polling`}),`. Default: `,_jsx(_components.code,{children:`false`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`parent_job_id`})}),_jsx(_components.td,{children:`uuid`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Optional parent job ID for tracking.`})]})]})]}),`\n`,_jsxs(Heading,{level:`3`,id:`classify-config-classify_config`,children:[`Classify Config (`,_jsx(_components.code,{children:`classify_config`}),`)`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`jsonc`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`jsonc`,children:_jsxs(_components.code,{language:`jsonc`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"classifications\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"\u003cname>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"description\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string, required — what documents belong to this class\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"pipeline_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string, optional — pipeline to route matches to\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // ... one entry per candidate classification`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`\u003cname>`}),` is any label you choose; Pulse returns exactly one of these names.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`description`}),` tells Pulse what belongs in each class — make it specific and mutually distinct.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`pipeline_id`}),` is `,_jsx(_components.strong,{children:`optional routing metadata`}),`. When provided, it must reference a pipeline your organization owns (otherwise the request is rejected with `,_jsx(_components.code,{children:`PIPELINE_003`}),`). The matched classification’s `,_jsx(_components.code,{children:`pipeline_id`}),` is echoed back so you can route the document next.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`always-include-a-catch-all-classification`,children:`Always include a catch-all classification`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Classification is forced-choice.`}),` `,_jsx(_components.code,{children:`/classify`}),` always returns one of the names you supplied — there is no built-in “none of the above”, no `,_jsx(_components.code,{children:`null`}),` result, and no confidence score. A document that matches none of your classifications is not rejected: it is assigned to whichever class comes closest, with nothing in the response to flag it as a poor match.`]})}),`\n`,_jsxs(_components.p,{children:[`Define the escape hatch yourself: add a catch-all classification and `,_jsxs(_components.strong,{children:[`leave off its `,_jsx(_components.code,{children:`pipeline_id`})]}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`jsonc`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`jsonc`,children:_jsxs(_components.code,{language:`jsonc`,numberOfLines:`16`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"classifications\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"bank_statement\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"description\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bank or account statements: balances, transaction lists, deposits and withdrawals.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"pipeline_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"b1a2c3d4-...\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"invoice\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"description\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Invoices or bills requesting payment: line items, amounts due, payment terms.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"pipeline_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"e5f6a7b8-...\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"unrecognized\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // No pipeline_id — so classify_output.pipeline_id comes back null`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"description\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Any document that does not clearly match one of the other classifications — including unrelated document types, blank or illegible scans, and standalone cover pages.\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`A `,_jsx(_components.code,{children:`null`}),` `,_jsx(_components.code,{children:`classify_output.pipeline_id`}),` then becomes your “don’t extract this” signal:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"classification\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"unrecognized\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"classify_output\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"classification\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"unrecognized\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"pipeline_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"page_range\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1-5\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Branch on it before you route — send those documents to manual review instead of into a pipeline built for a different document type.`}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`Give the catch-all a description that says what it absorbs, not just the word “other”. A thin description competes poorly against your detailed classes, and Pulse will keep preferring a wrong-but-well-described class over a vague catch-all. For the same reason, keep the specific descriptions tight — a broad description like “financial documents” pulls in documents the catch-all should have caught.`})}),`\n`,_jsxs(_components.p,{children:[`Without a catch-all there is no clean “no match” outcome — you get either a confidently wrong classification, or a `,_jsx(_components.code,{children:`PROC_001`}),` error in the case where Pulse answers off-list, since any name outside your `,_jsx(_components.code,{children:`classifications`}),` keys is rejected.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(Heading,{level:`3`,id:`synchronous-response-200`,children:`Synchronous Response (200)`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`classification`})}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[`The winning classification name — always one of your `,_jsx(_components.code,{children:`classifications`}),` keys (`,_jsx(_components.a,{href:`#always-include-a-catch-all-classification`,children:`never a “no match” value`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`classify_output.classification`})}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[`Same as `,_jsx(_components.code,{children:`classification`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`classify_output.pipeline_id`})}),_jsx(_components.td,{children:`uuid | null`}),_jsxs(_components.td,{children:[`The matched classification’s `,_jsx(_components.code,{children:`pipeline_id`}),`, or `,_jsx(_components.code,{children:`null`}),` if it had none — see `,_jsx(_components.a,{href:`#always-include-a-catch-all-classification`,children:`catch-all classifications`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`classify_output.page_range`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`The effective page range used for classification (after defaulting/clamping)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`job_id`})}),_jsx(_components.td,{children:`uuid`}),_jsx(_components.td,{children:`Identifier of the request`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`credits_used`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`Credits deducted for this call`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`async-response-202`,children:`Async Response (202)`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`job_id`})}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[`Job ID for `,_jsx(_components.a,{href:`/api-reference/endpoint/poll`,children:`polling`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`status`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`\"pending\"`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`message`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Human-readable description`})]})]})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`example-usage`,children:`Example Usage`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`curl (file upload)`,numberOfLines:`18`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`18`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.runpulse.com/classify`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"x-api-key: YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"file=@document.pdf\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'classify_config={`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"classifications\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"bank_statement\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"description\": \"Bank or account statements: balances, transaction lists, deposits and withdrawals.\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"pipeline_id\": \"b1a2c3d4-...\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"invoice\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"description\": \"Invoices or bills requesting payment: line items, amounts due, payment terms.\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"pipeline_id\": \"e5f6a7b8-...\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"unrecognized\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"description\": \"Any document that does not clearly match one of the other classifications, including unrelated types and illegible scans.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`curl (file URL)`,numberOfLines:`22`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`22`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.runpulse.com/classify`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"x-api-key: YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"file_url\": \"https://example.com/document.pdf\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"page_range\": \"1-5\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"classify_config\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"classifications\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"bank_statement\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"description\": \"Bank or account statements: balances, transaction lists.\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"pipeline_id\": \"b1a2c3d4-...\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"invoice\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"description\": \"Invoices or bills requesting payment.\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"pipeline_id\": \"e5f6a7b8-...\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"unrecognized\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"description\": \"Any document that does not clearly match one of the other classifications, including unrelated types and illegible scans.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`27`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`27`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`resp `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.runpulse.com/classify\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"x-api-key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` files`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"file\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"document.pdf\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"rb\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"classify_config\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: json.dumps({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"classifications\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"bank_statement\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"description\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bank or account statements: balances, transaction lists.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"pipeline_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"b1a2c3d4-...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"invoice\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"description\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Invoices or bills requesting payment.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"pipeline_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"e5f6a7b8-...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"unrecognized\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"description\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Any document that does not clearly match one of the other classifications, including unrelated types and illegible scans.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`result `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` resp.json()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(result[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"classification\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`], result[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"classify_output\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"pipeline_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`3`,id:`example-response`,children:`Example Response`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"classification\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"bank_statement\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"classify_output\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"classification\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"bank_statement\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"pipeline_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"b1a2c3d4-...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"page_range\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1-5\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"job_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"e3b0c442-...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"credits_used\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2.5`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`classification`}),` is returned at the top level for quick access and repeated inside `,_jsx(_components.code,{children:`classify_output`}),`, which keeps the routing decision (`,_jsx(_components.code,{children:`classification`}),`, `,_jsx(_components.code,{children:`pipeline_id`}),`, `,_jsx(_components.code,{children:`page_range`}),`) self-contained for pipeline consumers. Both always hold the same value.`]})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`routing-to-a-pipeline`,children:`Routing to a Pipeline`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`/classify`}),` only tells you `,_jsx(_components.em,{children:`which`}),` pipeline to use — it does not execute it. Take the returned `,_jsx(_components.code,{children:`pipeline_id`}),` and run that pipeline with the same document; its own extraction settings then apply.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`classify`}),` can also be used as the `,_jsx(_components.strong,{children:`first step of an ad-hoc pipeline`}),`, where it classifies the raw document before the downstream steps run. It cannot be combined with `,_jsx(_components.code,{children:`batch_extract`}),` (classify needs a single document), and it is currently supported with inline config only.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`credits`,children:`Credits`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`/classify`}),` is billed at `,_jsx(_components.strong,{children:`0.5 credits per page`}),` — half the `,_jsx(_components.code,{children:`/extract`}),` rate (1 credit/page).`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`PDFs / images:`}),` billed for the pages in the (defaulted/clamped) `,_jsx(_components.code,{children:`page_range`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Office / HTML:`}),` billed for every page, even when `,_jsx(_components.code,{children:`page_range`}),` is smaller.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`See the full rate table in `,_jsx(_components.a,{href:`/api-reference/introduction#credit-usage`,children:`Credit Usage`}),`.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`error-responses`,children:`Error Responses`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Error`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`REQ_004`})}),_jsxs(_components.td,{children:[`Missing `,_jsx(_components.code,{children:`classify_config`}),` or empty `,_jsx(_components.code,{children:`classifications`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`REQ_002`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`classify_config`}),` is not valid JSON`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`REQ_006`})}),_jsxs(_components.td,{children:[`Invalid or out-of-range `,_jsx(_components.code,{children:`page_range`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`PIPELINE_003`})}),_jsxs(_components.td,{children:[`A classification’s `,_jsx(_components.code,{children:`pipeline_id`}),` doesn’t exist for your organization`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`FILE_*`})}),_jsxs(_components.td,{children:[`Unsupported file type, file too large, or bad/blocked URL (same as `,_jsx(_components.code,{children:`/extract`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:`Unauthorized`}),_jsx(_components.td,{children:`Invalid or missing API key`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`429`}),_jsx(_components.td,{children:`Rate limit exceeded`}),_jsx(_components.td,{children:`Too many requests`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`500`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`PROC_001`})}),_jsxs(_components.td,{children:[`Processing failed — including the case where Pulse returns a name that isn’t one of your `,_jsx(_components.code,{children:`classifications`}),` keys (`,_jsx(_components.a,{href:`#always-include-a-catch-all-classification`,children:`add a catch-all`}),`)`]})]})]})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`best-practices`,children:`Best Practices`}),`\n`,_jsxs(AccordionGroup,{children:[_jsx(Accordion,{title:`Include a catch-all classification`,id:`include-a-catch-all-classification`,children:_jsxs(_components.p,{children:[`Classification is forced-choice, so a document that fits none of your classes is still assigned to one of them. A catch-all with no `,_jsx(_components.code,{children:`pipeline_id`}),` gives unexpected documents somewhere to land and gives you a `,_jsx(_components.code,{children:`null`}),` `,_jsx(_components.code,{children:`pipeline_id`}),` to branch on. See `,_jsx(_components.a,{href:`#always-include-a-catch-all-classification`,children:`Always include a catch-all classification`}),`.`]})}),_jsx(Accordion,{title:`Write specific, mutually distinct descriptions`,id:`write-specific-mutually-distinct-descriptions`,children:_jsx(_components.p,{children:`The description tells Pulse what belongs in each class. Describe what the documents contain, not just their name, and make classes clearly distinguishable from each other. This matters most for the catch-all, which loses to better-described classes when its own description is vague.`})}),_jsx(Accordion,{title:`Keep the default page range unless you have a reason not to`,id:`keep-the-default-page-range-unless-you-have-a-reason-not-to`,children:_jsxs(_components.p,{children:[`The first 5 pages are usually enough to identify a document type. An explicit `,_jsx(_components.code,{children:`page_range`}),` has no hard cap, but large ranges scale credits linearly.`]})}),_jsx(Accordion,{title:`Treat the result as routing guidance`,id:`treat-the-result-as-routing-guidance`,children:_jsxs(_components.p,{children:[`Classification is a probabilistic hint, not a guarantee, and the response carries no confidence score — a borderline guess and a certain match look identical. Validate downstream where correctness matters. Nothing from `,_jsx(_components.code,{children:`/classify`}),` is persisted — the routed pipeline’s `,_jsx(_components.code,{children:`/extract`}),` produces the durable output.`]})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Classify Document","openapi":"api-reference/openapi.yml POST /classify","description":"Lightweight routing step that runs **before** `/extract`. Given a raw document\n(file upload or `file_url`) and a set of caller-defined classifications,\nit returns which classification the document belongs to — plus that classification's\n`pipeline_id`, so you can send the document to the right pipeline next.\n\nBy default, it evaluates the first five pages. For PDFs and images,\nbilling is based on the effective `page_range`. For Office and HTML\nfiles, billing applies to every page.\n\nBilled at **0.5 credits per page** — half the `/extract` rate.\n\nAccepted document types are identical to `/extract`, including the same\nsize limits and URL validation.\n\nSet `async: true` to return immediately with a job_id for polling via\nGET /job/{jobId}. Otherwise processes synchronously.","href":"/api-reference/endpoint/classify"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","depth":2,"children":[{"title":"Accepted Document Types","slug":"accepted-document-types","depth":3,"children":[]},{"title":"Async Mode","slug":"async-mode","depth":3,"children":[]}]},{"title":"Request","slug":"request","depth":2,"children":[{"title":"Request Body","slug":"request-body","depth":3,"children":[]},{"title":"Classify Config (classify_config)","slug":"classify-config-classify_config","depth":3,"children":[]},{"title":"Always include a catch-all classification","slug":"always-include-a-catch-all-classification","depth":3,"children":[]}]},{"title":"Response","slug":"response","depth":2,"children":[{"title":"Synchronous Response (200)","slug":"synchronous-response-200","depth":3,"children":[]},{"title":"Async Response (202)","slug":"async-response-202","depth":3,"children":[]}]},{"title":"Example Usage","slug":"example-usage","depth":2,"children":[{"title":"Example Response","slug":"example-response","depth":3,"children":[]}]},{"title":"Routing to a Pipeline","slug":"routing-to-a-pipeline","depth":2,"children":[]},{"title":"Credits","slug":"credits","depth":2,"children":[]},{"title":"Error Responses","slug":"error-responses","depth":2,"children":[]},{"title":"Best Practices","slug":"best-practices","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/pulseai/5215a343261c1e3e/api-fields.js"],"openApiReferenceData":{"operation":{"summary":"Classify a document to route it to a pipeline","description":"Lightweight routing step that runs **before** `/extract`. Given a raw document\n(file upload or `file_url`) and a set of caller-defined classifications,\nit returns which classification the document belongs to — plus that classification's\n`pipeline_id`, so you can send the document to the right pipeline next.\n\nBy default, it evaluates the first five pages. For PDFs and images,\nbilling is based on the effective `page_range`. For Office and HTML\nfiles, billing applies to every page.\n\nBilled at **0.5 credits per page** — half the `/extract` rate.\n\nAccepted document types are identical to `/extract`, including the same\nsize limits and URL validation.\n\nSet `async: true` to return immediately with a job_id for polling via\nGET /job/{jobId}. Otherwise processes synchronously.","operationId":"classifyDocument","tags":["Classify"],"requestBody":"39e8c703-c752-44f5-92b6-20c00d1f08d3","responses":{"200":"ac4fe2a2-da53-4508-ab8f-eb42dc1df85f","202":"13b243e3-7639-42d8-8669-6adcd4e90676","400":"ffafecb9-d9ee-4f94-bff4-18d1f842ba08","401":"f587226a-d65f-4d38-acda-9523628175b7","429":"73722dd7-5972-4848-a223-eb54691cdb10","503":"4b49d769-0a6f-4ebe-8330-af5bd1be74de"},"parameters":["77f93da3-97f0-4230-8236-cba97f51e199"],"method":"post","type":"path","servers":["e1ef7834-5f16-4759-9585-bf90a3a29520"],"security":["3d136d9b-6b58-4a17-9f2d-f27756a950c2"],"path":"/https/docs.runpulse.com/classify","baseUrlOptions":["https://api.runpulse.com"],"title":"Classify a document to route it to a pipeline","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"77f93da3-97f0-4230-8236-cba97f51e199":{"name":"Pulse-Version","in":"header","required":false,"description":"The API version. These pages document version `1`.","schema":{"type":"string","default":"1","enum":["1"],"isRequired":false,"description":"The API version. These pages document version `1`.","uniqueKey":"","typeLabel":"enum\u003cstring>"}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","description":"Request body for classifying a document. Provide exactly one of\n`file` (multipart upload) or `file_url` (JSON body). In\nmultipart/form-data requests, `classify_config` is sent as a JSON\nstring form field.","required":["classify_config"],"properties":{"classify_config":{"type":"object","description":"Candidate classifications the document is matched against.","required":["classifications"],"properties":{"classifications":{"type":"object","minProperties":1,"description":"Mapping of classification names to their definitions. Include a catch-all entry (e.g. \"other\") for documents that fit nothing else.","additionalProperties":{"type":"object","description":"A candidate classification a document may belong to.","required":["description"],"properties":{"description":{"type":"string","description":"What documents belong to this classification. Make it specific and mutually distinct from the other classifications.","isRequired":true,"uniqueKey":"classify_config.classifications.additionalProperties.description","typeLabel":"string"},"pipeline_id":{"type":"string","format":"uuid","description":"Optional routing metadata. When provided, it must reference a pipeline your organization owns. The matched classification's pipeline_id is echoed back in the response so you can route the document next.","uniqueKey":"classify_config.classifications.additionalProperties.pipeline_id","typeLabel":"string\u003cuuid>"}},"uniqueKey":"classify_config.classifications.additionalProperties","typeLabel":"object"},"isRequired":true,"uniqueKey":"classify_config.classifications","typeLabel":"object"}},"isRequired":true,"uniqueKey":"classify_config","typeLabel":"object"},"file":{"type":"string","format":"binary","description":"Document to upload directly (multipart/form-data only). Required unless file_url is provided.","uniqueKey":"file","typeLabel":"file"},"file_url":{"type":"string","format":"uri","description":"Public or pre-signed URL that Pulse will download and classify. Required unless file is provided.","uniqueKey":"file_url","typeLabel":"string\u003curi>"},"page_range":{"type":"string","description":"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.","uniqueKey":"page_range","typeLabel":"string"},"async":{"type":"boolean","default":false,"description":"If true, returns immediately with a job_id for polling via GET /job/{jobId}. Otherwise processes synchronously.","uniqueKey":"async","typeLabel":"boolean"},"parent_job_id":{"type":"string","format":"uuid","description":"Optional parent job id for tracking.","uniqueKey":"parent_job_id","typeLabel":"string\u003cuuid>"}},"uniqueKey":"","typeLabel":"object"},"encoding":{"classify_config":{"contentType":"application/json"}},"examples":{"Example":{"title":"Example","value":{"classify_config":{"classifications":{}},"file":"\u003cstring>","file_url":"\u003cstring>","page_range":"\u003cstring>","async":false,"parent_job_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a"}}},"exampleType":"generated"},"application/json":{"schema":{"type":"object","description":"Request body for classifying a document. Provide exactly one of\n`file` (multipart upload) or `file_url` (JSON body). In\nmultipart/form-data requests, `classify_config` is sent as a JSON\nstring form field.","required":["classify_config"],"properties":{"classify_config":{"type":"object","description":"Candidate classifications the document is matched against.","required":["classifications"],"properties":{"classifications":{"type":"object","minProperties":1,"description":"Mapping of classification names to their definitions. Include a catch-all entry (e.g. \"other\") for documents that fit nothing else.","additionalProperties":{"type":"object","description":"A candidate classification a document may belong to.","required":["description"],"properties":{"description":{"type":"string","description":"What documents belong to this classification. Make it specific and mutually distinct from the other classifications.","isRequired":true,"uniqueKey":"classify_config.classifications.additionalProperties.description","typeLabel":"string"},"pipeline_id":{"type":"string","format":"uuid","description":"Optional routing metadata. When provided, it must reference a pipeline your organization owns. The matched classification's pipeline_id is echoed back in the response so you can route the document next.","uniqueKey":"classify_config.classifications.additionalProperties.pipeline_id","typeLabel":"string\u003cuuid>"}},"uniqueKey":"classify_config.classifications.additionalProperties","typeLabel":"object"},"isRequired":true,"uniqueKey":"classify_config.classifications","typeLabel":"object"}},"isRequired":true,"uniqueKey":"classify_config","typeLabel":"object"},"file":{"type":"string","format":"binary","description":"Document to upload directly (multipart/form-data only). Required unless file_url is provided.","uniqueKey":"file","typeLabel":"file"},"file_url":{"type":"string","format":"uri","description":"Public or pre-signed URL that Pulse will download and classify. Required unless file is provided.","uniqueKey":"file_url","typeLabel":"string\u003curi>"},"page_range":{"type":"string","description":"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.","uniqueKey":"page_range","typeLabel":"string"},"async":{"type":"boolean","default":false,"description":"If true, returns immediately with a job_id for polling via GET /job/{jobId}. Otherwise processes synchronously.","uniqueKey":"async","typeLabel":"boolean"},"parent_job_id":{"type":"string","format":"uuid","description":"Optional parent job id for tracking.","uniqueKey":"parent_job_id","typeLabel":"string\u003cuuid>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"classify_config":{"classifications":{}},"file":"\u003cstring>","file_url":"\u003cstring>","page_range":"\u003cstring>","async":false,"parent_job_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"ac4fe2a2-da53-4508-ab8f-eb42dc1df85f":{"description":"Classification result (when async=false or omitted), or the single-use download stub when `force_url` was set.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","description":"Result of document classification.","required":["classification","classify_output"],"properties":{"classification":{"type":"string","description":"The winning classification name — one of the keys from the request's classifications object.","isRequired":true,"uniqueKey":"oneOf.0.classification","typeLabel":"string"},"classify_output":{"type":"object","description":"Details of the winning classification.","properties":{"classification":{"type":"string","description":"The winning classification name — one of the keys from the request's classifications object.","uniqueKey":"oneOf.0.classify_output.classification","typeLabel":"string"},"pipeline_id":{"oneOf":[{"type":"string","format":"uuid","description":"The matched classification's pipeline_id, or null if it had none. Run this pipeline with the same document as the next step.","uniqueKey":"oneOf.0.classify_output.pipeline_id.oneOf.0","typeLabel":"string\u003cuuid>"},{"type":"null","format":"uuid","description":"The matched classification's pipeline_id, or null if it had none. Run this pipeline with the same document as the next step.","uniqueKey":"oneOf.0.classify_output.pipeline_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.classify_output.pipeline_id","typeLabel":"string\u003cuuid> | null"},"page_range":{"type":"string","description":"The effective page range used for classification, after defaulting and clamping to the document length.","uniqueKey":"oneOf.0.classify_output.page_range","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.0.classify_output","typeLabel":"object"},"job_id":{"type":"string","format":"uuid","description":"Identifier of the request for tracking and support.","uniqueKey":"oneOf.0.job_id","typeLabel":"string\u003cuuid>"},"credits_used":{"oneOf":[{"type":"number","format":"float","description":"Number of credits consumed by this request.","uniqueKey":"oneOf.0.credits_used.oneOf.0","typeLabel":"number\u003cfloat>"},{"type":"null","format":"float","description":"Number of credits consumed by this request.","uniqueKey":"oneOf.0.credits_used.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.credits_used","typeLabel":"number\u003cfloat> | null"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","description":"Returned instead of the full extraction result for large results, including documents with 70 or more pages and spreadsheet extractions. The `url` field is a single-use download link; fetch it once to retrieve the complete `ExtractResultCore` payload. Subsequent requests to the same URL return 410 Gone.","required":["is_url","url"],"properties":{"is_url":{"type":"boolean","description":"Always `true` for large document responses.","enum":[true],"isRequired":true,"uniqueKey":"oneOf.1.is_url","typeLabel":"enum\u003cboolean>"},"url":{"type":"string","description":"Single-use URL to download the full extraction result. After one successful download the resource is deleted and further requests return 410 Gone.","isRequired":true,"uniqueKey":"oneOf.1.url","typeLabel":"string"},"extraction_id":{"type":"string","format":"uuid","description":"Extraction identifier (when storage is enabled).","uniqueKey":"oneOf.1.extraction_id","typeLabel":"string\u003cuuid>"}},"uniqueKey":"oneOf.1","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"classification":"\u003cstring>","classify_output":{"classification":"\u003cstring>","pipeline_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","page_range":"\u003cstring>"},"job_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","credits_used":123}}},"exampleType":"generated"}},"exampleType":"generated"},"13b243e3-7639-42d8-8669-6adcd4e90676":{"description":"Classify job accepted (when async=true)","content":{"application/json":{"schema":{"type":"object","description":"Acknowledgement returned when a request is submitted for asynchronous processing. Poll `GET /job/{job_id}` to check status and retrieve results.","required":["job_id","status"],"properties":{"job_id":{"type":"string","description":"Identifier assigned to the asynchronous job.","isRequired":true,"uniqueKey":"job_id","typeLabel":"string"},"status":{"type":"string","description":"Initial status reported by the server.","enum":["pending","processing","completed","failed","canceled"],"isRequired":true,"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable description of the accepted job.","uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"job_id":"\u003cstring>","status":"pending","message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"ffafecb9-d9ee-4f94-bff4-18d1f842ba08":{"description":"Invalid request parameters, unsupported file type, or a classification references a pipeline_id that does not exist for your organization","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"f587226a-d65f-4d38-acda-9523628175b7":{"description":"Authentication failed or missing API key","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"73722dd7-5972-4848-a223-eb54691cdb10":{"description":"Rate limit exceeded","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"4b49d769-0a6f-4ebe-8330-af5bd1be74de":{"description":"Organization retention policy is temporarily unavailable. Processing and charging have not started; retry after the seconds in Retry-After.","headers":{"Retry-After":{"description":"Seconds to wait before retrying a retention-policy refusal.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","description":"A machine-readable request failure.","additionalProperties":false,"required":["error"],"properties":{"error":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string","description":"Stable machine-readable error code, e.g. `REQ_002`. Safe to branch on.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable description of what went wrong.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"object","additionalProperties":true,"description":"Additional context for the error when available, such as the offending field. Absent when there is nothing to add.","uniqueKey":"error.details","typeLabel":"object"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","details":{}}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"3d136d9b-6b58-4a17-9f2d-f27756a950c2":{"ApiKey":{"type":"apiKey","in":"header","name":"x-api-key","x-fern-header":{"name":"apiKey","env":"PULSE_API_KEY"},"scopes":[],"schemeName":"ApiKey"}}},"servers":{"e1ef7834-5f16-4759-9585-bf90a3a29520":{"url":"https://api.runpulse.com","description":"Default Pulse API base URL"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","x-fern-header":{"name":"apiKey","env":"PULSE_API_KEY"},"scopes":[],"schemeName":"ApiKey"},"schema":{"title":"x-api-key","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"ApiKey","name":"x-api-key"}],"title":"ApiKey"}]},"originalFileLocation":"api-reference/openapi.yml"},"subdomain":"pulseai","siteName":"Pulse API","title":"Classify Document - Pulse API","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{"v2":{"href":"/v2/introduction","matchLevel":4},"v1":{"href":"/api-reference/endpoint/classify","matchLevel":0},"v1 (old)":{"href":"/v1/api-reference/endpoint/classify","matchLevel":1}},"firstHrefInLanguage":{}},"lastModified":"2026-11-13T01:39:50.803Z","originalFileLocation":"api-reference/endpoint/classify.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"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\u0026#x27;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/{jobId}. Otherwise processes synchronously.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Pulse API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/pulseai/EMicLlWnJwlz5Lxs/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/pulseai/EMicLlWnJwlz5Lxs/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/pulseai/EMicLlWnJwlz5Lxs/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/pulseai/EMicLlWnJwlz5Lxs/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/pulseai/EMicLlWnJwlz5Lxs/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/pulseai/EMicLlWnJwlz5Lxs/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/pulseai/EMicLlWnJwlz5Lxs/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/pulseai/EMicLlWnJwlz5Lxs/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/pulseai/EMicLlWnJwlz5Lxs/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Classify Document - Pulse API\">\u003cmeta data-mint-head property=\"og:description\" content=\"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\u0026#x27;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/{jobId}. Otherwise processes synchronously.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Pulse API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.runpulse.com/api-reference/endpoint/classify\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://pulseai.mintlify.site/_mintlify/api/og/v2?division=Pipeline+Steps\u0026amp;title=Classify+Document\u0026amp;description=Lightweight+routing+step+that+runs+**before**+%60%2Fextract%60.+Given+a+raw+document%0A%28file+upload+or+%60file_url%60%29+and+a+set+of+caller-defined+classifications%2C%0Ait+retur\u0026amp;theme=6dd969aac606de8f928cd444\u0026amp;signature=e6f05f8acb138b6f178c9fe3a34958db7da1830995209a9f793e150168c5b645\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Classify Document - Pulse API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"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\u0026#x27;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/{jobId}. Otherwise processes synchronously.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://pulseai.mintlify.site/_mintlify/api/og/v2?division=Pipeline+Steps\u0026amp;title=Classify+Document\u0026amp;description=Lightweight+routing+step+that+runs+**before**+%60%2Fextract%60.+Given+a+raw+document%0A%28file+upload+or+%60file_url%60%29+and+a+set+of+caller-defined+classifications%2C%0Ait+retur\u0026amp;theme=6dd969aac606de8f928cd444\u0026amp;signature=e6f05f8acb138b6f178c9fe3a34958db7da1830995209a9f793e150168c5b645\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/pulseai/EMicLlWnJwlz5Lxs/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Pulse API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3573f6\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.runpulse.com/api-reference/endpoint/classify\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/endpoint/classify.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.runpulse.com/#organization\",\"name\":\"Pulse API\",\"url\":\"https://docs.runpulse.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/pulseai/OJ897TEZf8bV6lk8/logo-icon.svg?fit=max\u0026auto=format\u0026n=OJ897TEZf8bV6lk8\u0026q=85\u0026s=1062873c6d0f5dd9971e379f2210c1cb\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.runpulse.com#website\",\"name\":\"Pulse API\",\"url\":\"https://docs.runpulse.com\",\"publisher\":{\"@id\":\"https://docs.runpulse.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.runpulse.com/api-reference/endpoint/classify#webpage\",\"url\":\"https://docs.runpulse.com/api-reference/endpoint/classify\",\"name\":\"Classify Document\",\"description\":\"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/{jobId}. Otherwise processes synchronously.\",\"dateModified\":\"2026-11-13T01:39:50.803Z\",\"isPartOf\":{\"@id\":\"https://docs.runpulse.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.runpulse.com/api-reference/endpoint/classify#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.runpulse.com/api-reference/endpoint/classify#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Pipeline Steps\",\"item\":\"https://docs.runpulse.com/api-reference/endpoint/pipeline-overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Classify Document\",\"item\":\"https://docs.runpulse.com/api-reference/endpoint/classify\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.runpulse.com/api-reference/endpoint/classify#apireference\",\"headline\":\"Classify Document\",\"name\":\"Classify Document\",\"description\":\"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/{jobId}. Otherwise processes synchronously.\",\"url\":\"https://docs.runpulse.com/api-reference/endpoint/classify\",\"mainEntityOfPage\":{\"@id\":\"https://docs.runpulse.com/api-reference/endpoint/classify#webpage\"},\"dateModified\":\"2026-11-13T01:39:50.803Z\",\"publisher\":{\"@id\":\"https://docs.runpulse.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.runpulse.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Pulse API\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Pulse API\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/endpoint/classify.md","siteName":"Pulse API","nav":{"global":null,"versions":[{"version":"v2","default":true,"pages":[{"title":"v2","href":"/v2/introduction"}]},{"version":"v1","tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"API Reference","pages":[{"title":"Overview","href":"/api-reference/introduction"},{"title":"SDKs","href":"/api-reference/sdks"},{"title":"Async Processing","href":"/api-reference/async-processing"},{"title":"Structured Output Guidelines","href":"/api-reference/structured-output-guidelines"},{"title":"Bounding Boxes","href":"/api-reference/bounding-boxes"},{"title":"Supported File Types","href":"/api-reference/supported-file-types"},{"title":"Working with Large Documents","href":"/api-reference/large-documents"}]},{"group":"Pipeline Steps","pages":[{"title":"Pipeline Overview","description":"Chain classify, extract, schema, tables, charts, and split steps into document processing pipelines.","href":"/api-reference/endpoint/pipeline-overview"},{"title":"Classify Document","openapi":"api-reference/openapi.yml POST /classify","href":"/api-reference/endpoint/classify"},{"title":"Extract File","openapi":"api-reference/openapi.yml POST /extract","description":"The primary endpoint for the Pulse API. Parses uploaded documents or remote\nfile URLs and returns rich markdown content with optional structured data\nextraction based on user-provided schemas and extraction options.\n\nSet `async: true` to return immediately with a job_id for polling via\nGET /job/{jobId}. Otherwise processes synchronously.\n\nFor large TIFFs with Pulse Ultra 2, submit a `file_url` ending in\n`.tif` or `.tiff` with `async: true`. Pulse downloads and processes\nthe image in bounded tiles after accepting the job. Results retain\nthe original TIFF page numbers and coordinates; internal tiles do\nnot increase the billed page count.\n\nWith Pulse Ultra 2, multi-page TIFF uploads also preserve every frame.\nPage ranges select original frames; billing counts the selected frames.\n\nTo process many files at once, see [Batch Extract](api:POST/batch/extract)\nor the [Batch Processing guide](/batch).","href":"/api-reference/endpoint/extract"},{"title":"Schema Extraction","openapi":"api-reference/openapi.yml POST /schema","href":"/api-reference/endpoint/schema"},{"title":"Tables","openapi":"api-reference/openapi.yml POST /tables","href":"/api-reference/endpoint/tables"},{"title":"Charts","openapi":"api-reference/openapi.yml POST /charts","href":"/api-reference/endpoint/charts"},{"title":"Split Document","openapi":"api-reference/openapi.yml POST /split","href":"/api-reference/endpoint/split"}]},{"group":"Batch \u0026 Pipelines","pages":[{"title":"Batch Processing","href":"/api-reference/endpoint/batch-overview"}]},{"group":"Forms","pages":[{"title":"Detect Form Fields","openapi":"api-reference/openapi.yml POST /form/detect","href":"/api-reference/endpoint/form-detect"},{"title":"Fill Form","openapi":"api-reference/openapi.yml POST /form/fill","href":"/api-reference/endpoint/form-fill"},{"title":"Clear Form","openapi":"api-reference/openapi.yml POST /form/clear","href":"/api-reference/endpoint/form-clear"}]},{"group":"Jobs, Results \u0026 Webhooks","pages":[{"title":"Poll Job","openapi":"api-reference/openapi.yml GET /job/{jobId}","href":"/api-reference/endpoint/poll"},{"title":"Cancel Job","openapi":"api-reference/openapi.yml DELETE /job/{jobId}","href":"/api-reference/endpoint/delete-job"},{"title":"Download Large Result","openapi":"api-reference/openapi.yml GET /results/{jobId}","href":"/api-reference/endpoint/large-results"},{"title":"Get Result Image","openapi":"api-reference/openapi.yml GET /results/{jobId}/images/{filename}","href":"/api-reference/endpoint/results-image"},{"title":"Download Result PDF","openapi":"api-reference/openapi.yml GET /results/{jobId}/pdf","href":"/api-reference/endpoint/results-pdf"},{"title":"Configure Webhooks","openapi":"api-reference/openapi.yml POST /webhook","href":"/api-reference/endpoint/webhook"}]},{"group":"Account \u0026 Usage","pages":[{"title":"Get Usage","openapi":"api-reference/openapi.yml GET /usage","href":"/api-reference/endpoint/usage"}]}]},{"tab":"Platform Reference","pages":[{"title":"Platform Reference","href":"/platform-reference/introduction"}]},{"tab":"Cookbooks","pages":[{"title":"Cookbooks","href":"/cookbooks/overview"}]}]},{"version":"v1 (old)","tag":"Old","pages":[{"title":"v1 (old)","href":"/v1/api-reference/endpoint/classify"}]}]},"basePath":"","title":"Classify Document - Pulse API","deploymentId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","buildId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","dynamics":["10e4515597","c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["BannerMarkdown-C4eRUFHa.js","dist-DzZqOeCq.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js","OpenApiReferenceProvider-C6Z1vAfX.js","snippetPresets-Bjd6OXRM.js","utils-QL6OhUyF.js","style-to-object-BY3JEAdk.js","utils-Dsq-HLeF.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-CEYfmkoV.js","conditional-requirements-CFM0id0Q.js","cloneDeep-CHgPjMM8.js","_Uint8Array-IXRJ_ueo.js","isObject-FP1Yky1u.js","ApiExamples-pq4ns9YA.js","usePlaygroundInputsStore-D-gnigmo.js","shallow-DIfWGPrf.js","isEqual-DDFuixlH.js","CodeSnippets-8g5rilZj.js","CodeSnippet-C_J7pouP.js","use-playground-group-access-bkOyfPao.js","Page-B_smDgrp.js","api-description-markdown-DtcP2u3s.js","DynamicMarkdown-DOefW1_8.js","SectionHeading-Cg4lfWZw.js","MethodPill-BnqygvYm.js","getPastedJson-BGXYEZ3P.js","Check2Icon-BBeO3TOS.js","axios-CsQoIw0U.js","Markdown-D5IqLG6A.js","AssistantPageLink-_S2h4i6W.js"]}