curl --request POST \
--url https://ndi-api.nace.ai/v1/classify \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"classes": [
{
"id": "<string>",
"label": "<string>",
"criteria": [
"<string>"
],
"description": "",
"subclasses": [
{
"id": "<string>",
"label": "<string>",
"criteria": [
"<string>"
],
"description": ""
}
]
}
],
"source": {
"upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "upload"
}
}
'{
"created_at": "2023-11-07T05:31:56Z",
"job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"cost": {
"lines": [
{
"amount_usd": "<string>",
"execution": "fresh",
"operation": "parse",
"quantity": 1,
"unit": "page",
"unit_price_usd": "<string>",
"reuse_reason": "reused_parse"
}
],
"pricing_version": "<string>",
"total_usd": "<string>",
"currency": "USD"
},
"credit_schedule_version": 123,
"credits": 123,
"deleted_at": "2023-11-07T05:31:56Z",
"effort": "<string>",
"error": {
"code": "invalid_request",
"message": "<string>",
"retryable": true,
"detail": {},
"request_id": "<string>"
},
"finished_at": "2023-11-07T05:31:56Z",
"force": true,
"idempotency_key": "<string>",
"kind": "classify",
"name": "<string>",
"payload_expires_at": "2023-11-07T05:31:56Z",
"progress": {
"items_done": 0,
"items_failed": 0,
"items_total": 123,
"knowledge_graph": {
"countable": true,
"phase_count": 123,
"phase_index": 123,
"documents": 123,
"mentions": 123,
"step": "<string>",
"step_done": 123,
"step_total": 123
},
"routing": {
"final": "fact",
"reason": "<string>",
"router_model": "<string>",
"selected": "fact",
"delegated_wall_ms": 123,
"fact_wall_ms": 123,
"router": {
"kind": "llm"
},
"router_wall_ms": 123
},
"stage": "<string>",
"units_done": 0,
"units_total": 123
},
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"query": "<string>",
"query_scope": {
"type": "workspace"
},
"result": {
"units": [
{
"labels": [
{
"class_id": "<string>",
"label": "<string>",
"rank": 2,
"confidence": 123,
"reason": "<string>",
"subclass_id": "<string>"
}
],
"unknown": true,
"granularity": "document",
"page_range": {
"end": 2,
"start": 2
}
}
],
"disclosures": [
{
"code": "classification_gap_fill",
"fallback_label": "<string>",
"filled_pages": [
2
]
}
],
"labels_at": "2023-11-07T05:31:56Z",
"pages_read_fraction": 1,
"reason_status": "complete",
"result_type": "classify",
"unknown_units": 0
},
"result_state": "available",
"source": {
"upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "upload"
},
"started_at": "2023-11-07T05:31:56Z",
"surface": "deep_search",
"units": 0,
"usage": {
"lines": [
{
"credits": 1,
"credits_per_unit": 1,
"multiplier": 2,
"part": "parse",
"quantity": 1,
"unit": "page",
"waiver": {
"part": "parse",
"reason": "reused_parse",
"source_job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
]
},
"usage_final": false,
"usage_finalized_at": "2023-11-07T05:31:56Z",
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "invalid_request",
"detail": null,
"message": "Request body has extra fields that this operation does not accept.",
"request_id": "req-01j9k2n3p4q5r6s7t8v9",
"retryable": false
}
}{
"error": {
"code": "invalid_request",
"detail": null,
"message": "Request body has extra fields that this operation does not accept.",
"request_id": "req-01j9k2n3p4q5r6s7t8v9",
"retryable": false
}
}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.
curl --request POST \
--url https://ndi-api.nace.ai/v1/classify \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"classes": [
{
"id": "<string>",
"label": "<string>",
"criteria": [
"<string>"
],
"description": "",
"subclasses": [
{
"id": "<string>",
"label": "<string>",
"criteria": [
"<string>"
],
"description": ""
}
]
}
],
"source": {
"upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "upload"
}
}
'{
"created_at": "2023-11-07T05:31:56Z",
"job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"cost": {
"lines": [
{
"amount_usd": "<string>",
"execution": "fresh",
"operation": "parse",
"quantity": 1,
"unit": "page",
"unit_price_usd": "<string>",
"reuse_reason": "reused_parse"
}
],
"pricing_version": "<string>",
"total_usd": "<string>",
"currency": "USD"
},
"credit_schedule_version": 123,
"credits": 123,
"deleted_at": "2023-11-07T05:31:56Z",
"effort": "<string>",
"error": {
"code": "invalid_request",
"message": "<string>",
"retryable": true,
"detail": {},
"request_id": "<string>"
},
"finished_at": "2023-11-07T05:31:56Z",
"force": true,
"idempotency_key": "<string>",
"kind": "classify",
"name": "<string>",
"payload_expires_at": "2023-11-07T05:31:56Z",
"progress": {
"items_done": 0,
"items_failed": 0,
"items_total": 123,
"knowledge_graph": {
"countable": true,
"phase_count": 123,
"phase_index": 123,
"documents": 123,
"mentions": 123,
"step": "<string>",
"step_done": 123,
"step_total": 123
},
"routing": {
"final": "fact",
"reason": "<string>",
"router_model": "<string>",
"selected": "fact",
"delegated_wall_ms": 123,
"fact_wall_ms": 123,
"router": {
"kind": "llm"
},
"router_wall_ms": 123
},
"stage": "<string>",
"units_done": 0,
"units_total": 123
},
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"query": "<string>",
"query_scope": {
"type": "workspace"
},
"result": {
"units": [
{
"labels": [
{
"class_id": "<string>",
"label": "<string>",
"rank": 2,
"confidence": 123,
"reason": "<string>",
"subclass_id": "<string>"
}
],
"unknown": true,
"granularity": "document",
"page_range": {
"end": 2,
"start": 2
}
}
],
"disclosures": [
{
"code": "classification_gap_fill",
"fallback_label": "<string>",
"filled_pages": [
2
]
}
],
"labels_at": "2023-11-07T05:31:56Z",
"pages_read_fraction": 1,
"reason_status": "complete",
"result_type": "classify",
"unknown_units": 0
},
"result_state": "available",
"source": {
"upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "upload"
},
"started_at": "2023-11-07T05:31:56Z",
"surface": "deep_search",
"units": 0,
"usage": {
"lines": [
{
"credits": 1,
"credits_per_unit": 1,
"multiplier": 2,
"part": "parse",
"quantity": 1,
"unit": "page",
"waiver": {
"part": "parse",
"reason": "reused_parse",
"source_job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
]
},
"usage_final": false,
"usage_finalized_at": "2023-11-07T05:31:56Z",
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "invalid_request",
"detail": null,
"message": "Request body has extra fields that this operation does not accept.",
"request_id": "req-01j9k2n3p4q5r6s7t8v9",
"retryable": false
}
}{
"error": {
"code": "invalid_request",
"detail": null,
"message": "Request body has extra fields that this operation does not accept.",
"request_id": "req-01j9k2n3p4q5r6s7t8v9",
"retryable": false
}
}Authorizations
Headers
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.
200Query Parameters
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.
0 <= x <= 300Body
Body for canonical POST /v1/classify.
The canonical p0 surface classifies one document against caller-provided classes. Internally this still adapts onto the shared categorize workflow.
Caller-defined classes to score the document against.
1Show child attributes
Show child attributes
Bytes staged through POST /v1/uploads. Single-use, TTL-bound.
- UploadSource
- UrlSource
- WorkspaceFileSource
- ParseResultSource
Show child attributes
Show child attributes
Caller-supplied context about the document, such as the audited entity's name.
Show child attributes
Show child attributes
Workspace files visible in the run tray, including files not submitted by this request.
50Show child attributes
Show child attributes
Score the whole document once, or return one unit per selected page.
document, page 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'.
200How many alternative labels to keep and whether to include reasons.
Show child attributes
Show child attributes
One-based inclusive page ranges to classify. Omit to use the whole document. Not supported for spreadsheets (.xlsx, .xls, .xlsm, .csv, .parquet).
1 - 200 elementsShow child attributes
Show child attributes
How much parsing effort to use: Low uses native OCR, Medium routes to the best parser, and High adds page verification and correction.
low, medium, high Caller-minted grouping id; jobs submitted together share it. Not a server-side resource.
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.
allow, force_best Response
Successful Response
- ClassifyJob
- CategorizeJob
When the job row was created.
Server-minted id. Poll GET /v1/jobs/{job_id} or pass wait_seconds on create.
Lifecycle: queued, running, succeeded, failed, or cancelled.
queued, running, succeeded, failed, cancelled Final USD component prices under the sheet pinned at acceptance; null before finalization or when no dollar sheet was configured. Does not change legacy credit billing.
Show child attributes
Show child attributes
Version of the credit schedule credits were priced under. Null until usage_final is true.
Final credits billed for this job, priced once under credit_schedule_version. Null until usage_final is true. Never changes afterwards, including after payload expiry or deletion. For a job that failed or was cancelled, the credits for results already delivered before it ended (a progressive classify or extract publishes before it finishes); 0 when it delivered nothing. Always null on a stage job that Automatic Search delegated: its work is billed on the parent job.
When the caller hid this run from listings, via delete_job. A soft delete: the job still reads by id and still counts toward GET /v1/usage — what it stops doing is appearing in GET /v1/jobs.
How hard this run worked, for the search kinds that carry it. A deep-search job (kind deep_search_v2) created before the effort knob was removed echoes its requested level: 'low', 'medium', or 'high'; newer deep-search jobs, which all run one configuration, read null. An intelligent_search row carries an internal selector instead: 'fast' is fact-search, 'automatic' is automatic-search, and 'deep' (or the legacy 'balanced') is a deep-search or console QA chat job created before the 2026-09 consolidation — those two are not distinguishable by this field. Null for every other kind. Read from the stored request, so it rides the same retention path as query and result: null once result_state leaves available.
Typed failure envelope when status is failed. Null on any other status.
Show child attributes
Show child attributes
When the job reached a terminal status.
The request's own force flag, echoed regardless of outcome. Present for kinds whose request carries one (e.g. kg_build, where a true value cleared the durable store before the job ran) so a caller can tell that apart from a build that failed leaving the prior store untouched — result alone cannot, since it is absent on failure either way.
Key that was replayed to return this job. Absent when the create call had no Idempotency-Key.
"classify"Display name (the console's 'project'). Public Parse, Split, Classify, Extract, and Ground runs supply a stable server default when blank; citation-generated Ground jobs are excluded. mutable via PATCH /v1/jobs/{job_id}.
When the job's inputs, outputs and processing files are removed. Once the job finishes this is no later than 48 hours after it on a paid account and 7 days after on a free one, or sooner if the workspace's job_ttl_days says so. Null while a job with no job_ttl_days bound is still running, or when the account keeps no job content (zero retention).
Live progress while the job is running. Null while queued and after the job finishes.
Show child attributes
Show child attributes
Caller-minted grouping id shared by jobs submitted together. Filterable on GET /v1/jobs.
The question this job was asked, for the search kinds that carry one (intelligent_search, qa_file, qa_tables, filtered_search); null for every other kind. Read from the stored request, so it rides the same retention path as result: null once result_state leaves available. Narrow by design — the frozen access context never reaches the wire. File scope is summarised separately as query_scope.
The question ran against the whole workspace.
- WorkspaceQueryScope
- FileQueryScope
- PathPrefixQueryScope
- FilesQueryScope
Show child attributes
Show child attributes
Present on succeeded while retained. Also present on a running classify job whose labels were published before the reason finished.
Show child attributes
Show child attributes
Why result may be null. available with a null result means the job has not succeeded yet; expired and not_retained mean the payload was dropped by retention; cancelled means the job, or the job it ran for, was cancelled, so no result is served (a cancelled job is charged only for results delivered before the cancel).
available, expired, not_retained, cancelled Bytes staged through POST /v1/uploads. Single-use, TTL-bound.
- UploadSource
- UrlSource
- WorkspaceFileSource
- ParseResultSource
Show child attributes
Show child attributes
When execution began. Null while still queued.
Which console history this deep-search job belongs to. deep_search is the public route and the Deep Search page; qa and workbook are the console chat skins over the same agent. It does not pick the implementation. Null for fact-search and every non-deep-search kind. Jobs stored before this field existed echo deep_search. Read from the stored payload, so it rides the same retention path as query.
deep_search, qa, workbook Billable units once the job finishes; 0 while queued or running. Kept for compatibility: credits is the authoritative billed amount.
What credits were charged for: one line per part (the parse, the tool's own work), with the quantity, rate and multiplier behind each. Null until usage_final is true, and on jobs finalized before usage breakdowns were introduced.
Show child attributes
Show child attributes
True once credits is final and will not change. False while the job is queued or running, and until any cleanup of its delegated stages has been accounted for. A failed tool job (read_file, run_sql, hybrid_search, grep, file_metadata, folder_metadata) created with an Idempotency-Key stays false for one hour after it fails, because a retry with the same key re-runs it; after that hour it is final and the retry returns the stored error.
When credits became final. Null until usage_final is true.
The workspace this job reads. Null for a document operation whose source is an upload, a URL, or a prior parse result.