> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ndi.nace.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Workspaces

> Create a corpus, upload files, ingest, and search

Uploading registers a ledger row. Ingestion is a separate, billable call.

```ts theme={"dark"}
import { NdiClient } from "ndi-sdk";

const client = new NdiClient();
const workspace = await client.workspaces.create({ name: "fy25-audit" });
await client.jobs.wait(
  (await client.files.upload(workspace.workspace_id, "report.pdf", { path: "reports/report.pdf" })).job_id,
);
await client.jobs.wait(
  (await client.ingestion.ingest(workspace.workspace_id, { path_prefix: "reports/" })).job_id,
  { timeout: 600 },
);
const hits = await client.tools.hybridSearch(workspace.workspace_id, {
  query: "total liabilities at year end",
  k: 5,
});
for (const hit of hits.hits) {
  console.log(hit.path, hit.snippet);
}
```

`client.uploadAndIngest(...)` collapses upload + ingest for one file.
`files.upload` switches to a resumable session automatically at **32 MiB**.

## Workspaces

```text theme={"dark"}
create(opts: { name: string; domain_slug?: string; access?: AccessConfig; ... }): Promise<Workspace>
get(workspace_id: string): Promise<Workspace>
list(opts?: { name_contains?, cursor?, limit? }): Promise<Page<Workspace>>
iterAll(opts?: { name_contains? }): AsyncGenerator<Workspace>
stats(workspace_id: string): Promise<WorkspaceStats>
delete(workspace_id: string, opts: { confirm_name: string }): Promise<Job>
```

`access.labels` is a list of `{name, description}` catalog objects.

## Files and ingestion

```text theme={"dark"}
client.files.upload(workspace_id, content, { path: string, ... })
client.files.createUploadSession(...)
client.files.createUploadGrant(workspace_id, { path?, max_bytes?, ... })
client.ingestion.ingest(workspace_id, { file_ids?, path_prefix?, stale_only? })
client.ingestion.reconcile(workspace_id, { auto_ingest? })
client.ingestion.buildKnowledgeGraph(workspace_id)
```

## Search and tools

```text theme={"dark"}
client.tools.hybridSearch(workspace_id, { query, k?, path_prefix? })
client.tools.qaFile(workspace_id, { path, query })
client.tools.queryTables(workspace_id, { paths, query })
client.search.fact(workspace_id, { query, wait_seconds? })
client.search.deep(workspace_id, { query, session_id?, wait_seconds? })
```

Filtered search and `run_sql` are HTTP-only in TypeScript.

`qaFile` is for documents, images, and recordings — not Excel. Use
`queryTables`. Deep search is one question per `session_id`.

See [Workspace](/guides/workspace), [Search](/guides/search), and
[File tools](/guides/file-tools).
