Returns version and feature-flag information about the AIAv2 API server.
{- "version": "string",
- "langgraph_js_version": "string",
- "context": "string",
- "flags": {
- "assistants": true,
- "crons": true,
- "langsmith": true,
- "langsmith_tracing_replicas": true
}
}Analyzes the given documents and suggests redaction annotations based on the
redaction criteria. Works with or without a database. Accepts JSON or, for the
database-less configuration, multipart/form-data (a file blob plus a data field).
| model | string Optional model id (e.g. "gpt4"). |
required | Array of objects (DocumentInput) non-empty |
| criteria required | string The redaction criteria, e.g. "PII" or "the word SECRET". |
object |
{- "model": "string",
- "documents": [
- {
- "documentId": "string",
- "file": "string",
- "layerName": "string",
- "pages": [
- 0
]
}
], - "criteria": "string",
- "options": {
- "confidence": {
- "threshold": 0
}
}
}{- "stagedActions": [
- {
- "type": "staged-redaction",
- "document": {
- "documentId": "string",
- "layerName": "string"
}, - "pageIndex": 0,
- "terms": [
- "string"
]
}
]
}Performs single-shot question-answering across one or more documents, retrieving
relevant context to generate an answer. Works with or without a database. Accepts
JSON or, for the database-less configuration, multipart/form-data.
required | Array of objects (DocumentInput) non-empty |
| input required | string The question to ask about the document(s). |
| model | string Optional model id (e.g. "gpt4"). |
{- "documents": [
- {
- "documentId": "string",
- "file": "string",
- "layerName": "string",
- "pages": [
- 0
]
}
], - "input": "string",
- "model": "string"
}{- "content": "string",
- "references": [
- {
- "pageContent": "string",
- "metadata": {
- "loc": {
- "pageNumber": 0
}
}
}
]
}Provides an LLM-based summary of what changed plus up to five suggested categories, intended for use as user preferences in a follow-up tagging request. Stateless; no changes are stored.
required | Array of objects (DocumentChange) |
| model | string Optional LLM model id (e.g. "gpt4o"). |
{- "changes": [
- {
- "id": "string",
- "text": "string",
- "type": "insert",
- "page": 0,
- "contextBefore": "string",
- "contextAfter": "string"
}
], - "model": "string"
}{- "summary": "string",
- "categories": [
- "string"
]
}Categorizes document changes against a list of user-defined labels and returns each change with its matching categories. Stateless; no changes are stored.
required | Array of objects (DocumentChange) |
| tags required | Array of strings Categories to tag the changes with. |
| model | string |
{- "changes": [
- {
- "id": "string",
- "text": "string",
- "type": "insert",
- "page": 0,
- "contextBefore": "string",
- "contextAfter": "string"
}
], - "tags": [
- "string"
], - "model": "string"
}{- "references": [
- {
- "id": "string",
- "text": "string",
- "type": "insert",
- "page": 0,
- "contextBefore": "string",
- "contextAfter": "string",
- "tag": [
- "string"
]
}
]
}OpenAI-compatible chat completions. Supports both simple chat and document-grounded
responses. Provide documents to ground the answer on ingested document content.
| model | string Optional model id (e.g. "gpt4"). |
required | Array of objects |
Array of objects | |
| temperature | number Controls randomness (0-1, default 0.7). |
| nutrient_dont_send_defaults | boolean Skip sending default parameters to the model (some deployments hang otherwise). |
{- "model": "string",
- "messages": [
- {
- "role": "string",
- "content": "string"
}
], - "documents": [
- {
- "documentId": "string",
- "layerName": "string"
}
], - "temperature": 0,
- "nutrient_dont_send_defaults": true
}{- "id": "string",
- "object": "chat.completion",
- "created": 0,
- "model": "string",
- "choices": [
- {
- "index": 0,
- "message": {
- "role": "assistant",
- "content": "string"
}, - "logprobs": { },
- "finish_reason": "stop"
}
], - "usage": {
- "prompt_tokens": 0,
- "completion_tokens": 0,
- "total_tokens": 0
}
}Stream a run within an existing thread context via Server-Sent Events. State is
persisted to the thread, and the run supports interrupts. See the stateless
/runs/stream endpoint for the event format.
| thread_id required | string |
| assistant_id required | string ID of the agent to execute. Must match a registered assistant. |
| input | any Input for the agent. For the default agent this is |
object (RecordStringUnknown) | |
object (RecordStringUnknown) | |
object Per-run context fields, e.g. | |
object (RecordStringUnknown) | |
StreamMode (string) or Array of StreamMode (strings) Which events to emit. A single mode or an array of modes. | |
string or Array of strings | |
string or Array of strings | |
| feedback_keys | Array of strings |
| stream_subgraphs | boolean |
| checkpoint_id | string |
object (RecordStringUnknown) |
{- "assistant_id": "chat",
- "input": {
- "messages": [
- {
- "role": "user",
- "content": "Summarize this document"
}
]
}, - "command": { },
- "config": { },
- "context": { },
- "metadata": { },
- "stream_mode": [
- "values",
- "messages"
], - "interrupt_before": "*",
- "interrupt_after": "*",
- "feedback_keys": [
- "string"
], - "stream_subgraphs": true,
- "checkpoint_id": "string",
- "checkpoint": { }
}{- "error": "string",
- "message": "string",
- "details": [
- {
- "field": "string",
- "message": "string"
}
]
}Execute an agent and stream results via Server-Sent Events. Stateless: no
conversation state is persisted. The first event is metadata ({ run_id, attempt });
subsequent events depend on stream_mode (values, messages/partial,
messages/complete, updates, debug), ending on completion or an error event.
Maximum stream duration is 5 minutes.
Note: JWTs with session_ids claims are not compatible with this endpoint.
| assistant_id required | string ID of the agent to execute. Must match a registered assistant. |
| input | any Input for the agent. For the default agent this is |
object (RecordStringUnknown) | |
object (RecordStringUnknown) | |
object Per-run context fields, e.g. | |
object (RecordStringUnknown) | |
StreamMode (string) or Array of StreamMode (strings) Which events to emit. A single mode or an array of modes. | |
string or Array of strings | |
string or Array of strings | |
| feedback_keys | Array of strings |
| stream_subgraphs | boolean |
| checkpoint_id | string |
object (RecordStringUnknown) |
{- "assistant_id": "chat",
- "input": {
- "messages": [
- {
- "role": "user",
- "content": "Summarize this document"
}
]
}, - "command": { },
- "config": { },
- "context": { },
- "metadata": { },
- "stream_mode": [
- "values",
- "messages"
], - "interrupt_before": "*",
- "interrupt_after": "*",
- "feedback_keys": [
- "string"
], - "stream_subgraphs": true,
- "checkpoint_id": "string",
- "checkpoint": { }
}{- "error": "string",
- "message": "string",
- "details": [
- {
- "field": "string",
- "message": "string"
}
]
}Execute an agent to completion and return the final graph state as JSON.
This endpoint runs in stateless mode: an ephemeral thread is created for the execution and deleted after completion. No conversation state is persisted.
Response modes:
Keep-alive (default): Uses chunked transfer encoding. Newline characters (\n) are sent every second to prevent proxy/load balancer timeouts. The final JSON result is appended after execution completes. The response is transparent to JSON.parse() since leading whitespace is ignored.
Pure JSON: Send Accept: application/json header. Returns a standard JSON response with no newline padding. Simpler but may timeout on long-running agents behind proxies.
Error handling:
{ "__error__": { "error": "...", "message": "..." } } in the response body.Headers:
Content-Location: /runs/{run_id} is set before execution begins.Maximum execution time is 5 minutes.
Note: JWTs with session_ids claims are not compatible with this endpoint.
Request body for creating a stateless run.
| assistant_id required | string ID of the agent to execute. Must match a registered assistant. |
| input | any Input data for the agent. Structure depends on the agent's input schema. For the default Nutrient assistant agent, the input object supports:
|
object Runtime configuration overrides merged into the agent's default configuration. | |
object Arbitrary metadata attached to the run. Not processed by the server. |
{- "assistant_id": "nutrient-assistant",
- "input": {
- "messages": [
- {
- "role": "user",
- "content": "Summarize this document"
}
], - "documents": [
- {
- "fingerprint": "doc-abc123",
- "role": "active"
}
]
}, - "config": { },
- "metadata": { }
}{- "__error__": {
- "error": "string",
- "message": "string"
}
}Create a new conversation thread.
| thread_id | string Optional client-supplied thread id. Generated if omitted. |
object (RecordStringUnknown) | |
| if_exists | string Enum: "raise" "do_nothing" Behaviour when a thread with the given id already exists. |
{- "thread_id": "string",
- "metadata": { },
- "if_exists": "raise"
}{- "thread_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "metadata": { },
- "status": "idle"
}Search threads with filtering and pagination.
object (RecordStringUnknown) | |
| ids | Array of strings |
| status | string Enum: "idle" "busy" "interrupted" "error" |
object (RecordStringUnknown) | |
| limit | integer [ 1 .. 1000 ] |
| offset | integer >= 0 |
| sort_by | string Enum: "thread_id" "status" "created_at" "updated_at" |
| sort_order | string Enum: "asc" "desc" |
{- "metadata": { },
- "ids": [
- "string"
], - "status": "idle",
- "values": { },
- "limit": 1,
- "offset": 0,
- "sort_by": "thread_id",
- "sort_order": "asc"
}[- {
- "thread_id": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "metadata": { },
- "status": "idle"
}
]Get the current state of a thread.
| thread_id required | string |
| subgraphs | boolean Include subgraph states. |
{- "values": { },
- "next": [
- "string"
], - "checkpoint": { },
- "metadata": { },
- "created_at": "2019-08-24T14:15:22Z",
- "parent_checkpoint": { },
- "tasks": [
- { }
]
}Get thread state history with filtering.
| thread_id required | string |
| limit | integer [ 1 .. 100 ] |
string or RecordStringUnknown (object) Return states before this checkpoint id (string) or checkpoint object. | |
object (RecordStringUnknown) | |
object (RecordStringUnknown) |
{- "limit": 1,
- "before": "string",
- "metadata": { },
- "checkpoint": { }
}[- {
- "values": { },
- "next": [
- "string"
], - "checkpoint": { },
- "metadata": { },
- "created_at": "2019-08-24T14:15:22Z",
- "parent_checkpoint": { },
- "tasks": [
- { }
]
}
]List all available assistants with pagination.
| limit | integer [ 1 .. 100 ] Default: 10 Maximum number of results (1-100). |
| offset | integer >= 0 Default: 0 Pagination offset. |
[- {
- "assistant_id": "chat",
- "graph_id": "react",
- "name": "string",
- "description": "string",
- "config": { },
- "metadata": { },
- "created_at": "2019-08-24T14:15:22Z",
- "version": 0
}
]Search assistants with advanced filtering.
object (RecordStringUnknown) | |
| graphId | string |
| limit | integer [ 1 .. 100 ] Default: 10 |
| offset | integer >= 0 Default: 0 |
| sortBy | string |
| sortOrder | string Enum: "asc" "desc" |
{- "metadata": { },
- "graphId": "string",
- "limit": 10,
- "offset": 0,
- "sortBy": "string",
- "sortOrder": "asc"
}[- {
- "assistant_id": "chat",
- "graph_id": "react",
- "name": "string",
- "description": "string",
- "config": { },
- "metadata": { },
- "created_at": "2019-08-24T14:15:22Z",
- "version": 0
}
]Get the input, output, state, and context schemas for a specific assistant.
| assistant_id required | string Example: chat ID of the assistant. |
{- "graph_id": "string",
- "input_schema": { },
- "output_schema": { },
- "state_schema": { },
- "context_schema": { },
- "config_schema": { }
}Returns the identifiers of all the documents ingested into the Nutrient AI Assistant database.
If the identifier is listed in the response, the database contains contextual information such document metadata, and document contents, as well as AI synthesized information such as classifications, and summaries.
{- "documents": [
- {
- "documentId": "123456789abc",
- "layerName": "myLayer"
}
]
}Deletes the data associated with each layer of the given document, as well as the document default layer (no layer name) itself.
All data including contextual data such as document metadata, and document contents, as well as AI synthesized information such as classifications, and summaries will be deleted.
| documentId required | string Example: 123456789abc The ID of the document to delete. This ID is given when creating the document on the Document Engine. |
{ }Deletes the data associated with the given document layer.
All data including contextual data such as document metadata, and document contents, as well as AI synthesized information such as classifications, and summaries will be deleted.
| documentId required | string Example: 123456789abc The ID of the document to delete the layer from. This ID is given when creating the document on the Document Engine. |
| layerName required | string Example: 123456789abc The name of the layer to delete. This layer name is given when creating a layer on the Document Engine. |
{ }Checks if a document with the given ID and file hash has already been ingested into the Nutrient AI Assistant database.
| documentId required | string The permanent ID of the document to check if it is ingested. This ID uniquely identifies a document and won't change if the document is modified. |
| fileHash required | string The hash of the file in its current state. |
{ }Ingests a PDF document directly into the Nutrient AI Assistant database. The document will be processed, analyzed, and stored for future retrieval and analysis.
The endpoint expects a raw PDF file in the request body with content-type application/pdf.
Returns permanent and changing IDs for the document.
{- "permanentId": "string",
- "changingId": "string",
- "token": "string"
}Ingests a PDF document stored in Nutrient Document Engine into the Nutrient AI Assistant database. The document will be processed, analyzed, and stored for future retrieval and analysis.
| documentId required | string Example: 123456789abc The ID of the document to ingest. This ID is given when creating the document on the Document Engine. |
| fileHash required | string Example: 123456789abc The hash of the file in its current state. This will be used to check if the file has changed since the last ingest and whether to trigger a new ingest. |
{ }Ingests a PDF document stored in Nutrient Document Engine into the Nutrient AI Assistant database. The document will be processed, analyzed, and stored for future retrieval and analysis.
| documentId required | string Example: 123456789abc The ID of the document to ingest. This ID is given when creating the document on the Document Engine. |
| layerName required | string Example: myLayer The name of the layer to ingest. This layer name is given when creating a layer on the Document Engine. |
| fileHash required | string Example: 123456789abc The hash of the file in its current state. This will be used to check if the file has changed since the last ingest and whether to trigger a new ingest. |
{ }Returns all the session information held in the AI Assistant database.
This includes the session ID, the user ID (if present), and the timestamp of the last message sent.
{- "sessions": [
- {
- "sessionId": "123456789abc",
- "timestamp": 1620000000000,
- "userId": "123456789abc"
}
]
}Deletes all session data for the given Session ID.
This includes all messages and metadata associated with the session. Meaning the chat history will no longer be available.
| sessionId required | string Example: 123456789abc The unique identifier for the session. This value is given as part of the AI Assistant configuration when initializing the Nutrient Web SDK. |
{ }Returns all the session information for all sessions tagged with a given user ID.
Sessions are tagged with a user ID when the AI Assistant configuration in the Nutrient Web SDK is initialized with a user ID.
| userId required | string Example: 123456789abc The unique identifier for the user. This value is optionally given in the AI Assistant configuration when initializing the Nutrient Web SDK. |
{- "sessions": [
- {
- "sessionId": "123456789abc",
- "timestamp": 1620000000000,
- "userId": "123456789abc"
}
]
}Ingests a PDF document without relying on Document Engine. The request body is the
raw PDF (application/pdf). Returns the permanent and changing ids and, for client
requests, a new JWT scoped to the ingested document.
{- "permanentId": "string",
- "changingId": "string",
- "token": "string"
}Ingests a document stored in Nutrient Document Engine. Requires Document Engine.
| documentId required | string Example: 123456789abc |
| fileHash required | string A hash of the file content to detect changes. |
{- "error": {
- "type": "string",
- "message": "string"
}
}Ingests a specific layer of a document stored in Nutrient Document Engine. Requires Document Engine.
| documentId required | string Example: 123456789abc |
| layerName required | string Example: myLayer |
| fileHash required | string |
{- "error": {
- "type": "string",
- "message": "string"
}
}Checks if a document with the given file hash has already been ingested.
| documentId required | string |
| fileHash required | string |
{- "error": {
- "type": "string",
- "message": "string"
}
}Retrieves the chat history for a specific session.
| sessionId required | string Example: 123456789abc |
[- {
- "requestId": "string",
- "sender": "human",
- "timestamp": 0,
- "documents": [
- {
- "documentId": "string",
- "layerName": "string"
}
], - "content": "string",
- "links": [
- { }
], - "suggestions": [
- { }
], - "stagedActions": [
- { }
], - "actions": [
- { }
], - "additionalContext": { }
}
]