document-operations

classify

Classify one document against caller-provided classes.

Cost class: job (model inference per document; billed on completion).

The canonical p0 input is one document, matching the routing use case and common industry shape.

Returns 202 immediately unless ?wait_seconds=N is set; the result carries ranked label units for the requested document or page granularity.

Args: body: Classify parameters: one source, classes, unknown policy, and output options. caller: Authenticated tenant. session: Database session. wait_seconds: Bounded inline wait. idempotency_key: Idempotent replay key. response: Injected by FastAPI for status-code management.

Returns: A :class:~ndi_service.app.platform_api.results.Job.

post/v1/classify

Request

Query parameters

wait_secondsinteger

Bounded inline wait. 0 (the default) returns 202 immediately. Above 0 the route returns 200 with a terminal job if the work finished in time, and 202 with the still-running job if it did not. Either way, read status.

Headers

Idempotency-Keystring nullable

Replaying a request with the same key returns the original job with 200, never a second job. The key is kept with the job for replay and never cleared, so it must not contain personal data.

Request body

namestring nullable

Optional display name. Public Parse, Split, Classify, Extract, and Ground runs use a stable server default when blank. The console calls a named run a 'project'.

project_idstring uuid nullable

Caller-minted grouping id; jobs submitted together share it. Not a server-side resource.

output_workspace_idstring uuid nullable

Workspace for retained result artifacts. Defaults to the unique source workspace, or a reused Parse's output workspace. Required for ambiguous destinations involving customer storage. Does not change source access.

parse_mode'low' | 'medium' | 'high'

How much parsing effort to use: Low uses native OCR, Medium routes to the best parser, and High adds page verification and correction.

granularity'document' | 'page'

Score the whole document once, or return one unit per selected page.

unknown_policy'allow' | 'force_best'

allow may mark a unit unknown. force_best commits an ambiguous unit to one of your classes instead of abstaining. A blank or unreadable page the model sees is assigned the closest listed class — the closed decode vocabulary has no page-state tokens. A unit that could not be parsed is still returned unknown, and so is an empty spreadsheet tab. Pages never read by any model because of document size are also returned unknown and disclosed as classification_unread_pages.

Response

Successful Response

OR

Changes

No recorded changes to this operation across all 1 revision of this API.