{
"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
}
}
run_sql
Run one caller-authored read-only SELECT over the workspace’s tables.
Cost class: fast. No planner and no answering agent — the statement
runs directly in the guarded SQL engine, against every queryable tab in
the workspace registered as a view under the table_name that
file-metadata and the folder-metadata table census publish. Joins
across files are ordinary SQL joins; earlier run-sql results are
registered too, so a returned res_… handle can be joined, aggregated,
or paged with LIMIT/OFFSET in the next statement.
The full result is retained as parquet whatever the preview shows —
result_citation.result_file.download_url fetches it whole. A
statement that is not a read, or reads an unregistered table, is refused
with invalid_request naming the rule broken and the registered
tables. For a natural-language question — or when the answer should be
composed and cited for you — use query-tables instead.
{
"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
}
}
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.
One read-only SELECT over the workspace's queryable tables.
Table names come from metadata — file-metadata publishes each
queryable tab's table_name and folder-metadata's table census
lists them all — and from earlier run-sql results (every response's
res_… handle is a registered table on the next call, so results can
be joined, aggregated, or paged with LIMIT/OFFSET). Joins across files
are ordinary SQL joins. A statement that is not a read, or that reads an
unregistered table, is refused with invalid_request naming the rule
and the registered tables.
One read-only SELECT (DuckDB dialect) over the registered tables and earlier res_… handles.
Required string length: 1 - 4096
Response
Successful Response
One executed statement: shape, bounded preview, and the retained result.
The stored result is complete whatever the preview shows;
result_citation.result_file.download_url fetches the whole parquet.
duplicate marks a statement answered from an earlier identical run's
stored result — free, and safe to build on.
The uploaded files the statement read — carried on the response itself so source attribution survives when no result file is materialized (job-attributed agent statements).
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"NDI Platform API","description":"Document intelligence platform API — parse, split, classify, extract, and ground information from any document.","colors":{"primary":"#111111","light":"#737373","dark":"#E5E5E5"},"favicon":"https://mintcdn.com/nace-ai/RoMHjaneGKdnwusm/favicon.png?fit=max\u0026auto=format\u0026n=RoMHjaneGKdnwusm\u0026q=85\u0026s=9b5d6ee38930c58bd4cc7e964e66a5b0","api":{"openapi":"openapi.json","playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["curl"],"autogenerate":true}},"appearance":{"default":"system"},"background":{"decoration":"gradient"},"footer":{"socials":{}},"icons":{"library":"lucide"},"styling":{"eyebrows":"breadcrumbs","codeblocks":"dark","latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"nace-ai","hasAudioNarration":false,"actualSubdomain":"nace-ai","customDomains":["docs.ndi.nace.ai"],"gitSource":{"type":"github","owner":"yeranaceai","repo":"ndi-service-api-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"collectionId":"bb7700a9-5e4a-46f9-9f46-425b05d81fdf","liveDeploymentHistoryId":"6ae38b0206fe1d05edcfd465","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae38b0206fe1d05edcfd465"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae38dd6c9558d6be3a07bcb","clientVersion":"0.0.4021","searchFilterCounts":[{"language":"default","tag":"API Reference","count":105},{"language":"default","tag":"Documentation","count":43},{"language":"default","tag":"SDKs","count":36},{"language":"default","tag":"Core methods","count":28},{"language":"default","tag":"Workspaces and files","count":25},{"language":"default","tag":"Guides","count":25},{"language":"default","tag":"Catalog","count":22},{"language":"default","tag":"Tools and search","count":20},{"language":"default","tag":"Jobs and usage","count":16},{"language":"default","tag":"Concepts","count":12}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"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":"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":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","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":"per-site-search-delta","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":"editor-private-page-search","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":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","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":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/tools/run_sql","slug":"/api-reference/tools/run_sql","pageMetadata":{"title":"run_sql","description":"Run one caller-authored read-only SELECT over the workspace's tables.\n\n**Cost class: fast.** No planner and no answering agent — the statement\nruns directly in the guarded SQL engine, against every queryable tab in\nthe workspace registered as a view under the ``table_name`` that\n``file-metadata`` and the folder-metadata table census publish. Joins\nacross files are ordinary SQL joins; earlier run-sql results are\nregistered too, so a returned ``res_…`` handle can be joined, aggregated,\nor paged with LIMIT/OFFSET in the next statement.\n\nThe full result is retained as parquet whatever the preview shows —\n``result_citation.result_file.download_url`` fetches it whole. A\nstatement that is not a read, or reads an unregistered table, is refused\nwith ``invalid_request`` naming the rule broken and the registered\ntables. For a natural-language question — or when the answer should be\ncomposed and cited for you — use ``query-tables`` instead.","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/tools/run-sql","href":"/api-reference/tools/run_sql","autogeneratedByOpenApi":true},"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: [_jsx(_components.p, {\n children: \"Run one caller-authored read-only SELECT over the workspace’s tables.\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"Cost class: fast.\"\n }), \" No planner and no answering agent — the statement\\nruns directly in the guarded SQL engine, against every queryable tab in\\nthe workspace registered as a view under the \", _jsx(_components.code, {\n children: \"table_name\"\n }), \" that\\n\", _jsx(_components.code, {\n children: \"file-metadata\"\n }), \" and the folder-metadata table census publish. Joins\\nacross files are ordinary SQL joins; earlier run-sql results are\\nregistered too, so a returned \", _jsx(_components.code, {\n children: \"res_…\"\n }), \" handle can be joined, aggregated,\\nor paged with LIMIT/OFFSET in the next statement.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"The full result is retained as parquet whatever the preview shows —\\n\", _jsx(_components.code, {\n children: \"result_citation.result_file.download_url\"\n }), \" fetches it whole. A\\nstatement that is not a read, or reads an unregistered table, is refused\\nwith \", _jsx(_components.code, {\n children: \"invalid_request\"\n }), \" naming the rule broken and the registered\\ntables. For a natural-language question — or when the answer should be\\ncomposed and cited for you — use \", _jsx(_components.code, {\n children: \"query-tables\"\n }), \" instead.\"]\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}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"run_sql","description":"Run one caller-authored read-only SELECT over the workspace's tables.\n\n**Cost class: fast.** No planner and no answering agent — the statement\nruns directly in the guarded SQL engine, against every queryable tab in\nthe workspace registered as a view under the ``table_name`` that\n``file-metadata`` and the folder-metadata table census publish. Joins\nacross files are ordinary SQL joins; earlier run-sql results are\nregistered too, so a returned ``res_…`` handle can be joined, aggregated,\nor paged with LIMIT/OFFSET in the next statement.\n\nThe full result is retained as parquet whatever the preview shows —\n``result_citation.result_file.download_url`` fetches it whole. A\nstatement that is not a read, or reads an unregistered table, is refused\nwith ``invalid_request`` naming the rule broken and the registered\ntables. For a natural-language question — or when the answer should be\ncomposed and cited for you — use ``query-tables`` instead.","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/tools/run-sql","href":"/api-reference/tools/run_sql","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"description":"Run one caller-authored read-only SELECT over the workspace's tables.\n\n**Cost class: fast.** No planner and no answering agent — the statement\nruns directly in the guarded SQL engine, against every queryable tab in\nthe workspace registered as a view under the ``table_name`` that\n``file-metadata`` and the folder-metadata table census publish. Joins\nacross files are ordinary SQL joins; earlier run-sql results are\nregistered too, so a returned ``res_…`` handle can be joined, aggregated,\nor paged with LIMIT/OFFSET in the next statement.\n\nThe full result is retained as parquet whatever the preview shows —\n``result_citation.result_file.download_url`` fetches it whole. A\nstatement that is not a read, or reads an unregistered table, is refused\nwith ``invalid_request`` naming the rule broken and the registered\ntables. For a natural-language question — or when the answer should be\ncomposed and cited for you — use ``query-tables`` instead.","operationId":"run_sql_v1_workspaces__workspace_id__tools_run_sql_post","parameters":["c54acf2c-e1b7-4425-9be7-71c367f8afbe","36087adf-cd7b-4894-a0e0-082e3c2bd8a3"],"requestBody":"6b428eeb-d408-49b0-8bcb-798021662449","responses":{"200":"f639b968-3cd3-4fa7-8b40-d76ac609a201","504":"4b839a8f-d741-4020-8773-7a72ed6a0dc3","default":"65024238-bc58-419c-a428-053445c68705"},"security":["40c82bc1-2392-4925-8090-531537389e70"],"summary":"run_sql","tags":["tools"],"method":"post","type":"path","servers":["eacc9f52-2b49-4ba8-ab98-c9e34e13dac3"],"path":"/v1/workspaces/{workspace_id}/tools/run-sql","baseUrlOptions":["https://ndi-api.nace.ai"],"title":"run_sql","codeSamples":[],"requestExampleLanguages":["bash"],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"c54acf2c-e1b7-4425-9be7-71c367f8afbe":{"description":"Workspace identifier.","in":"path","name":"workspace_id","required":true,"schema":{"description":"Workspace identifier.","format":"uuid","title":"Workspace Id","type":"string","isRequired":true,"uniqueKey":"","typeLabel":"string\u003cuuid>"}},"36087adf-cd7b-4894-a0e0-082e3c2bd8a3":{"description":"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.","in":"header","name":"Idempotency-Key","required":false,"schema":{"oneOf":[{"type":"string","title":"Idempotency-Key","description":"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.","maxLength":200,"uniqueKey":"oneOf.0","typeLabel":"string"},{"type":"null","title":"Idempotency-Key","description":"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.","uniqueKey":"oneOf.1","typeLabel":"null"}],"isRequired":false,"uniqueKey":"","typeLabel":"string | null"}}},"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"description":"One read-only SELECT over the workspace's queryable tables.\n\nTable names come from metadata — ``file-metadata`` publishes each\nqueryable tab's ``table_name`` and ``folder-metadata``'s table census\nlists them all — and from earlier run-sql results (every response's\n``res_…`` handle is a registered table on the next call, so results can\nbe joined, aggregated, or paged with LIMIT/OFFSET). Joins across files\nare ordinary SQL joins. A statement that is not a read, or that reads an\nunregistered table, is refused with ``invalid_request`` naming the rule\nand the registered tables.","properties":{"sql":{"description":"One read-only SELECT (DuckDB dialect) over the registered tables and earlier `res_…` handles.","maxLength":4096,"minLength":1,"title":"Sql","type":"string","isRequired":true,"uniqueKey":"sql","typeLabel":"string"}},"required":["sql"],"title":"RunSqlRequest","type":"object","uniqueKey":"","typeLabel":"RunSqlRequest · object"},"examples":{"Example":{"title":"Example","value":{"sql":"\u003cstring>"}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"f639b968-3cd3-4fa7-8b40-d76ac609a201":{"content":{"application/json":{"schema":{"additionalProperties":false,"description":"One executed statement: shape, bounded preview, and the retained result.\n\nThe stored result is complete whatever the preview shows;\n``result_citation.result_file.download_url`` fetches the whole parquet.\n``duplicate`` marks a statement answered from an earlier identical run's\nstored result — free, and safe to build on.","properties":{"result":{"additionalProperties":false,"description":"One retained result table with a bounded inline preview.","properties":{"handle":{"title":"Handle","type":"string","isRequired":true,"uniqueKey":"result.handle","typeLabel":"string"},"row_count":{"title":"Row Count","type":"integer","isRequired":true,"uniqueKey":"result.row_count","typeLabel":"integer"},"columns":{"default":[],"items":{"additionalProperties":false,"description":"One public column in a retained result preview.","properties":{"data_type":{"title":"Data Type","type":"string","isRequired":true,"uniqueKey":"result.columns.items.[INDEX].data_type","typeLabel":"string"},"name":{"title":"Name","type":"string","isRequired":true,"uniqueKey":"result.columns.items.[INDEX].name","typeLabel":"string"}},"required":["name","data_type"],"title":"QueryTableColumn","type":"object","uniqueKey":"result.columns.items.[INDEX]","typeLabel":"QueryTableColumn · object"},"maxItems":50,"title":"Columns","type":"array","uniqueKey":"result.columns","typeLabel":"QueryTableColumn · object[]"},"path":{"oneOf":[{"type":"string","title":"Path","uniqueKey":"result.path.oneOf.0","typeLabel":"string"},{"type":"null","title":"Path","uniqueKey":"result.path.oneOf.1","typeLabel":"null"}],"uniqueKey":"result.path","typeLabel":"string | null"},"preview_truncated":{"default":false,"title":"Preview Truncated","type":"boolean","uniqueKey":"result.preview_truncated","typeLabel":"boolean"},"rows":{"default":[],"items":{"additionalProperties":{"type":"string","uniqueKey":"result.rows.items.[INDEX].additionalProperties","typeLabel":"string"},"type":"object","uniqueKey":"result.rows.items.[INDEX]","typeLabel":"object"},"maxItems":20,"title":"Rows","type":"array","uniqueKey":"result.rows","typeLabel":"Rows · object[]"}},"required":["handle","row_count"],"title":"QueryTablePreview","type":"object","isRequired":true,"uniqueKey":"result","typeLabel":"QueryTablePreview · object"},"sql":{"description":"The normalized statement that ran — the result's provenance.","title":"Sql","type":"string","isRequired":true,"uniqueKey":"sql","typeLabel":"string"},"duplicate":{"default":false,"title":"Duplicate","type":"boolean","uniqueKey":"duplicate","typeLabel":"boolean"},"job_id":{"oneOf":[{"type":"string","title":"Job Id","description":"The external operation job; absent for commands inside a search job.","format":"uuid","uniqueKey":"job_id.oneOf.0","typeLabel":"string\u003cuuid>"},{"type":"null","title":"Job Id","description":"The external operation job; absent for commands inside a search job.","uniqueKey":"job_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"job_id","typeLabel":"string\u003cuuid> | null"},"result_citation":{"oneOf":[{"type":"object","title":"QueryTableCitation","description":"Provenance for one generated TablesQA result file.","required":["result_file","source_paths","sql"],"properties":{"result_file":{"additionalProperties":false,"description":"A workspace-visible Parquet file retained from a TablesQA query.","properties":{"download_url":{"title":"Download Url","type":"string","isRequired":true,"uniqueKey":"result_citation.oneOf.0.result_file.download_url","typeLabel":"string"},"download_url_expires_at":{"format":"date-time","title":"Download Url Expires At","type":"string","isRequired":true,"uniqueKey":"result_citation.oneOf.0.result_file.download_url_expires_at","typeLabel":"string\u003cdate-time>"},"file_id":{"format":"uuid","title":"File Id","type":"string","isRequired":true,"uniqueKey":"result_citation.oneOf.0.result_file.file_id","typeLabel":"string\u003cuuid>"},"file_name":{"title":"File Name","type":"string","isRequired":true,"uniqueKey":"result_citation.oneOf.0.result_file.file_name","typeLabel":"string"},"format":{"const":"parquet","title":"Format","type":"string","isRequired":true,"uniqueKey":"result_citation.oneOf.0.result_file.format","typeLabel":"string"},"handle":{"title":"Handle","type":"string","isRequired":true,"uniqueKey":"result_citation.oneOf.0.result_file.handle","typeLabel":"string"},"path":{"title":"Path","type":"string","isRequired":true,"uniqueKey":"result_citation.oneOf.0.result_file.path","typeLabel":"string"},"preview_url":{"title":"Preview Url","type":"string","isRequired":true,"uniqueKey":"result_citation.oneOf.0.result_file.preview_url","typeLabel":"string"},"row_count":{"title":"Row Count","type":"integer","isRequired":true,"uniqueKey":"result_citation.oneOf.0.result_file.row_count","typeLabel":"integer"}},"required":["file_id","handle","path","file_name","format","row_count","download_url","preview_url","download_url_expires_at"],"title":"QueryTableResultFile","type":"object","isRequired":true,"uniqueKey":"result_citation.oneOf.0.result_file","typeLabel":"QueryTableResultFile · object"},"source_paths":{"items":{"type":"string","uniqueKey":"result_citation.oneOf.0.source_paths.items.[INDEX]","typeLabel":"string"},"title":"Source Paths","type":"array","isRequired":true,"uniqueKey":"result_citation.oneOf.0.source_paths","typeLabel":"string[]"},"sql":{"title":"Sql","type":"string","isRequired":true,"uniqueKey":"result_citation.oneOf.0.sql","typeLabel":"string"},"grounding":{"oneOf":[{"type":"object","title":"TableQueryGrounding","description":"Exact source regions and bounded receipt data when capture-time provenance was available.","required":["sql"],"properties":{"sql":{"title":"Sql","type":"string","isRequired":true,"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.sql","typeLabel":"string"},"columns":{"items":{"additionalProperties":false,"description":"One column of an executed SQL query's result preview.","properties":{"data_type":{"title":"Data Type","type":"string","isRequired":true,"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.columns.items.[INDEX].data_type","typeLabel":"string"},"name":{"title":"Name","type":"string","isRequired":true,"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.columns.items.[INDEX].name","typeLabel":"string"}},"required":["name","data_type"],"title":"TableQueryColumn","type":"object","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.columns.items.[INDEX]","typeLabel":"TableQueryColumn · object"},"title":"Columns","type":"array","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.columns","typeLabel":"TableQueryColumn · object[]"},"grounding_reason":{"oneOf":[{"type":"string","title":"Grounding Reason","description":"Qualification on grounding_status, when present. Set for 'unavailable' (explains why proof was not possible) and for 'exact' when capture succeeded but the source regions are broader than the minimal contributing set (e.g. 'regions_broad:narrowing_specs_unavailable'). None when grounding is fully exact or absent.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.grounding_reason.oneOf.0","typeLabel":"string"},{"type":"null","title":"Grounding Reason","description":"Qualification on grounding_status, when present. Set for 'unavailable' (explains why proof was not possible) and for 'exact' when capture succeeded but the source regions are broader than the minimal contributing set (e.g. 'regions_broad:narrowing_specs_unavailable'). None when grounding is fully exact or absent.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.grounding_reason.oneOf.1","typeLabel":"null"}],"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.grounding_reason","typeLabel":"string | null"},"grounding_status":{"oneOf":[{"type":"string","title":"Grounding Status","description":"Capture-time provenance status behind this query's regions. 'exact': the exact-provenance sidecar proved every row the query read, so its 'provenance'-basis regions are trustworthy (source regions may be broader than the minimal contributing set when grounding_reason carries a 'regions_broad:…' qualifier). 'unavailable': no exact proof could be captured (a legacy result, or a statement shape the capturer cannot instrument) — no 'provenance'-basis regions are attached, never a guessed whole-table span. 'zero_result': the query matched no rows, so there is nothing to ground. None on legacy payloads and on a query with no unclaimed table left to ground.","enum":["exact","unavailable","zero_result"],"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.grounding_status.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","title":"Grounding Status","description":"Capture-time provenance status behind this query's regions. 'exact': the exact-provenance sidecar proved every row the query read, so its 'provenance'-basis regions are trustworthy (source regions may be broader than the minimal contributing set when grounding_reason carries a 'regions_broad:…' qualifier). 'unavailable': no exact proof could be captured (a legacy result, or a statement shape the capturer cannot instrument) — no 'provenance'-basis regions are attached, never a guessed whole-table span. 'zero_result': the query matched no rows, so there is nothing to ground. None on legacy payloads and on a query with no unclaimed table left to ground.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.grounding_status.oneOf.1","typeLabel":"null"}],"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.grounding_status","typeLabel":"enum\u003cstring> | null"},"preview_truncated":{"default":false,"description":"Whether the preview cut rows or columns.","title":"Preview Truncated","type":"boolean","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.preview_truncated","typeLabel":"boolean"},"regions":{"description":"Original-file coordinates for the verified claims whose source file has an addressable grid.","items":{"oneOf":[{"type":"object","title":"SheetQueryRegion","description":"A verified region on a source file with an addressable grid.\n\nCoordinates are expressed in the caller's uploaded workbook or CSV, never\nin the internal parquet derivative.","required":["source_path","a1_range"],"properties":{"a1_range":{"description":"A1 range on the original sheet, e.g. 'B12:D15'.","title":"A1 Range","type":"string","isRequired":true,"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.0.a1_range","typeLabel":"string"},"source_path":{"description":"Uploaded file path this region points at.","title":"Source Path","type":"string","isRequired":true,"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.0.source_path","typeLabel":"string"},"basis":{"default":"verified","description":"How this region was established. 'verified': a claim whose cited value was mechanically re-computed from exactly these rows. 'inputs': one table's contribution to a derived (multi-table) figure — the rows were verified to match the claim's filters, but the figure itself is not re-computable from this table alone. 'provenance': no claim covered this query, so the region records what the query's captured provenance proved it read — never a whole-table guess. Absent on legacy payloads, which are all 'verified'.","enum":["verified","inputs","provenance"],"title":"Basis","type":"string","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.0.basis","typeLabel":"enum\u003cstring>"},"bounding":{"default":false,"description":"True when this is a bounding box over a large match set rather than exact runs.","title":"Bounding","type":"boolean","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.0.bounding","typeLabel":"boolean"},"kind":{"const":"sheet","default":"sheet","title":"Kind","type":"string","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.0.kind","typeLabel":"string"},"matched_rows":{"default":0,"description":"How many source rows the region covers.","title":"Matched Rows","type":"integer","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.0.matched_rows","typeLabel":"integer"},"scan_index":{"oneOf":[{"type":"integer","title":"Scan Index","description":"Which scan of the query read these rows, when the region records one scan rather than the whole table. A query can read one file more than once — a narrow CTE and a broad one, say — and each such scan grounds separately, so this identifies the scan to replay for further row pages. Absent on a whole-table span, on verified regions, and on legacy payloads.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.0.scan_index.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Scan Index","description":"Which scan of the query read these rows, when the region records one scan rather than the whole table. A query can read one file more than once — a narrow CTE and a broad one, say — and each such scan grounds separately, so this identifies the scan to replay for further row pages. Absent on a whole-table span, on verified regions, and on legacy payloads.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.0.scan_index.oneOf.1","typeLabel":"null"}],"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.0.scan_index","typeLabel":"integer | null"},"scan_label":{"oneOf":[{"type":"string","title":"Scan Label","description":"The scan named the way the query spells it: 'main query', 'CTE \u003cname>', or 'subquery \u003cn>'. Present exactly when scan_index is.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.0.scan_label.oneOf.0","typeLabel":"string"},{"type":"null","title":"Scan Label","description":"The scan named the way the query spells it: 'main query', 'CTE \u003cname>', or 'subquery \u003cn>'. Present exactly when scan_index is.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.0.scan_label.oneOf.1","typeLabel":"null"}],"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.0.scan_label","typeLabel":"string | null"},"sheet_name":{"oneOf":[{"type":"string","title":"Sheet Name","description":"Workbook tab, when applicable.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.0.sheet_name.oneOf.0","typeLabel":"string"},{"type":"null","title":"Sheet Name","description":"Workbook tab, when applicable.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.0.sheet_name.oneOf.1","typeLabel":"null"}],"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.0.sheet_name","typeLabel":"string | null"}},"additionalProperties":false,"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.0","typeLabel":"SheetQueryRegion · object"},{"type":"object","title":"RowRangeQueryRegion","description":"A verified region on a pageable tabular artifact, addressed by row number.\n\nA parquet upload stored as-is uses its own row order. A jsonl or parquet\nderivative uses the queried artifact's row order; ``derivative_path`` names\nthat artifact when it differs from the caller-facing ``source_path``.","required":["source_path","start_row","end_row"],"properties":{"end_row":{"description":"Last row of the run, 0-based and inclusive.","title":"End Row","type":"integer","isRequired":true,"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.end_row","typeLabel":"integer"},"source_path":{"description":"Uploaded file path this region belongs to.","title":"Source Path","type":"string","isRequired":true,"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.source_path","typeLabel":"string"},"start_row":{"description":"First row of the run, 0-based and inclusive.","title":"Start Row","type":"integer","isRequired":true,"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.start_row","typeLabel":"integer"},"basis":{"default":"verified","description":"How this region was established. 'verified': a claim whose cited value was mechanically re-computed from exactly these rows. 'inputs': one table's contribution to a derived (multi-table) figure — the rows were verified to match the claim's filters, but the figure itself is not re-computable from this table alone. 'provenance': no claim covered this query, so the region records what the query's captured provenance proved it read — never a whole-table guess. Absent on legacy payloads, which are all 'verified'.","enum":["verified","inputs","provenance"],"title":"Basis","type":"string","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.basis","typeLabel":"enum\u003cstring>"},"bounding":{"default":false,"description":"True when this is a bounding range over a large match set rather than exact runs.","title":"Bounding","type":"boolean","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.bounding","typeLabel":"boolean"},"columns":{"description":"Cited column names, in table order.","items":{"type":"string","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.columns.items.[INDEX]","typeLabel":"string"},"title":"Columns","type":"array","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.columns","typeLabel":"string[]"},"derivative_path":{"oneOf":[{"type":"string","title":"Derivative Path","description":"Pageable derivative (parquet or jsonl) when it is not the uploaded source itself.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.derivative_path.oneOf.0","typeLabel":"string"},{"type":"null","title":"Derivative Path","description":"Pageable derivative (parquet or jsonl) when it is not the uploaded source itself.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.derivative_path.oneOf.1","typeLabel":"null"}],"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.derivative_path","typeLabel":"string | null"},"filter_columns":{"description":"Columns the verified claim filtered on to select these rows, minus any already in columns. Empty on legacy payloads.","items":{"type":"string","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.filter_columns.items.[INDEX]","typeLabel":"string"},"title":"Filter Columns","type":"array","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.filter_columns","typeLabel":"string[]"},"kind":{"const":"row_range","default":"row_range","title":"Kind","type":"string","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.kind","typeLabel":"string"},"matched_rows":{"default":0,"description":"How many source rows the region covers.","title":"Matched Rows","type":"integer","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.matched_rows","typeLabel":"integer"},"read_columns":{"description":"Columns the query read from this table (output lineage), minus any already in columns or filter_columns. Populated on a 'provenance'-basis region only; empty otherwise and on legacy payloads.","items":{"type":"string","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.read_columns.items.[INDEX]","typeLabel":"string"},"title":"Read Columns","type":"array","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.read_columns","typeLabel":"string[]"},"region_id":{"oneOf":[{"type":"string","title":"Region Id","description":"Opaque identity for paging this exact region when a receipt has several regions on one file.","format":"uuid","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.region_id.oneOf.0","typeLabel":"string\u003cuuid>"},{"type":"null","title":"Region Id","description":"Opaque identity for paging this exact region when a receipt has several regions on one file.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.region_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.region_id","typeLabel":"string\u003cuuid> | null"},"runs":{"description":"Exact matched-row runs inside the span, so a bounding range stays pageable as matches only. May cover fewer than matched_rows when the verifier truncated its run list; empty on legacy payloads.","items":{"additionalProperties":false,"description":"One inclusive 0-based run of matched rows in the pageable artifact.","properties":{"end":{"description":"Last matched row of the run, 0-based and inclusive.","title":"End","type":"integer","isRequired":true,"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.runs.items.[INDEX].end","typeLabel":"integer"},"start":{"description":"First matched row of the run, 0-based and inclusive.","title":"Start","type":"integer","isRequired":true,"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.runs.items.[INDEX].start","typeLabel":"integer"}},"required":["start","end"],"title":"ArtifactRowRun","type":"object","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.runs.items.[INDEX]","typeLabel":"ArtifactRowRun · object"},"title":"Runs","type":"array","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.runs","typeLabel":"ArtifactRowRun · object[]"},"runs_replayable":{"default":false,"description":"True only when grounding-rows can reconstruct this exact region predicate for pages beyond runs. Regions without a safe replay fail closed instead of returning broader rows.","title":"Runs Replayable","type":"boolean","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.runs_replayable","typeLabel":"boolean"},"runs_truncated":{"default":false,"description":"True when runs is an exact ordered prefix of matched islands and more matched rows exist. Later pages require guarded replay; false when the runs are complete or on legacy payloads.","title":"Runs Truncated","type":"boolean","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.runs_truncated","typeLabel":"boolean"},"scan_index":{"oneOf":[{"type":"integer","title":"Scan Index","description":"Which scan of the query read these rows, when the region records one scan rather than the whole table. A query can read one file more than once — a narrow CTE and a broad one, say — and each such scan grounds separately, so this identifies the scan to replay for further row pages. Absent on a whole-table span, on verified regions, and on legacy payloads.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.scan_index.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Scan Index","description":"Which scan of the query read these rows, when the region records one scan rather than the whole table. A query can read one file more than once — a narrow CTE and a broad one, say — and each such scan grounds separately, so this identifies the scan to replay for further row pages. Absent on a whole-table span, on verified regions, and on legacy payloads.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.scan_index.oneOf.1","typeLabel":"null"}],"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.scan_index","typeLabel":"integer | null"},"scan_label":{"oneOf":[{"type":"string","title":"Scan Label","description":"The scan named the way the query spells it: 'main query', 'CTE \u003cname>', or 'subquery \u003cn>'. Present exactly when scan_index is.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.scan_label.oneOf.0","typeLabel":"string"},{"type":"null","title":"Scan Label","description":"The scan named the way the query spells it: 'main query', 'CTE \u003cname>', or 'subquery \u003cn>'. Present exactly when scan_index is.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.scan_label.oneOf.1","typeLabel":"null"}],"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1.scan_label","typeLabel":"string | null"}},"additionalProperties":false,"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX].oneOf.1","typeLabel":"RowRangeQueryRegion · object"}],"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions.items.[INDEX]","typeLabel":"SheetQueryRegion · object | RowRangeQueryRegion · object"},"title":"Regions","type":"array","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.regions","typeLabel":"(SheetQueryRegion · object | RowRangeQueryRegion · object)[]"},"result_id":{"oneOf":[{"type":"string","title":"Result Id","description":"Stable identity of the stored query result behind this receipt. Lets the grounding-rows endpoint replay this exact query for matched-row pages beyond the regions' inline runs.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.result_id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Result Id","description":"Stable identity of the stored query result behind this receipt. Lets the grounding-rows endpoint replay this exact query for matched-row pages beyond the regions' inline runs.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.result_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.result_id","typeLabel":"string | null"},"row_count":{"default":0,"description":"Rows in the query's full result, not in the preview below.","title":"Row Count","type":"integer","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.row_count","typeLabel":"integer"},"rows":{"description":"Leading result rows, values rendered as text — a bounded preview, never the full result.","items":{"additionalProperties":{"type":"string","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.rows.items.[INDEX].additionalProperties","typeLabel":"string"},"type":"object","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.rows.items.[INDEX]","typeLabel":"object"},"title":"Rows","type":"array","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.rows","typeLabel":"Rows · object[]"},"source_paths":{"description":"The uploaded table files this query read — directly, or through a prior result it built on — e.g. 'planning/FS GF Custom.xlsx'.","items":{"type":"string","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.source_paths.items.[INDEX]","typeLabel":"string"},"title":"Source Paths","type":"array","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.source_paths","typeLabel":"string[]"},"supports_answer":{"default":true,"description":"False for exploratory SQL the tables engine ran but did not mark as part of the answer's calculation trail.","title":"Supports Answer","type":"boolean","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.supports_answer","typeLabel":"boolean"},"verified":{"default":false,"description":"True when at least one claim behind this query passed mechanical verification against the source data. Independent of 'regions': a source without an addressable grid verifies but cannot be pointed at, so an empty 'regions' never means unverified.","title":"Verified","type":"boolean","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0.verified","typeLabel":"boolean"}},"additionalProperties":false,"uniqueKey":"result_citation.oneOf.0.grounding.oneOf.0","typeLabel":"TableQueryGrounding · object"},{"type":"null","description":"Exact source regions and bounded receipt data when capture-time provenance was available.","uniqueKey":"result_citation.oneOf.0.grounding.oneOf.1","typeLabel":"null"}],"uniqueKey":"result_citation.oneOf.0.grounding","typeLabel":"TableQueryGrounding · object | null"}},"additionalProperties":false,"uniqueKey":"result_citation.oneOf.0","typeLabel":"QueryTableCitation · object"},{"type":"null","uniqueKey":"result_citation.oneOf.1","typeLabel":"null"}],"uniqueKey":"result_citation","typeLabel":"QueryTableCitation · object | null"},"result_materialization_error":{"oneOf":[{"type":"string","title":"Result Materialization Error","uniqueKey":"result_materialization_error.oneOf.0","typeLabel":"string"},{"type":"null","title":"Result Materialization Error","uniqueKey":"result_materialization_error.oneOf.1","typeLabel":"null"}],"uniqueKey":"result_materialization_error","typeLabel":"string | null"},"source_paths":{"description":"The uploaded files the statement read — carried on the response itself so source attribution survives when no result file is materialized (job-attributed agent statements).","items":{"type":"string","uniqueKey":"source_paths.items.[INDEX]","typeLabel":"string"},"title":"Source Paths","type":"array","uniqueKey":"source_paths","typeLabel":"string[]"}},"required":["sql","result"],"title":"RunSqlResponse","type":"object","uniqueKey":"","typeLabel":"RunSqlResponse · object"},"examples":{"Example":{"title":"Example","value":{"result":{"handle":"\u003cstring>","row_count":123,"columns":[],"path":"\u003cstring>","preview_truncated":false,"rows":[]},"sql":"\u003cstring>","duplicate":false,"job_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","result_citation":{"result_file":{"download_url":"\u003cstring>","download_url_expires_at":"2023-11-07T05:31:56Z","file_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","file_name":"\u003cstring>","format":"parquet","handle":"\u003cstring>","path":"\u003cstring>","preview_url":"\u003cstring>","row_count":123},"source_paths":["\u003cstring>"],"sql":"\u003cstring>","grounding":{"sql":"\u003cstring>","columns":[{"data_type":"\u003cstring>","name":"\u003cstring>"}],"grounding_reason":"\u003cstring>","grounding_status":"exact","preview_truncated":false,"regions":[{"a1_range":"\u003cstring>","source_path":"\u003cstring>","basis":"verified","bounding":false,"kind":"sheet","matched_rows":0,"scan_index":123,"scan_label":"\u003cstring>","sheet_name":"\u003cstring>"}],"result_id":"\u003cstring>","row_count":0,"rows":[{}],"source_paths":["\u003cstring>"],"supports_answer":true,"verified":false}},"result_materialization_error":"\u003cstring>","source_paths":["\u003cstring>"]}}},"exampleType":"generated"}},"description":"Successful Response","exampleType":"generated"},"4b839a8f-d741-4020-8773-7a72ed6a0dc3":{"content":{"application/json":{"schema":{"description":"Every non-2xx body on ``/v1``.","example":{"error":{"code":"invalid_request","detail":null,"message":"Request body has extra fields that this operation does not accept.","request_id":"req-01j9k2n3p4q5r6s7t8v9","retryable":false}},"properties":{"error":{"description":"The error object, per spec 12 §1.8.","properties":{"code":{"description":"Every error the ``/v1`` surface can return.\n\nClients must treat this as an **open** enum: a new member is an additive\nchange (spec 12 §9), and a client that crashes on an unknown code makes\nevery future error a breaking change.","enum":["storage_connection_not_found","storage_connection_in_use","storage_limit_exceeded","storage_conflict","storage_auth_required","storage_unavailable","scan_required","scan_rejected","scan_unavailable","invalid_request","unsupported_file_type","file_too_large","invalid_schema","invalid_sql","invalid_path_prefix","command_not_permitted","batch_too_large","domain_validation_failed","default_label_required","wait_required_for_zero_retention","ledger_decision_invalid","tenant_required","partner_required","workspace_not_found","file_not_found","job_not_found","upload_not_found","node_not_found","schema_not_found","domain_not_found","session_not_found","access_label_not_found","ledger_understanding_not_found","ledger_table_not_found","tenant_not_found","path_conflict","schema_version_conflict","access_label_name_taken","workspace_name_taken","access_label_in_use","upload_expired","file_not_ingested","workspace_deleting","workspace_not_deletable","ingestion_in_progress","job_not_cancellable","confirmation_required","domain_not_published","domain_in_use","reserved_domain_slug","kg_not_built","kg_build_in_progress","ledger_understanding_in_progress","ledger_understanding_version_outdated","session_busy","tenant_limit_reached","range_not_satisfiable","result_expired","access_denied","tenant_disabled","access_backstop_violation","access_mode_not_implemented","rate_limited","concurrency_limit_reached","quota_exceeded","corrupt_file","zero_byte_file","encrypted_file","csv_dialect_ambiguous","csv_parse_failed","parse_failed","ocr_failed","conversion_failed","sheetless_workbook","unplayable_media","unclassified_pages","job_cancelled","job_timeout","upstream_unavailable","internal_error","unauthorized","not_implemented"],"title":"ErrorCode","type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"description":"Human- and model-readable; says what to do differently.","title":"Message","type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"retryable":{"description":"Whether retrying the identical request could succeed.","title":"Retryable","type":"boolean","isRequired":true,"uniqueKey":"error.retryable","typeLabel":"boolean"},"detail":{"oneOf":[{"type":"object","title":"Detail","description":"Structured payload, when the code carries one.","additionalProperties":true,"uniqueKey":"error.detail.oneOf.0","typeLabel":"Detail · object"},{"type":"null","title":"Detail","description":"Structured payload, when the code carries one.","uniqueKey":"error.detail.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.detail","typeLabel":"Detail · object | null"},"request_id":{"oneOf":[{"type":"string","title":"Request Id","description":"Per-request correlation id; matches the ``X-Request-Id`` header. Null only when the error was minted outside any HTTP request, e.g. by a worker.","uniqueKey":"error.request_id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Request Id","description":"Per-request correlation id; matches the ``X-Request-Id`` header. Null only when the error was minted outside any HTTP request, e.g. by a worker.","uniqueKey":"error.request_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.request_id","typeLabel":"string | null"}},"required":["code","message","retryable"],"title":"Error","type":"object","isRequired":true,"uniqueKey":"error","typeLabel":"Error · object"}},"required":["error"],"title":"ErrorEnvelope","type":"object","uniqueKey":"","typeLabel":"ErrorEnvelope · object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"invalid_request","detail":null,"message":"Request body has extra fields that this operation does not accept.","request_id":"req-01j9k2n3p4q5r6s7t8v9","retryable":false}}}},"exampleType":"generated"}},"description":"Gateway Timeout","exampleType":"generated"},"65024238-bc58-419c-a428-053445c68705":{"content":{"application/json":{"example":{"error":{"code":"invalid_request","detail":null,"message":"Request body has extra fields that this operation does not accept.","request_id":"req-01j9k2n3p4q5r6s7t8v9","retryable":false}},"schema":{"description":"Every non-2xx body on ``/v1``.","example":{"error":{"code":"invalid_request","detail":null,"message":"Request body has extra fields that this operation does not accept.","request_id":"req-01j9k2n3p4q5r6s7t8v9","retryable":false}},"properties":{"error":{"description":"The error object, per spec 12 §1.8.","properties":{"code":{"description":"Every error the ``/v1`` surface can return.\n\nClients must treat this as an **open** enum: a new member is an additive\nchange (spec 12 §9), and a client that crashes on an unknown code makes\nevery future error a breaking change.","enum":["storage_connection_not_found","storage_connection_in_use","storage_limit_exceeded","storage_conflict","storage_auth_required","storage_unavailable","scan_required","scan_rejected","scan_unavailable","invalid_request","unsupported_file_type","file_too_large","invalid_schema","invalid_sql","invalid_path_prefix","command_not_permitted","batch_too_large","domain_validation_failed","default_label_required","wait_required_for_zero_retention","ledger_decision_invalid","tenant_required","partner_required","workspace_not_found","file_not_found","job_not_found","upload_not_found","node_not_found","schema_not_found","domain_not_found","session_not_found","access_label_not_found","ledger_understanding_not_found","ledger_table_not_found","tenant_not_found","path_conflict","schema_version_conflict","access_label_name_taken","workspace_name_taken","access_label_in_use","upload_expired","file_not_ingested","workspace_deleting","workspace_not_deletable","ingestion_in_progress","job_not_cancellable","confirmation_required","domain_not_published","domain_in_use","reserved_domain_slug","kg_not_built","kg_build_in_progress","ledger_understanding_in_progress","ledger_understanding_version_outdated","session_busy","tenant_limit_reached","range_not_satisfiable","result_expired","access_denied","tenant_disabled","access_backstop_violation","access_mode_not_implemented","rate_limited","concurrency_limit_reached","quota_exceeded","corrupt_file","zero_byte_file","encrypted_file","csv_dialect_ambiguous","csv_parse_failed","parse_failed","ocr_failed","conversion_failed","sheetless_workbook","unplayable_media","unclassified_pages","job_cancelled","job_timeout","upstream_unavailable","internal_error","unauthorized","not_implemented"],"title":"ErrorCode","type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"description":"Human- and model-readable; says what to do differently.","title":"Message","type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"retryable":{"description":"Whether retrying the identical request could succeed.","title":"Retryable","type":"boolean","isRequired":true,"uniqueKey":"error.retryable","typeLabel":"boolean"},"detail":{"oneOf":[{"type":"object","title":"Detail","description":"Structured payload, when the code carries one.","additionalProperties":true,"uniqueKey":"error.detail.oneOf.0","typeLabel":"Detail · object"},{"type":"null","title":"Detail","description":"Structured payload, when the code carries one.","uniqueKey":"error.detail.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.detail","typeLabel":"Detail · object | null"},"request_id":{"oneOf":[{"type":"string","title":"Request Id","description":"Per-request correlation id; matches the ``X-Request-Id`` header. Null only when the error was minted outside any HTTP request, e.g. by a worker.","uniqueKey":"error.request_id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Request Id","description":"Per-request correlation id; matches the ``X-Request-Id`` header. Null only when the error was minted outside any HTTP request, e.g. by a worker.","uniqueKey":"error.request_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.request_id","typeLabel":"string | null"}},"required":["code","message","retryable"],"title":"Error","type":"object","isRequired":true,"uniqueKey":"error","typeLabel":"Error · object"}},"required":["error"],"title":"ErrorEnvelope","type":"object","uniqueKey":"","typeLabel":"ErrorEnvelope · object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"invalid_request","detail":null,"message":"Request body has extra fields that this operation does not accept.","request_id":"req-01j9k2n3p4q5r6s7t8v9","retryable":false}}}},"exampleType":"examples"}},"description":"Typed error envelope used by every 4xx and 5xx. ``error.code`` distinguishes the failure; HTTP status is a consequence of the code.","exampleType":"examples"}},"security":{"40c82bc1-2392-4925-8090-531537389e70":{"APIKeyHeader":{"in":"header","name":"X-API-Key","type":"apiKey","scopes":[],"schemeName":"APIKeyHeader"}}},"servers":{"eacc9f52-2b49-4ba8-ab98-c9e34e13dac3":{"url":"https://ndi-api.nace.ai"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"in":"header","name":"X-API-Key","type":"apiKey","scopes":[],"schemeName":"APIKeyHeader"},"schema":{"title":"X-API-Key","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"APIKeyHeader","name":"X-API-Key"}],"title":"APIKeyHeader"}]},"originalFileLocation":"openapi.json"},"subdomain":"nace-ai","siteName":"NDI Platform API","title":"run_sql - NDI Platform API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-29T18:06:04.161Z","originalFileLocation":"api-reference/tools/run_sql.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;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=\"system\"}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=\"Run one caller-authored read-only SELECT over the workspace\u0026#x27;s tables. Cost class: fast. No planner and no answering agent — the statement runs directly in the guarded SQL engine, against every queryable tab in the workspace registered as a view under the table_name that file-metadata and the folder-metadata table census publish. Joins across files are ordinary SQL joins; earlier run-sql results are registered too, so a returned res_… handle can be joined, aggregated, or paged with LIMIT/OFFSET in the next statement. The full result is retained as parquet whatever the preview shows — result_citation.result_file.download_url fetches it whole. A statement that is not a read, or reads an unregistered table, is refused with invalid_request naming the rule broken and the registered tables. For a natural-language question — or when the answer should be composed and cited for you — use query-tables instead.\">\u003cmeta data-mint-head name=\"application-name\" content=\"NDI Platform 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/nace-ai/ON_ODtu5ozmA-6iq/_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/nace-ai/ON_ODtu5ozmA-6iq/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/nace-ai/ON_ODtu5ozmA-6iq/_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/nace-ai/ON_ODtu5ozmA-6iq/_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/nace-ai/ON_ODtu5ozmA-6iq/_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/nace-ai/ON_ODtu5ozmA-6iq/_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/nace-ai/ON_ODtu5ozmA-6iq/_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/nace-ai/ON_ODtu5ozmA-6iq/_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/nace-ai/ON_ODtu5ozmA-6iq/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"run_sql - NDI Platform API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Run one caller-authored read-only SELECT over the workspace\u0026#x27;s tables. Cost class: fast. No planner and no answering agent — the statement runs directly in the guarded SQL engine, against every queryable tab in the workspace registered as a view under the table_name that file-metadata and the folder-metadata table census publish. Joins across files are ordinary SQL joins; earlier run-sql results are registered too, so a returned res_… handle can be joined, aggregated, or paged with LIMIT/OFFSET in the next statement. The full result is retained as parquet whatever the preview shows — result_citation.result_file.download_url fetches it whole. A statement that is not a read, or reads an unregistered table, is refused with invalid_request naming the rule broken and the registered tables. For a natural-language question — or when the answer should be composed and cited for you — use query-tables instead.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"NDI Platform API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.ndi.nace.ai/api-reference/tools/run_sql\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://nace-ai.mintlify.app/_mintlify/api/og/v2?division=Tools+and+search\u0026amp;title=run_sql\u0026amp;description=Run+one+caller-authored+read-only+SELECT+over+the+workspace%27s+tables.%0A%0A**Cost+class%3A+fast.**+No+planner+and+no+answering+agent+%E2%80%94+the+statement%0Aruns+directly+in+\u0026amp;theme=c2c8dd1a1eb024c2dfeaad33\u0026amp;signature=a827f5f27a45a1774f4f7ef85ed886639d54a2d203a57b1960b3eb07731d1433\">\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=\"run_sql - NDI Platform API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Run one caller-authored read-only SELECT over the workspace\u0026#x27;s tables. Cost class: fast. No planner and no answering agent — the statement runs directly in the guarded SQL engine, against every queryable tab in the workspace registered as a view under the table_name that file-metadata and the folder-metadata table census publish. Joins across files are ordinary SQL joins; earlier run-sql results are registered too, so a returned res_… handle can be joined, aggregated, or paged with LIMIT/OFFSET in the next statement. The full result is retained as parquet whatever the preview shows — result_citation.result_file.download_url fetches it whole. A statement that is not a read, or reads an unregistered table, is refused with invalid_request naming the rule broken and the registered tables. For a natural-language question — or when the answer should be composed and cited for you — use query-tables instead.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://nace-ai.mintlify.app/_mintlify/api/og/v2?division=Tools+and+search\u0026amp;title=run_sql\u0026amp;description=Run+one+caller-authored+read-only+SELECT+over+the+workspace%27s+tables.%0A%0A**Cost+class%3A+fast.**+No+planner+and+no+answering+agent+%E2%80%94+the+statement%0Aruns+directly+in+\u0026amp;theme=c2c8dd1a1eb024c2dfeaad33\u0026amp;signature=a827f5f27a45a1774f4f7ef85ed886639d54a2d203a57b1960b3eb07731d1433\">\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/nace-ai/ON_ODtu5ozmA-6iq/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"NDI Platform API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#111111\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.ndi.nace.ai/api-reference/tools/run_sql\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/tools/run_sql.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.ndi.nace.ai/#organization\",\"name\":\"NDI Platform API\",\"url\":\"https://docs.ndi.nace.ai\"},{\"@type\":\"WebSite\",\"@id\":\"https://docs.ndi.nace.ai#website\",\"name\":\"NDI Platform API\",\"url\":\"https://docs.ndi.nace.ai\",\"publisher\":{\"@id\":\"https://docs.ndi.nace.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.ndi.nace.ai/api-reference/tools/run_sql#webpage\",\"url\":\"https://docs.ndi.nace.ai/api-reference/tools/run_sql\",\"name\":\"run_sql\",\"description\":\"Run one caller-authored read-only SELECT over the workspace's tables. Cost class: fast. No planner and no answering agent — the statement runs directly in the guarded SQL engine, against every queryable tab in the workspace registered as a view under the table_name that file-metadata and the folder-metadata table census publish. Joins across files are ordinary SQL joins; earlier run-sql results are registered too, so a returned res_… handle can be joined, aggregated, or paged with LIMIT/OFFSET in the next statement. The full result is retained as parquet whatever the preview shows — result_citation.result_file.download_url fetches it whole. A statement that is not a read, or reads an unregistered table, is refused with invalid_request naming the rule broken and the registered tables. For a natural-language question — or when the answer should be composed and cited for you — use query-tables instead.\",\"dateModified\":\"2026-10-29T18:06:04.161Z\",\"isPartOf\":{\"@id\":\"https://docs.ndi.nace.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.ndi.nace.ai/api-reference/tools/run_sql#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.ndi.nace.ai/api-reference/tools/run_sql#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Tools and search\",\"item\":\"https://docs.ndi.nace.ai/api-reference/file-tools\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"run_sql\",\"item\":\"https://docs.ndi.nace.ai/api-reference/tools/run_sql\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.ndi.nace.ai/api-reference/tools/run_sql#apireference\",\"headline\":\"run_sql\",\"name\":\"run_sql\",\"description\":\"Run one caller-authored read-only SELECT over the workspace's tables. Cost class: fast. No planner and no answering agent — the statement runs directly in the guarded SQL engine, against every queryable tab in the workspace registered as a view under the table_name that file-metadata and the folder-metadata table census publish. Joins across files are ordinary SQL joins; earlier run-sql results are registered too, so a returned res_… handle can be joined, aggregated, or paged with LIMIT/OFFSET in the next statement. The full result is retained as parquet whatever the preview shows — result_citation.result_file.download_url fetches it whole. A statement that is not a read, or reads an unregistered table, is refused with invalid_request naming the rule broken and the registered tables. For a natural-language question — or when the answer should be composed and cited for you — use query-tables instead.\",\"url\":\"https://docs.ndi.nace.ai/api-reference/tools/run_sql\",\"mainEntityOfPage\":{\"@id\":\"https://docs.ndi.nace.ai/api-reference/tools/run_sql#webpage\"},\"dateModified\":\"2026-10-29T18:06:04.161Z\",\"publisher\":{\"@id\":\"https://docs.ndi.nace.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.ndi.nace.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"NDI Platform API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"NDI Platform API","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"Conventions","pages":[{"title":"API conventions","href":"/api-reference/overview"}]},{"group":"Granular operations","pages":[{"title":"Uploads","href":"/api-reference/uploads"},{"title":"Document operations","href":"/api-reference/document-operations"},{"title":"create_upload","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/uploads","href":"/api-reference/document-operations/create_upload"},{"title":"parse","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/parse","href":"/api-reference/document-operations/parse"},{"title":"split","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/split","href":"/api-reference/document-operations/split"},{"title":"classify","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/classify","href":"/api-reference/document-operations/classify"},{"title":"extract","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/extract","href":"/api-reference/document-operations/extract"},{"title":"validate_extract_schema","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/extract/schema-validation","href":"/api-reference/document-operations/validate_extract_schema"},{"title":"ground","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/ground","href":"/api-reference/document-operations/ground"}]},{"group":"Decisions","pages":[{"title":"Drex (Decision Model)","href":"/api-reference/systemone"},{"title":"evaluate_systemone","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/systemone","href":"/api-reference/systemone/evaluate_systemone"}]},{"group":"Catalog","pages":[{"title":"Domains","href":"/api-reference/domains"},{"title":"Access labels","href":"/api-reference/access-labels"},{"title":"Extraction schemas","href":"/api-reference/extraction-schemas"},{"title":"list_domains","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/domains","href":"/api-reference/domains/list_domains"},{"title":"generate_domain","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/domains/generate","href":"/api-reference/domains/generate_domain"},{"title":"suggest_domain_description","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/domains/suggest-description","href":"/api-reference/domains/suggest_domain_description"},{"title":"create_domain","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/domains","href":"/api-reference/domains/create_domain"},{"title":"get_domain","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/domains/{domain_id}","href":"/api-reference/domains/get_domain"},{"title":"update_domain","deprecated":null,"version":null,"openapi":"/openapi.json patch /v1/domains/{domain_id}","href":"/api-reference/domains/update_domain"},{"title":"publish_domain","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/domains/{domain_id}/publish","href":"/api-reference/domains/publish_domain"},{"title":"list_access_labels","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/access-labels","href":"/api-reference/access-labels/list_access_labels"},{"title":"create_access_label","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/access-labels","href":"/api-reference/access-labels/create_access_label"},{"title":"get_access_label","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/access-labels/{access_label_id}","href":"/api-reference/access-labels/get_access_label"},{"title":"update_access_label","deprecated":null,"version":null,"openapi":"/openapi.json patch /v1/access-labels/{access_label_id}","href":"/api-reference/access-labels/update_access_label"},{"title":"delete_access_label","deprecated":null,"version":null,"openapi":"/openapi.json delete /v1/access-labels/{access_label_id}","href":"/api-reference/access-labels/delete_access_label"},{"title":"list_extraction_schemas","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/extraction-schemas","href":"/api-reference/extraction-schemas/list_extraction_schemas"},{"title":"create_extraction_schema","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/extraction-schemas","href":"/api-reference/extraction-schemas/create_extraction_schema"},{"title":"get_extraction_schema","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/extraction-schemas/{schema_id}","href":"/api-reference/extraction-schemas/get_extraction_schema"},{"title":"delete_extraction_schema","deprecated":null,"version":null,"openapi":"/openapi.json delete /v1/extraction-schemas/{schema_id}","href":"/api-reference/extraction-schemas/delete_extraction_schema"},{"title":"list_extraction_schema_versions","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/extraction-schemas/{schema_id}/versions","href":"/api-reference/extraction-schemas/list_extraction_schema_versions"},{"title":"create_extraction_schema_version","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/extraction-schemas/{schema_id}/versions","href":"/api-reference/extraction-schemas/create_extraction_schema_version"},{"title":"get_extraction_schema_version","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/extraction-schemas/{schema_id}/versions/{version}","href":"/api-reference/extraction-schemas/get_extraction_schema_version"}]},{"group":"Workspaces and files","pages":[{"title":"Workspaces","href":"/api-reference/workspaces"},{"title":"Files","href":"/api-reference/files"},{"title":"create_workspace","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces","href":"/api-reference/workspaces/create_workspace"},{"title":"list_workspaces","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/workspaces","href":"/api-reference/workspaces/list_workspaces"},{"title":"get_workspace","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/workspaces/{workspace_id}","href":"/api-reference/workspaces/get_workspace"},{"title":"update_workspace","deprecated":null,"version":null,"openapi":"/openapi.json patch /v1/workspaces/{workspace_id}","href":"/api-reference/workspaces/update_workspace"},{"title":"get_workspace_stats","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/workspaces/{workspace_id}/stats","href":"/api-reference/workspaces/get_workspace_stats"},{"title":"delete_workspace","deprecated":null,"version":null,"openapi":"/openapi.json delete /v1/workspaces/{workspace_id}","href":"/api-reference/workspaces/delete_workspace"},{"title":"create_upload_grant","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/upload-grants","href":"/api-reference/files/create_upload_grant"},{"title":"upload_file","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/files","href":"/api-reference/files/upload_file"},{"title":"list_files","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/workspaces/{workspace_id}/files","href":"/api-reference/files/list_files"},{"title":"get_file","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/workspaces/{workspace_id}/files/{file_id}","href":"/api-reference/files/get_file"},{"title":"get_file_metadata","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/workspaces/{workspace_id}/files/{file_id}/metadata","href":"/api-reference/files/get_file_metadata"},{"title":"get_file_output","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/workspaces/{workspace_id}/files/{file_id}/outputs/{output_id}","href":"/api-reference/files/get_file_output"},{"title":"list_output_members","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/workspaces/{workspace_id}/files/{file_id}/outputs/{output_id}/members","href":"/api-reference/files/list_output_members"},{"title":"get_file_versions","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/workspaces/{workspace_id}/files/{file_id}/versions","href":"/api-reference/files/get_file_versions"},{"title":"replace_file","deprecated":null,"version":null,"openapi":"/openapi.json put /v1/workspaces/{workspace_id}/files/{file_id}","href":"/api-reference/files/replace_file"},{"title":"delete_file","deprecated":null,"version":null,"openapi":"/openapi.json delete /v1/workspaces/{workspace_id}/files/{file_id}","href":"/api-reference/files/delete_file"},{"title":"create_upload_session","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/upload-sessions","href":"/api-reference/files/create_upload_session"},{"title":"upload_session_part","deprecated":null,"version":null,"openapi":"/openapi.json put /v1/workspaces/{workspace_id}/upload-sessions/{session_id}/parts/{part_number}","href":"/api-reference/files/upload_session_part"},{"title":"get_upload_session","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/workspaces/{workspace_id}/upload-sessions/{session_id}","href":"/api-reference/files/get_upload_session"},{"title":"complete_upload_session","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/upload-sessions/{session_id}/complete","href":"/api-reference/files/complete_upload_session"},{"title":"abort_upload_session","deprecated":null,"version":null,"openapi":"/openapi.json delete /v1/workspaces/{workspace_id}/upload-sessions/{session_id}","href":"/api-reference/files/abort_upload_session"},{"title":"get_artifact_content","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/workspaces/{workspace_id}/artifacts/content","href":"/api-reference/artifacts/get_artifact_content"},{"title":"get_artifact_rows","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/workspaces/{workspace_id}/artifacts/rows","href":"/api-reference/artifacts/get_artifact_rows"}]},{"group":"Ingestion and graph","pages":[{"title":"Ingestion","href":"/api-reference/ingestion"},{"title":"Knowledge graph build","href":"/api-reference/knowledge-graph"},{"title":"ingest","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/ingestions","href":"/api-reference/ingestion/ingest"},{"title":"reconcile","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/reconciliations","href":"/api-reference/ingestion/reconcile"},{"title":"build_knowledge_graph","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/knowledge-graph/builds","href":"/api-reference/knowledge-graph/build_knowledge_graph"}]},{"group":"Tools and search","pages":[{"title":"File tools","href":"/api-reference/file-tools"},{"title":"Fact and deep search (deprecated)","href":"/api-reference/intelligent-search"},{"title":"Filtered search (deprecated)","href":"/api-reference/filtered-search"},{"title":"Journal-entry testing","href":"/api-reference/je-testing"},{"title":"Ledger understanding","href":"/api-reference/ledger-understanding"},{"title":"Automatic search","href":"/api-reference/automatic-search"},{"title":"QA","href":"/api-reference/qa"},{"title":"folder_metadata","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/tools/folder-metadata","href":"/api-reference/tools/folder_metadata"},{"title":"file_metadata","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/tools/file-metadata","href":"/api-reference/tools/file_metadata"},{"title":"locate","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/tools/locate","href":"/api-reference/tools/locate"},{"title":"read_file","description":"Read the text of one uploaded file.\n\n**Cost class: fast.**\n\n``path`` names an **uploaded source file** — the only namespace this tool\nserves. A workspace-internal path is refused with ``invalid_request``\nnaming the uploaded file to use instead.\n\nA file with several components (a spreadsheet's tabs, a pdf's sections)\nanswers with their text concatenated in the file's own order, each part\nunder a one-line header naming the component; ``components_returned`` and\n``components_omitted`` report exactly what made it into the budget. Scope\nthe read with ``component=\u003cname>`` (the names ``file_metadata`` lists)\nwhen only one tab or section matters, and with ``pages`` (1-based) for\npaged documents — spreadsheets have no pages, so scope those by component\ninstead. Images are refused — ask about them with ``qa_file``.","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/tools/read-file","href":"/api-reference/tools/read_file"},{"title":"run_sql","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/tools/run-sql","href":"/api-reference/tools/run_sql"},{"title":"qa_file","description":"Answer a natural-language question about one uploaded file — document, media, image, or table.\n\n**Cost class: slow.**\n\n``path`` names an **uploaded source file** — the same full path\n``file_metadata`` takes, exactly as ``folder_metadata`` lists it; a bare\nfile name is not found, and a workspace-internal path is refused with\n``invalid_request``.\n\nThe engine is picked from what the file (or the selected component) *is*:\nan image goes to vision QA, and text — of any length — to a recursive LLM\nbuilt for long documents. A file with several parts (a pdf split into\nsections, a workbook with several tabs, a recording with attachments) or\nwith rows (a spreadsheet tab, a csv/parquet/jsonl upload, a pdf's long\ntable) is worked by a QA agent that searches within the file, reads the\nrelevant parts, and writes its own SQL over the file's tables. The\nresponse's ``engine`` field reports which one ran.\n\nScope the question with ``component=\u003cname>`` (the names ``file_metadata``\nlists) to ask about one section directly. Use this when you need a\ndirect, cited answer about a file's contents rather than search hits.\n\nExecution survives HTTP disconnects. By default the route waits and returns\nthe original answer shape. Send ``Prefer: respond-async`` to return a Job\nimmediately, then poll its ``Location`` URL. ``Idempotency-Key`` recovers the\nsame job after a lost response. Only explicit job cancellation stops it.","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/tools/qa-file","href":"/api-reference/tools/qa_file"},{"title":"query_tables","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/tools/query-tables","href":"/api-reference/tools/query_tables"},{"title":"deep_search","deprecated":true,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/deep-search","href":"/api-reference/intelligent-search/deep_search"},{"title":"fact_search","deprecated":true,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/fact-search","href":"/api-reference/intelligent-search/fact_search"},{"title":"filtered_search","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/filtered-search","href":"/api-reference/filtered-search/filtered_search"},{"title":"je_testing","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/je-testing","href":"/api-reference/je-testing/je_testing"},{"title":"automatic_search","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/automatic-search","href":"/api-reference/intelligent-search/automatic_search"},{"title":"qa","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/workspaces/{workspace_id}/qa","href":"/api-reference/intelligent-search/qa"}]},{"group":"Jobs and usage","pages":[{"title":"Jobs","href":"/api-reference/jobs"},{"title":"Usage","href":"/api-reference/usage"},{"title":"list_jobs","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/jobs","href":"/api-reference/operations/list_jobs"},{"title":"get_job","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/jobs/{job_id}","href":"/api-reference/operations/get_job"},{"title":"update_job","deprecated":null,"version":null,"openapi":"/openapi.json patch /v1/jobs/{job_id}","href":"/api-reference/operations/update_job"},{"title":"delete_job","deprecated":null,"version":null,"openapi":"/openapi.json delete /v1/jobs/{job_id}","href":"/api-reference/operations/delete_job"},{"title":"get_job_request","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/jobs/{job_id}/request","href":"/api-reference/operations/get_job_request"},{"title":"cancel_job","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/jobs/{job_id}/cancel","href":"/api-reference/operations/cancel_job"},{"title":"stream_job_events","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/jobs/{job_id}/events","href":"/api-reference/operations/stream_job_events"},{"title":"get_ground_crop_content","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/jobs/{job_id}/ground-crops/{artifact_ref}","href":"/api-reference/operations/get_ground_crop_content"},{"title":"get_ground_transcript_content","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/jobs/{job_id}/ground-transcript/{artifact_ref}","href":"/api-reference/operations/get_ground_transcript_content"},{"title":"get_parse_transcript_content","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/jobs/{job_id}/parse-transcript/{artifact_ref}","href":"/api-reference/operations/get_parse_transcript_content"},{"title":"get_converted_pdf_content","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/jobs/{job_id}/converted-pdf/{artifact_ref}","href":"/api-reference/operations/get_converted_pdf_content"},{"title":"get_spreadsheet_cell_map_content","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/jobs/{job_id}/spreadsheet-cell-maps/{artifact_ref}","href":"/api-reference/operations/get_spreadsheet_cell_map_content"},{"title":"get_usage","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/usage","href":"/api-reference/operations/get_usage"},{"title":"get_usage_overview","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/usage/overview","href":"/api-reference/operations/get_usage_overview"}]},{"group":"Partners","pages":[{"title":"Tenants","href":"/api-reference/tenants"},{"title":"list_tenants","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/tenants","href":"/api-reference/tenants/list_tenants"},{"title":"put_tenant","deprecated":null,"version":null,"openapi":"/openapi.json put /v1/tenants/{external_ref}","href":"/api-reference/tenants/put_tenant"},{"title":"get_tenant","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/tenants/{external_ref}","href":"/api-reference/tenants/get_tenant"},{"title":"delete_tenant","deprecated":null,"version":null,"openapi":"/openapi.json delete /v1/tenants/{external_ref}","href":"/api-reference/tenants/delete_tenant"}]}]},{"tab":"SDKs","versions":[{"version":"Python","groups":[{"group":"Get started","pages":[{"title":"Python SDK","href":"/sdks/python"}]},{"group":"Core methods","pages":[{"title":"Upload","href":"/sdks/python/upload"},{"title":"Parse","href":"/sdks/python/parse"},{"title":"Extract","href":"/sdks/python/extract"},{"title":"Split","href":"/sdks/python/split"},{"title":"Classify","href":"/sdks/python/classify"},{"title":"Ground","href":"/sdks/python/ground"},{"title":"Workspaces","href":"/sdks/python/workspaces"},{"title":"Storage connections","href":"/sdks/python/storage-connections"},{"title":"Deep search (deprecated)","href":"/sdks/python/search"},{"title":"Journal-entry testing","href":"/sdks/python/je-testing"},{"title":"Ledger understanding","href":"/sdks/python/ledger-understanding"},{"title":"Automatic search","href":"/sdks/python/automatic-search"},{"title":"QA","href":"/sdks/python/qa"},{"title":"Drex (Decision Model)","href":"/sdks/python/systemone"}]},{"group":"Async and utilities","pages":[{"title":"Async client","href":"/sdks/python/async"},{"title":"Job management","href":"/sdks/python/job-management"},{"title":"Error handling","href":"/sdks/python/error-handling"}]}]},{"version":"TypeScript","pages":[{"title":"TypeScript","href":"/sdks/typescript"}]}]}]},"title":"run_sql - NDI Platform API","buildId":"dpl_EnxDqhjaNc9a8MVa833TGULPd9uJ","deploymentId":"dpl_EnxDqhjaNc9a8MVa833TGULPd9uJ","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-26-lDe7V.js","utils-CWQmgYtH.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-4-Aw3rSD.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-C2zjXYA5.js","snippetPresets-DFmpFA7C.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-FJpQavWq.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-D_GvPF7k.js","shallow-Bs2ZB0NO.js","getApiPlaygroundDisplay-DCcqJJk-.js","CodeSnippet-DzDxawVe.js","CodeSnippets-aUr7fU-7.js","Page-CT9uE8Ip.js","getPastedJson-Y1fKsj_I.js","icon-DI4zTsDr.js","MethodPill-C0nDlmSQ.js","DuplicateIcon-NUXbx2nQ.js","createIcon-BdTHrPAi.js","DynamicMarkdown-CtpgKJwj.js","SectionHeading-B3x35tOt.js","axios-vUo_bRtp.js","Markdown-3OmurJMP.js","clsx-DMKzROTp.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-1ms6tsT-.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-Ke9xIMFx.js"]}