curl --request POST \
--url https://ndi-api.nace.ai/v1/workspaces/{workspace_id}/qa \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"query": "<string>"
}
'{
"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": "automatic_agent",
"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": {
"answer": {
"agent_usage": {
"compaction_requests": 1,
"execution_requests": 1,
"finalization_requests": 1,
"total_requests": 1
},
"answer": "<string>",
"binding": {
"columns": [
{
"column": "<string>",
"path": "<string>",
"slot": "<string>",
"table_name": "<string>",
"component": "<string>",
"detail": "<string>"
}
],
"notes": [
"<string>"
],
"periods": [
{
"role": "<string>",
"value": "<string>"
}
],
"policy_sheets": [
"<string>"
],
"revised_because": "<string>",
"tables": [
{
"path": "<string>",
"role": "<string>",
"table_name": "<string>",
"component": "<string>"
}
],
"value_sets": [
{
"column": "<string>",
"name": "<string>",
"path": "<string>",
"slot": "<string>",
"table_name": "<string>",
"component": "<string>",
"note": "",
"values": [
"<string>"
]
}
]
},
"cache": {
"cached_at": "2023-11-07T05:31:56Z",
"served_from_cache": true,
"verified_at": "2023-11-07T05:31:56Z",
"source_job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"claims": [
{
"claim": "<string>",
"claim_id": "<string>",
"reference": {
"cited_value": "<string>",
"kind": "result_cell",
"result_id": "<string>",
"column": "<string>",
"row": 123
},
"answer_excerpt": "<string>",
"answer_occurrence": 0,
"evidence_indices": [
123
]
}
],
"clarification": "<string>",
"clarification_questions": [
{
"question": "<string>",
"options": [
"<string>"
]
}
],
"command_receipts": [
{
"command": "<string>",
"outputs": {},
"result_id": "<string>",
"stdout": "<string>"
}
],
"confidence": "certain",
"coverage": [
{
"deliverable_id": "<string>",
"description": "<string>",
"status": "answered",
"absence_result_ids": [
"<string>"
],
"basis": "sql",
"claim_ids": [
"<string>"
],
"complete_result": {
"result_id": "<string>",
"columns": [
"<string>"
],
"rows": [
[
"<string>"
]
],
"truncated": false
},
"complete_result_id": "<string>",
"evidence_indices": [
123
],
"missing_inputs": [
"<string>"
]
}
],
"criteria": [
{
"criterion_id": "<string>",
"description": "<string>",
"status": "performed",
"blocker": "binding_unresolved",
"incomplete_reason": "binding_unresolved",
"missing_parameters": [
"close_cutoff"
],
"spec_id": "<string>"
}
],
"degraded": "<string>",
"discrepancies": [
"<string>"
],
"evidences": [
{
"quote": "<string>",
"source_path": "<string>",
"component": "<string>",
"derivation": {
"steps": [
{
"kind": "extraction",
"label": "<string>",
"result_id": "<string>",
"sql": "<string>",
"preview_rows": [
{}
],
"reads": [
"<string>"
]
}
]
},
"page": 123,
"queries": [
{
"sql": "<string>",
"columns": [
{
"data_type": "<string>",
"name": "<string>"
}
],
"grounding_reason": "<string>",
"grounding_status": "exact",
"preview_truncated": false,
"regions": [
{
"a1_range": "<string>",
"source_path": "<string>",
"basis": "verified",
"bounding": false,
"kind": "sheet",
"matched_rows": 0,
"scan_index": 123,
"scan_label": "<string>",
"sheet_name": "<string>"
}
],
"result_id": "<string>",
"row_count": 0,
"rows": [
{}
],
"source_paths": [
"<string>"
],
"supports_answer": true,
"verified": false
}
],
"relevance": "",
"source_file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"execution_status": "performed",
"exhausted": false,
"figures": [
{
"count": 1,
"criterion": "<string>",
"definition": "<string>",
"population": 1,
"spec_id": "<string>",
"band_group": "<string>",
"breakdown": {
"result_id": "<string>",
"columns": [
"<string>"
],
"rows": [
[
"<string>"
]
],
"truncated": false
},
"cannot_be_performed": false,
"exception_listing_result_id": "<string>",
"result_ids": [
"<string>"
],
"value": "<string>"
}
],
"grounding_job_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"population_statement": "<string>",
"quality": {
"status": "clean",
"missing_artifacts": [
"binding"
],
"retried_checks": [
"specs"
],
"tool_failures": [
{
"count": 2,
"outcome": "model_retry",
"tool": "<string>"
}
],
"validation_warnings": [
{
"check": "specs",
"status": "failed_open"
}
],
"withheld_receipt_figures": 0
},
"reasoning": "<string>",
"result_type": "deep_search_v2",
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"spec_digest": "<string>",
"sql_receipts": [
{
"result_id": "<string>",
"sql": "<string>",
"columns": [
"<string>"
],
"executor": "<string>",
"grounding_status": "exact",
"handle": "<string>",
"parameters": {},
"replay": {
"catalog_sha256": "<string>",
"engine": "duckdb",
"engine_threads": 123,
"engine_version": "<string>",
"kind": "aggregate",
"logical_plan_sha256": "<string>",
"normalized_sql": "<string>",
"result_artifact_sha256": "<string>",
"result_data_sha256": "<string>",
"result_digest_version": "<string>",
"sql_sha256": "<string>",
"result_dependencies": [
"<string>"
],
"schema_version": 1
},
"result_row_count": 0,
"row_count": 0,
"rows": [
{}
],
"saved_as": "<string>",
"table_bindings": [
{
"path": "<string>",
"table_name": "<string>",
"component": "<string>",
"source_sha256": "<string>"
}
],
"truncated": false,
"view_sql": "<string>",
"views_used": [
"<string>"
],
"warnings": [
"<string>"
]
}
],
"steps_used": 0,
"structured_answer": "<unknown>",
"tool_calls": [
{
"arguments_digest": "<string>",
"duration_ms": 123,
"hits": 123,
"tool": "<string>"
}
],
"usage": {
"by_model": [
{
"model": "<string>",
"cached_input_tokens": 0,
"input_tokens": 0,
"output_tokens": 0,
"requests": 0
}
],
"cached_input_tokens": 0,
"input_tokens": 0,
"output_tokens": 0,
"requests": 0
}
},
"catalog": {
"applied_query": "<string>",
"candidates_seen": 0,
"catalog_drifted": false,
"clarification": "<string>",
"columns": [
{
"field": "<string>",
"kind": "text",
"description": "",
"filtered": false,
"repeated": false,
"requested": false
}
],
"confidence": "certain",
"content_evidences": [
{
"quote": "<string>",
"source_file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_path": "<string>",
"a1_range": "<string>",
"component": "<string>",
"page": 123
}
],
"content_verification": {
"candidates": 1,
"condition": "<string>",
"unverified_candidates": 1
},
"coverage": {
"labels_required": [
"<string>"
],
"request_access_hint": "<string>",
"restricted_candidates": 0
},
"evidences": [
{
"quote": "<string>",
"source_path": "<string>",
"component": "<string>",
"derivation": {
"steps": [
{
"kind": "extraction",
"label": "<string>",
"result_id": "<string>",
"sql": "<string>",
"preview_rows": [
{}
],
"reads": [
"<string>"
]
}
]
},
"page": 123,
"queries": [
{
"sql": "<string>",
"columns": [
{
"data_type": "<string>",
"name": "<string>"
}
],
"grounding_reason": "<string>",
"grounding_status": "exact",
"preview_truncated": false,
"regions": [
{
"a1_range": "<string>",
"source_path": "<string>",
"basis": "verified",
"bounding": false,
"kind": "sheet",
"matched_rows": 0,
"scan_index": 123,
"scan_label": "<string>",
"sheet_name": "<string>"
}
],
"result_id": "<string>",
"row_count": 0,
"rows": [
{}
],
"source_paths": [
"<string>"
],
"supports_answer": true,
"verified": false
}
],
"relevance": "",
"source_file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"executed_at": "2023-11-07T05:31:56Z",
"exhausted": false,
"exhaustive": false,
"field_readability": [
{
"field": "<string>",
"in_scope": 123,
"readable": 123
}
],
"next_cursor": "<string>",
"result_type": "filtered_search",
"result_unit": "component",
"rows": [
{
"component": "<string>",
"component_kind": "document",
"source_file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_path": "<string>",
"category": "<string>",
"cells": [
{
"field": "<string>",
"status": "found",
"citation": {
"location": {
"page": 2,
"kind": "page_region",
"polygons": [
[
[
123,
123
]
]
]
},
"source_text": "<string>"
},
"item_index": 0,
"native_display": "<string>",
"native_raw": "<string>",
"value": {
"amount": "<string>",
"currency": "<string>",
"currency_source": "stated",
"kind": "money"
}
}
],
"components": [
{
"component": "<string>",
"component_kind": "document",
"category": "<string>",
"cells": [
{
"field": "<string>",
"status": "found",
"citation": {
"location": {
"page": 2,
"kind": "page_region",
"polygons": [
[
[
123,
123
]
]
]
},
"source_text": "<string>"
},
"item_index": 0,
"native_display": "<string>",
"native_raw": "<string>",
"value": {
"amount": "<string>",
"currency": "<string>",
"currency_source": "stated",
"kind": "money"
}
}
],
"content_matches": [
{
"condition": "<string>",
"evidences": [
{
"quote": "<string>",
"source_file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_path": "<string>",
"a1_range": "<string>",
"component": "<string>",
"page": 123
}
],
"value": "<string>"
}
],
"document_type": "<string>",
"entity_id": "<string>",
"page_end": 123,
"page_start": 123,
"source_row": 123,
"subcategory": "<string>",
"summary": ""
}
],
"content_matches": [
{
"condition": "<string>",
"evidences": [
{
"quote": "<string>",
"source_file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_path": "<string>",
"a1_range": "<string>",
"component": "<string>",
"page": 123
}
],
"value": "<string>"
}
],
"document_type": "<string>",
"entity_id": "<string>",
"entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"page_end": 123,
"page_start": 123,
"source_row": 123,
"subcategory": "<string>",
"summary": ""
}
],
"steps_used": 0,
"tool_calls": [
{
"arguments_digest": "<string>",
"duration_ms": 123,
"hits": 123,
"tool": "<string>"
}
],
"total_files": 123,
"total_matches": 0,
"truncated": false
},
"result_type": "automatic_agent"
},
"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
}
}qa
Ask a question about a workspace, as one turn of a conversation. Cost class: job.
Every turn runs the automatic search agent on its own — no router, no fixed
pipeline. It opens with what a search of the workspace finds for the turn,
answers straight from that when it already holds the answer, and otherwise
reads documents, queries tables, and selects documents from the metadata
catalog until it can. Every tool enforces the caller’s access and the
conversation’s scope: path_prefix and paths resolve to one file set.
Pass a result’s session_id to ask a follow-up: the agent resumes the
conversation, so “and for 2023?” or “why?” means what it means in context.
When a question is genuinely ambiguous the agent may ask back instead
(allow_clarification, on by default): the result then carries
clarification_questions with answer null; reply with
clarification_answers and the same session_id, or rephrase.
The result is the agent’s answer — citations, SQL receipts, confidence — plus,
when it answered from a catalog query, the catalog table, whose
next_cursor continues through filtered-search.
curl --request POST \
--url https://ndi-api.nace.ai/v1/workspaces/{workspace_id}/qa \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"query": "<string>"
}
'{
"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": "automatic_agent",
"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": {
"answer": {
"agent_usage": {
"compaction_requests": 1,
"execution_requests": 1,
"finalization_requests": 1,
"total_requests": 1
},
"answer": "<string>",
"binding": {
"columns": [
{
"column": "<string>",
"path": "<string>",
"slot": "<string>",
"table_name": "<string>",
"component": "<string>",
"detail": "<string>"
}
],
"notes": [
"<string>"
],
"periods": [
{
"role": "<string>",
"value": "<string>"
}
],
"policy_sheets": [
"<string>"
],
"revised_because": "<string>",
"tables": [
{
"path": "<string>",
"role": "<string>",
"table_name": "<string>",
"component": "<string>"
}
],
"value_sets": [
{
"column": "<string>",
"name": "<string>",
"path": "<string>",
"slot": "<string>",
"table_name": "<string>",
"component": "<string>",
"note": "",
"values": [
"<string>"
]
}
]
},
"cache": {
"cached_at": "2023-11-07T05:31:56Z",
"served_from_cache": true,
"verified_at": "2023-11-07T05:31:56Z",
"source_job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"claims": [
{
"claim": "<string>",
"claim_id": "<string>",
"reference": {
"cited_value": "<string>",
"kind": "result_cell",
"result_id": "<string>",
"column": "<string>",
"row": 123
},
"answer_excerpt": "<string>",
"answer_occurrence": 0,
"evidence_indices": [
123
]
}
],
"clarification": "<string>",
"clarification_questions": [
{
"question": "<string>",
"options": [
"<string>"
]
}
],
"command_receipts": [
{
"command": "<string>",
"outputs": {},
"result_id": "<string>",
"stdout": "<string>"
}
],
"confidence": "certain",
"coverage": [
{
"deliverable_id": "<string>",
"description": "<string>",
"status": "answered",
"absence_result_ids": [
"<string>"
],
"basis": "sql",
"claim_ids": [
"<string>"
],
"complete_result": {
"result_id": "<string>",
"columns": [
"<string>"
],
"rows": [
[
"<string>"
]
],
"truncated": false
},
"complete_result_id": "<string>",
"evidence_indices": [
123
],
"missing_inputs": [
"<string>"
]
}
],
"criteria": [
{
"criterion_id": "<string>",
"description": "<string>",
"status": "performed",
"blocker": "binding_unresolved",
"incomplete_reason": "binding_unresolved",
"missing_parameters": [
"close_cutoff"
],
"spec_id": "<string>"
}
],
"degraded": "<string>",
"discrepancies": [
"<string>"
],
"evidences": [
{
"quote": "<string>",
"source_path": "<string>",
"component": "<string>",
"derivation": {
"steps": [
{
"kind": "extraction",
"label": "<string>",
"result_id": "<string>",
"sql": "<string>",
"preview_rows": [
{}
],
"reads": [
"<string>"
]
}
]
},
"page": 123,
"queries": [
{
"sql": "<string>",
"columns": [
{
"data_type": "<string>",
"name": "<string>"
}
],
"grounding_reason": "<string>",
"grounding_status": "exact",
"preview_truncated": false,
"regions": [
{
"a1_range": "<string>",
"source_path": "<string>",
"basis": "verified",
"bounding": false,
"kind": "sheet",
"matched_rows": 0,
"scan_index": 123,
"scan_label": "<string>",
"sheet_name": "<string>"
}
],
"result_id": "<string>",
"row_count": 0,
"rows": [
{}
],
"source_paths": [
"<string>"
],
"supports_answer": true,
"verified": false
}
],
"relevance": "",
"source_file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"execution_status": "performed",
"exhausted": false,
"figures": [
{
"count": 1,
"criterion": "<string>",
"definition": "<string>",
"population": 1,
"spec_id": "<string>",
"band_group": "<string>",
"breakdown": {
"result_id": "<string>",
"columns": [
"<string>"
],
"rows": [
[
"<string>"
]
],
"truncated": false
},
"cannot_be_performed": false,
"exception_listing_result_id": "<string>",
"result_ids": [
"<string>"
],
"value": "<string>"
}
],
"grounding_job_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"population_statement": "<string>",
"quality": {
"status": "clean",
"missing_artifacts": [
"binding"
],
"retried_checks": [
"specs"
],
"tool_failures": [
{
"count": 2,
"outcome": "model_retry",
"tool": "<string>"
}
],
"validation_warnings": [
{
"check": "specs",
"status": "failed_open"
}
],
"withheld_receipt_figures": 0
},
"reasoning": "<string>",
"result_type": "deep_search_v2",
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"spec_digest": "<string>",
"sql_receipts": [
{
"result_id": "<string>",
"sql": "<string>",
"columns": [
"<string>"
],
"executor": "<string>",
"grounding_status": "exact",
"handle": "<string>",
"parameters": {},
"replay": {
"catalog_sha256": "<string>",
"engine": "duckdb",
"engine_threads": 123,
"engine_version": "<string>",
"kind": "aggregate",
"logical_plan_sha256": "<string>",
"normalized_sql": "<string>",
"result_artifact_sha256": "<string>",
"result_data_sha256": "<string>",
"result_digest_version": "<string>",
"sql_sha256": "<string>",
"result_dependencies": [
"<string>"
],
"schema_version": 1
},
"result_row_count": 0,
"row_count": 0,
"rows": [
{}
],
"saved_as": "<string>",
"table_bindings": [
{
"path": "<string>",
"table_name": "<string>",
"component": "<string>",
"source_sha256": "<string>"
}
],
"truncated": false,
"view_sql": "<string>",
"views_used": [
"<string>"
],
"warnings": [
"<string>"
]
}
],
"steps_used": 0,
"structured_answer": "<unknown>",
"tool_calls": [
{
"arguments_digest": "<string>",
"duration_ms": 123,
"hits": 123,
"tool": "<string>"
}
],
"usage": {
"by_model": [
{
"model": "<string>",
"cached_input_tokens": 0,
"input_tokens": 0,
"output_tokens": 0,
"requests": 0
}
],
"cached_input_tokens": 0,
"input_tokens": 0,
"output_tokens": 0,
"requests": 0
}
},
"catalog": {
"applied_query": "<string>",
"candidates_seen": 0,
"catalog_drifted": false,
"clarification": "<string>",
"columns": [
{
"field": "<string>",
"kind": "text",
"description": "",
"filtered": false,
"repeated": false,
"requested": false
}
],
"confidence": "certain",
"content_evidences": [
{
"quote": "<string>",
"source_file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_path": "<string>",
"a1_range": "<string>",
"component": "<string>",
"page": 123
}
],
"content_verification": {
"candidates": 1,
"condition": "<string>",
"unverified_candidates": 1
},
"coverage": {
"labels_required": [
"<string>"
],
"request_access_hint": "<string>",
"restricted_candidates": 0
},
"evidences": [
{
"quote": "<string>",
"source_path": "<string>",
"component": "<string>",
"derivation": {
"steps": [
{
"kind": "extraction",
"label": "<string>",
"result_id": "<string>",
"sql": "<string>",
"preview_rows": [
{}
],
"reads": [
"<string>"
]
}
]
},
"page": 123,
"queries": [
{
"sql": "<string>",
"columns": [
{
"data_type": "<string>",
"name": "<string>"
}
],
"grounding_reason": "<string>",
"grounding_status": "exact",
"preview_truncated": false,
"regions": [
{
"a1_range": "<string>",
"source_path": "<string>",
"basis": "verified",
"bounding": false,
"kind": "sheet",
"matched_rows": 0,
"scan_index": 123,
"scan_label": "<string>",
"sheet_name": "<string>"
}
],
"result_id": "<string>",
"row_count": 0,
"rows": [
{}
],
"source_paths": [
"<string>"
],
"supports_answer": true,
"verified": false
}
],
"relevance": "",
"source_file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"executed_at": "2023-11-07T05:31:56Z",
"exhausted": false,
"exhaustive": false,
"field_readability": [
{
"field": "<string>",
"in_scope": 123,
"readable": 123
}
],
"next_cursor": "<string>",
"result_type": "filtered_search",
"result_unit": "component",
"rows": [
{
"component": "<string>",
"component_kind": "document",
"source_file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_path": "<string>",
"category": "<string>",
"cells": [
{
"field": "<string>",
"status": "found",
"citation": {
"location": {
"page": 2,
"kind": "page_region",
"polygons": [
[
[
123,
123
]
]
]
},
"source_text": "<string>"
},
"item_index": 0,
"native_display": "<string>",
"native_raw": "<string>",
"value": {
"amount": "<string>",
"currency": "<string>",
"currency_source": "stated",
"kind": "money"
}
}
],
"components": [
{
"component": "<string>",
"component_kind": "document",
"category": "<string>",
"cells": [
{
"field": "<string>",
"status": "found",
"citation": {
"location": {
"page": 2,
"kind": "page_region",
"polygons": [
[
[
123,
123
]
]
]
},
"source_text": "<string>"
},
"item_index": 0,
"native_display": "<string>",
"native_raw": "<string>",
"value": {
"amount": "<string>",
"currency": "<string>",
"currency_source": "stated",
"kind": "money"
}
}
],
"content_matches": [
{
"condition": "<string>",
"evidences": [
{
"quote": "<string>",
"source_file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_path": "<string>",
"a1_range": "<string>",
"component": "<string>",
"page": 123
}
],
"value": "<string>"
}
],
"document_type": "<string>",
"entity_id": "<string>",
"page_end": 123,
"page_start": 123,
"source_row": 123,
"subcategory": "<string>",
"summary": ""
}
],
"content_matches": [
{
"condition": "<string>",
"evidences": [
{
"quote": "<string>",
"source_file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_path": "<string>",
"a1_range": "<string>",
"component": "<string>",
"page": 123
}
],
"value": "<string>"
}
],
"document_type": "<string>",
"entity_id": "<string>",
"entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"page_end": 123,
"page_start": 123,
"source_row": 123,
"subcategory": "<string>",
"summary": ""
}
],
"steps_used": 0,
"tool_calls": [
{
"arguments_digest": "<string>",
"duration_ms": 123,
"hits": 123,
"tool": "<string>"
}
],
"total_files": 123,
"total_matches": 0,
"truncated": false
},
"result_type": "automatic_agent"
},
"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.
200Path Parameters
Workspace identifier.
Query 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 POST /workspaces/{workspace_id}/qa — one turn of a question-answering conversation.
Each turn runs the automatic search agent alone: no router and no fact pipeline, so the agent itself decides whether what its opening search found already answers the turn or whether to read and compute further. No model, effort or tool-surface field: the service resolves the configuration.
What to answer, in the caller's own words. Stripped before its length is checked; a blank query is refused rather than run.
1 - 4096Let the agent ask instead of guessing when a question is genuinely ambiguous and the reading materially changes the answer. Such a turn's result carries the questions in clarification_questions with answer null; reply in the same conversation with clarification_answers or a rephrased query. A turn that sends clarification_answers never asks again. On by default; off means the agent always answers with its best reading, stated in the answer.
Answers to the clarifying questions this conversation's last turn asked, one per question, in order. Send them with that turn's session_id and its query; the agent then answers that query with the answers applied.
1 - 2 elementsShow child attributes
Show child attributes
Free-form background for the model — the engagement, the entity, what the caller already knows. It informs the answer; it does not widen or narrow which files the caller may see.
20000A JSON Schema (Draft 2020-12, object root, local non-recursive $ref only, no pattern, patternProperties or unevaluated*) the answer must follow. When set, the agent writes answer as JSON text conforming to it, the run checks that and asks the agent to correct a mismatch, and the result carries the parsed value in structured_answer. A field the source does not state comes back null, whatever type the schema gives it. Explanation goes to reasoning where the result has one, and evidences are unchanged. If the answer still misses the schema, the run succeeds with answer as written and structured_answer null. Omit for a prose answer. Applies only to the turn that sends it: to keep structured answers across a conversation, send it on every turn, including a reply to clarifying questions. A turn that asks clarifying questions returns them with structured_answer null.
Show child attributes
Show child attributes
Put every uploaded file under one folder subtree, workspace-relative, in the run's scope; paths, where the body takes it, adds more files. Omit both for the whole workspace.
Scope the conversation to exactly these uploaded files. Every tool the agent runs sees only these files and the content ingested from them. Each entry names an uploaded source file (never a folder — scope folders with path_prefix; the two add up). Unknown or inaccessible paths are refused up front.
11 - 1024Continue a conversation: the session_id echoed on an earlier turn's result. With the same folder/file scope and access grants the agent resumes the conversation, so a follow-up can lean on what was already asked and answered; a changed scope or grants starts a fresh conversation and returns a new session_id. Omit to start one. Only the API key that started it may continue it; a conversation whose turn is still running returns 409 session_busy.
Response
Successful Response
One turn of a qa conversation: the automatic search agent's job, answered or asking back.
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.
The automatic search agent, which answers every QA turn.
"automatic_agent"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 only on succeeded, and only while retained.
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.