Skip to main content
A workspace is persistent storage plus derived representations. Files remain until retention or deletion removes them. Uploading creates a file record; ingestion is the separate, billable operation that makes the file searchable.
1

Create

Choose the workspace name, domain, access policy, retention, currency, knowledge-graph, and ledger-understanding policy.
2

Upload

Add source files at stable paths. Large SDK uploads automatically use resumable sessions.
3

Ingest

Build derived files, metadata, search indexes, and optional graph inputs.
4

Search and analyze

Use automatic search, QA, file QA, or table QA.

Basic usage

client.uploadAndIngest(...) combines the upload and ingestion calls for one file. Files at or above 32 MiB automatically use resumable upload sessions.

Create a workspace

Method signature

Parameters

Returns

A Workspace containing the generated ID, name, resolved domain/version, configuration, status, purpose, and timestamps. It is ready for uploads immediately; there is no activation step. Workspace names may contain spaces and dashes. A second active workspace with the same owner and name returns workspace_name_taken.

Configure access labels

Create labels in the organization catalog first, then freeze the selected {name, description} objects onto the workspace. An empty label list disables access-label filtering. With a non-empty list, default_label must name one of those labels. See Access labels.

Configure retention

Retention is chosen at creation. Derived TTL, source TTL, and job-payload TTL are separate; zero or null semantics depend on the field. See File lifecycle before setting them.

Configure currency and knowledge graph

Knowledge-graph builds are billable and are not implied by ingestion unless auto_build: true.

Upload files

files.upload writes a persistent source at a workspace path:
The workspace path is required and remains the file’s identity. On conflict, reject fails while new_version replaces the current bytes and preserves version metadata. The labels mapping on a file is caller-defined metadata. It is separate from the workspace access-label policy. An unsupported source throws InvalidRequestError with code === ErrorCode.UNSUPPORTED_FILE_TYPE before a workspace file is created. uploadAndIngest stops at the same boundary and does not queue ingestion. Use Format support as the source of truth instead of maintaining a client-side extension list. Files at or above 32 MiB automatically use resumable upload sessions. Call files.uploadChunked directly only when you want that behavior below the automatic threshold.

Upload from a URL

Use a presigned URL for private storage. NDI must be able to reach the URL.

Upload from a browser

Your backend can mint a short-lived upload grant without exposing its API key:
The browser redeems the token in X-Upload-Token. total_size_bytes can pin the expected upload size and ttl_seconds can shorten the grant lifetime. See Upload grants.

Large uploads

Resume interrupted uploads and understand session tokens, parts, and completion.

File lifecycle

Understand discovered, ingested, stale, expired, replacement, and deletion states.

Inspect and manage files

Use files.metadata(workspace_id, file_id).then(m => m.representations) when you need to know whether a specific file is searchable now.

Ingest files

Uploading alone does not make a file searchable. Ingest by file IDs, by path prefix, or across the entire workspace:
Pass either file_ids or path_prefix, never both. Omit both to ingest the whole workspace. For routine refreshes, combine a prefix with stale_only: true. One corrupt file appears as a failed outcome on a succeeded job. It does not fail a folder-wide ingestion. A job where every attempted file failed is failed. The code is taken from the files, and error.detail lists them. Partial failures stay outcomes on a succeeded job.

Upload and ingest one file

This convenience still performs two API operations. Use the explicit methods when uploading several files before one ingestion run.

Reconcile external storage changes

Reconciliation detects ledger drift. With auto_ingest: true, it chains a separate ingestion job for discovered or stale files.

Search and analyze

Files must finish ingestion before tools and search can use their derived representations.
Use Search methods to choose a method.

QA and follow-up threads

search.qa asks one turn of a conversation. The result’s answer.session_id continues it as a follow-up:

Automatic search

Routes, modes, structured answers, and catalog tables.

QA

Conversations, follow-ups, and clarifying questions.

Build a knowledge graph

Graph construction is corpus-wide. force: true clears the durable graph store before rebuilding; omit it for normal incremental work.

Knowledge graph guide

Configure automatic builds and exclusions, then inspect, search, and traverse the graph.

List, inspect, and update

files_by_ingestion_status is the completeness signal: stale files need re-ingestion; expired files need their derived representations rebuilt. Only the retention, knowledge-graph, currency, and ledger-understanding blocks and the global context are mutable:
Updating replaces each supplied block whole. Read the existing block and send back every field you want to preserve. Retention edits apply to existing data differently per lifetime: a changed derived_ttl_days recomputes the expiry of files already ingested (clearing it removes their expiry), source_ttl_days is evaluated at each sweep so it applies to existing files, and job_ttl_days applies only to jobs created afterwards. Set the global context once and every je-testing or search call that omits context runs with it:
global_context: "" clears it.

Delete a workspace

confirm_name must match exactly. Deletion cascades through source files, derived outputs, index rows, and graph data and cannot be undone. Platform-managed workspaces with a non-null purpose cannot be deleted.

Error handling

Common errors include unsupported_file_type, workspace_name_taken, path conflicts, invalid access labels, tools called before ingestion, and a deletion confirmation that does not match the workspace name.

Best practices

Separate upload from ingestion

Upload files first, then ingest a batch by IDs or path prefix to avoid one ingestion run per file.

Use stable paths

Treat the workspace path as the durable file identity and use new_version for replacements.

Inspect every outcome

Folder ingestion can succeed while individual files report failed outcomes.

Read coverage

Search and tool responses disclose when access labels withheld matching candidates.

Next steps