### GET /server/api/v1/sessions Source: https://www.nutrient.io/api/ai-assistant/index.html Returns all session information stored in the AI Assistant database, including session ID, user ID, and last message timestamp. ```APIDOC ## GET /server/api/v1/sessions ### Description 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. ### Method GET ### Endpoint /server/api/v1/sessions ### Parameters #### Query Parameters None ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (204) - **sessions** (array) - An array of session objects. - **sessionId** (string) - The unique identifier for the session. - **timestamp** (integer) - The timestamp of the last message sent in the session. - **userId** (string) - The unique identifier for the user associated with the session (optional). #### Error Responses - **500** - A type that represents an error response. #### Response Example ```json { "sessions": [ { "sessionId": "123456789abc", "timestamp": 1620000000000, "userId": "123456789abc" } ] } ``` ``` -------------------------------- ### GET /server/api/v1/documents/{documentId}/fileHash/{fileHash} Source: https://www.nutrient.io/api/ai-assistant/index.html Checks if a document with the given ID and file hash has already been ingested into the Nutrient AI Assistant database. ```APIDOC ## GET /server/api/v1/documents/{documentId}/fileHash/{fileHash} ### Description Checks if a document with the given ID and file hash has already been ingested into the Nutrient AI Assistant database. ### Method GET ### Endpoint /server/api/v1/documents/{documentId}/fileHash/{fileHash} ### Parameters #### Path Parameters - **documentId** (string) - Required - 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** (string) - Required - The hash of the file in its current state. ### Responses #### Success Response (204) A response with no content. #### Error Responses - **404**: A type that represents an error response. - **409**: A type that represents an error response. - **500**: A type that represents an error response. ``` -------------------------------- ### GET /server/api/v1/documents/{documentId}/ingest/{fileHash} Source: https://www.nutrient.io/api/ai-assistant/index.html 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. ```APIDOC ## GET /server/api/v1/documents/{documentId}/ingest/{fileHash} ### Description 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. ### Method GET ### Endpoint /server/api/v1/documents/{documentId}/ingest/{fileHash} ### Parameters #### Path Parameters - **documentId** (string) - Required - The ID of the document to ingest. This ID is given when creating the document on the Document Engine. - **fileHash** (string) - Required - 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. ### Responses #### Success Response (204) A response with no content. #### Error Responses - **404**: A type that represents an error response. - **500**: A type that represents an error response. ``` -------------------------------- ### GET /server/api/v1/documents/{documentId}/layers/{layerName}/ingest/{fileHash} Source: https://www.nutrient.io/api/ai-assistant/index.html Ingests a PDF document of a specific layer name originating from Nutrient Document Engine. This allows for layered document processing and analysis. ```APIDOC ## GET /server/api/v1/documents/{documentId}/layers/{layerName}/ingest/{fileHash} ### Description 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. ### Method GET ### Endpoint /server/api/v1/documents/{documentId}/layers/{layerName}/ingest/{fileHash} ### Parameters #### Path Parameters - **documentId** (string) - Required - The ID of the document to ingest. This ID is given when creating the document on the Document Engine. - **layerName** (string) - Required - The name of the layer to ingest. This layer name is given when creating a layer on the Document Engine. - **fileHash** (string) - Required - 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. ### Response #### Success Response (204) This endpoint returns a No Content response upon successful ingestion. #### Error Response (404, 500) - **error.type** (string) - The type of the error. - **error.message** (string) - The error message. #### Error Response Example ```json { "error": { "type": "LAYER_NOT_FOUND", "message": "The specified layer name was not found for the document." } } ``` ``` -------------------------------- ### GET /server/api/v1/sessions/user/{userId} Source: https://www.nutrient.io/api/ai-assistant/index.html Returns all session information for sessions tagged with a specific user ID. ```APIDOC ## GET /server/api/v1/sessions/user/{userId} ### Description 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. ### Method GET ### Endpoint /server/api/v1/sessions/user/{userId} ### Parameters #### Path Parameters - **userId** (string) - Required - The unique identifier for the user. This value is optionally given in the AI Assistant configuration when initializing the Nutrient Web SDK. ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (204) - **sessions** (array) - An array of session objects associated with the user. - **sessionId** (string) - The unique identifier for the session. - **timestamp** (integer) - The timestamp of the last message sent in the session. - **userId** (string) - The unique identifier for the user associated with the session. #### Error Responses - **500** - A type that represents an error response. #### Response Example ```json { "sessions": [ { "sessionId": "123456789abc", "timestamp": 1620000000000, "userId": "123456789abc" } ] } ``` ``` -------------------------------- ### GET /healthcheck Source: https://www.nutrient.io/api/ai-assistant/index.html Responds with the health status of the server, including uptime and a status message. ```APIDOC ## GET /healthcheck ### Description Responds with the health status of the server. ### Method GET ### Endpoint /healthcheck ### Parameters #### Query Parameters None ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **uptime** (integer) - The server uptime in seconds. - **message** (string) - The status message, typically "OK". - **timestamp** (integer) - The timestamp of the health check. #### Error Responses - **500** - A type that represents an error response. #### Response Example ```json { "uptime": 123, "message": "OK", "timestamp": 1620000000000 } ``` ``` -------------------------------- ### GET /server/api/v1/sessions Source: https://www.nutrient.io/api/ai-assistant/index.html Retrieves all session information from the AI Assistant database, including session ID, user ID, and last message timestamp. ```APIDOC ## GET /server/api/v1/sessions ### Description Retrieves all session information from the AI Assistant database, including session ID, user ID, and last message timestamp. ### Method GET ### Endpoint /server/api/v1/sessions ### Parameters (No parameters are defined for this endpoint.) ### Response #### Success Response (204) - **sessions** (array) - An array of session information objects. - Each session object contains details like `sessionId`, `userId`, and `lastMessageTimestamp`. #### Response Example ```json { "sessions": [ { "sessionId": "session123", "userId": "user456", "lastMessageTimestamp": 1620000000000 } ] } ``` #### Error Response (500) - **error** (object) - Description of the error encountered. - **type** (string) - The type of the error. - **message** (string) - The error message. ``` -------------------------------- ### GET /server/api/v1/documents Source: https://www.nutrient.io/api/ai-assistant/index.html Retrieves the identifiers of all documents ingested into the AI Assistant database. This includes metadata, content, and AI-synthesized information. ```APIDOC ## GET /server/api/v1/documents ### Description 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. ### Method GET ### Endpoint /server/api/v1/documents ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **documents** (array) - An array of document identifiers. #### Response Example ```json { "documents": [ { "sessionId": "123456789abc", "timestamp": 1620000000000, "userId": "123456789abc" } ] } ``` #### Error Response (500) - **error** (object) - **type** (string) - The type of the error. - **message** (string) - The error message. #### Response Example ```json { "error": { "type": "string", "message": "string" } } ``` ``` -------------------------------- ### GET /healthcheck Source: https://www.nutrient.io/api/ai-assistant/index.html Checks the health status of the server. Responds with uptime, status message, and timestamp. ```APIDOC ## GET /healthcheck ### Description Checks the health status of the server. Responds with uptime, status message, and timestamp. ### Method GET ### Endpoint /healthcheck ### Parameters (No parameters are defined for this endpoint.) ### Response #### Success Response (200) - **uptime** (number) - Seconds since the service started. - **message** (string) - The status message (e.g., "OK"). - **timestamp** (number) - Unix epoch timestamp when the response was sent. #### Response Example ```json { "uptime": 123, "message": "OK", "timestamp": 1620000000000 } ``` #### Error Response (500) - **error** (object) - Description of the error encountered. - **type** (string) - The type of the error. - **message** (string) - The error message. ``` -------------------------------- ### GET /server/api/v1/documents/{documentId}/fileHash/{fileHash} Source: https://www.nutrient.io/api/ai-assistant/index.html Checks if a document with the given ID and file hash has already been ingested into the Nutrient AI Assistant database. This is useful for preventing duplicate ingestions. ```APIDOC ## GET /server/api/v1/documents/{documentId}/fileHash/{fileHash} ### Description Checks if a document with the given ID and file hash has already been ingested into the Nutrient AI Assistant database. This is useful for preventing duplicate ingestions. ### Method GET ### Endpoint /server/api/v1/documents/{documentId}/fileHash/{fileHash} ### Parameters #### Path Parameters - **documentId** (string) - Required - 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** (string) - Required - The hash of the file in its current state. ### Response #### Success Response (204) - **NoContent** (object) - A response with no content, indicating the document has been ingested. #### Error Response (404, 409, 500) - **error** (object) - **type** (string) - The type of the error. - **message** (string) - The error message. ``` -------------------------------- ### GET /server/api/v1/documents/{documentId}/ingest/{fileHash} Source: https://www.nutrient.io/api/ai-assistant/index.html Ingests a PDF document originating from Nutrient Document Engine. This endpoint processes and stores the document for retrieval and analysis. ```APIDOC ## GET /server/api/v1/documents/{documentId}/ingest/{fileHash} ### Description 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. ### Method GET ### Endpoint /server/api/v1/documents/{documentId}/ingest/{fileHash} ### Parameters #### Path Parameters - **documentId** (string) - Required - The ID of the document to ingest. This ID is given when creating the document on the Document Engine. - **fileHash** (string) - Required - 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. ### Response #### Success Response (204) This endpoint returns a No Content response upon successful ingestion. #### Error Response (404, 500) - **error.type** (string) - The type of the error. - **error.message** (string) - The error message. #### Error Response Example ```json { "error": { "type": "DOCUMENT_NOT_FOUND", "message": "The specified document ID was not found." } } ``` ``` -------------------------------- ### Get All Sessions API Source: https://www.nutrient.io/api/ai-assistant/index.html Retrieves all session information from the AI Assistant database, including session ID, user ID, and last message timestamp. Requires API authentication token. Returns a 204 with session data or 500 on error. ```HTTP GET /server/api/v1/sessions ``` ```JSON { "sessions": [ { "sessionId": "123456789abc", "timestamp": 1620000000000, "userId": "123456789abc" } ] } ``` -------------------------------- ### GET /server/api/v1/sessions/user/{userId} Source: https://www.nutrient.io/api/ai-assistant/index.html Retrieves all session information for sessions associated with a specific user ID. This is useful for tracking user activity within the AI Assistant. ```APIDOC ## GET /server/api/v1/sessions/user/{userId} ### Description 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. ### Method GET ### Endpoint /server/api/v1/sessions/user/{userId} ### Parameters #### Path Parameters - **userId** (string) - Required - The unique identifier for the user. This value is optionally given in the AI Assistant configuration when initializing the Nutrient Web SDK. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (204) - **sessions** (array) - An array of session information. Each item in the array is an object with the following properties: - **sessionId** (string) - A unique identifier for a chat session. - **timestamp** (number) - A Unix Epoch value of the last message sent or received for the session. - **userId** (string) - The unique identifier for a user if the session is associated with a user. #### Response Example ```json { "sessions": [ { "sessionId": "123456789abc", "timestamp": 1620000000000, "userId": "123456789abc" } ] } ``` #### Error Response (500) - **error** (object) - An object containing error details. - **type** (string) - The type of the error. - **message** (string) - The error message. ``` -------------------------------- ### Get User Sessions API Source: https://www.nutrient.io/api/ai-assistant/index.html Retrieves all session information tagged with a specific user ID. Requires API authentication token and the user ID. Returns 204 with session data or 500 on error. ```HTTP GET /server/api/v1/sessions/user/{userId} ``` -------------------------------- ### Get Document IDs - JSON Response Sample Source: https://www.nutrient.io/api/ai-assistant/index.html This JSON snippet represents a successful response when retrieving document IDs from the AI Assistant API. It contains a list of session objects, each with a sessionId, timestamp, and userId. ```json { "sessions": [ { "sessionId": "123456789abc", "timestamp": 1620000000000, "userId": "123456789abc" } ] } ``` -------------------------------- ### Get Documents - API Endpoint Description Source: https://www.nutrient.io/api/ai-assistant/index.html This OpenAPI specification describes the 'getDocuments' operation for the AI Assistant API. It retrieves identifiers of all documents in the database, returning a JSON object containing a list of document IDs. ```yaml paths: /server/api/v1/documents: get: operationId: getDocuments tags: - Documents summary: Get Documents description: Returns the identifiers of all the documents ingested into the Nutrient AI Assistant database. security: - ApiAuthToken: [] responses: "200": description: A response with the IDs of all the documents ingested. content: application/json: schema: type: object properties: documents: type: array items: $ref: "#/components/schemas/DocumentFingerprint" "500": description: A type that represents an error response. content: application/json: schema: type: object properties: error: type: object properties: type: type: string message: type: string ``` -------------------------------- ### POST /server/api/v1/documents/{documentId}/layers/{layerName}/ingest/{fileHash} Source: https://www.nutrient.io/api/ai-assistant/index.html Ingests a PDF document from the Nutrient Document Engine into the Nutrient AI Assistant database. The document is processed, analyzed, and stored for retrieval. ```APIDOC ## POST /server/api/v1/documents/{documentId}/layers/{layerName}/ingest/{fileHash} ### Description 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. ### Method POST ### Endpoint /server/api/v1/documents/{documentId}/layers/{layerName}/ingest/{fileHash} ### Parameters #### Path Parameters - **documentId** (string) - Required - The ID of the document to ingest. This ID is given when creating the document on the Document Engine. - **layerName** (string) - Required - The name of the layer to ingest. This layer name is given when creating a layer on the Document Engine. - **fileHash** (string) - Required - 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. ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (204) - **No Content** - A response with no content. #### Error Responses - **404** - A type that represents an error response. - **500** - A type that represents an error response. #### Response Example ```json { "example": "{}" } ``` ``` -------------------------------- ### Ingest PDF Document - Nutrient Document Engine Source: https://www.nutrient.io/api/ai-assistant/index.html Ingests a PDF document from the Nutrient Document Engine into the Nutrient AI Assistant database. Requires document ID, layer name, and file hash. Returns a 204 on success, or 404/500 on error. ```HTTP GET /server/api/v1/documents/{documentId}/layers/{layerName}/ingest/{fileHash} ``` -------------------------------- ### POST /server/api/v1/documents/ingest Source: https://www.nutrient.io/api/ai-assistant/index.html 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. ```APIDOC ## POST /server/api/v1/documents/ingest ### Description 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. ### Method POST ### Endpoint /server/api/v1/documents/ingest ### Parameters #### Request Body - **file** (binary) - Required - The PDF file to ingest. ### Request Example ``` POST /server/api/v1/documents/ingest HTTP/1.1 Content-Type: application/pdf [Binary PDF Content] ``` ### Response #### Success Response (200) - **id** (string) - The permanent ID of the ingested document. - **fileHash** (string) - The hash of the ingested file. ``` -------------------------------- ### POST /server/api/v1/documents/ingest Source: https://www.nutrient.io/api/ai-assistant/index.html Ingests a PDF document directly into the Nutrient AI Assistant database. The document will be processed, analyzed, and stored for future retrieval and analysis. ```APIDOC ## POST /server/api/v1/documents/ingest ### Description 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. ### Method POST ### Endpoint /server/api/v1/documents/ingest ### Parameters #### Request Body - **file** (binary) - Required - The PDF file to ingest. ### Request Example Content-Type: application/pdf [Binary PDF file content] ### Responses #### Success Response (200) A response to a standalone document ingest request. - **permanentId** (string) - The permanent ID of the ingested document. - **changingId** (string) - The changing ID of the ingested document. - **token** (string) - A token associated with the ingest request. #### Response Example ```json { "permanentId": "string", "changingId": "string", "token": "string" } ``` #### Error Responses - **400**: A type that represents an error response. - **403**: A type that represents an error response. - **500**: A type that represents an error response. ``` -------------------------------- ### POST /ingest Source: https://www.nutrient.io/api/ai-assistant/index.html Ingests a file into the AI Assistant system. It checks if the file has changed since the last ingest to determine if a new ingest is necessary. ```APIDOC ## POST /ingest ### Description Ingests a file into the AI Assistant system. It checks if the file has changed since the last ingest to determine if a new ingest is necessary. ### Method POST ### Endpoint /ingest ### Parameters #### Query Parameters - **fileHash** (string) - Required - The hash of the file to check for changes. ### Request Body (The request body is not explicitly defined in the provided schema, but typically would contain the file content or a reference to it.) ### Response #### Success Response (204) - No content is returned upon successful ingestion. #### Error Response (404, 500) - **error** (object) - Description of the error encountered. - **type** (string) - The type of the error. - **message** (string) - The error message. ``` -------------------------------- ### POST /server/api/v1/documents/ingest Source: https://www.nutrient.io/api/ai-assistant/index.html Ingests a standalone document into the Nutrient AI Assistant. This process involves analyzing and storing the document for future retrieval and analysis. ```APIDOC ## POST /server/api/v1/documents/ingest ### Description Ingests a standalone document into the Nutrient AI Assistant. This process involves analyzing and storing the document for future retrieval and analysis. ### Method POST ### Endpoint /server/api/v1/documents/ingest ### Parameters #### Query Parameters - **file** (file) - Required - The document file to be ingested. ### Request Body This endpoint does not have a request body, the file is sent as a multipart/form-data request. ### Response #### Success Response (200) - **permanentId** (string) - The permanent ID of the document that was ingested. - **changingId** (string) - The changing ID of the document that was ingested. - **token** (string) - JWT with document access claims. Only present for client API responses. #### Response Example ```json { "permanentId": "doc_abc123", "changingId": "doc_xyz789", "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." } ``` #### Error Response (400, 403, 500) - **error.type** (string) - The type of the error. - **error.message** (string) - The error message. #### Error Response Example ```json { "error": { "type": "INVALID_REQUEST", "message": "The provided document is not valid." } } ``` ``` -------------------------------- ### Sessions API Source: https://www.nutrient.io/api/ai-assistant/index.html Endpoints for managing user sessions. ```APIDOC ## GET /sessions ### Description Retrieves a list of all active sessions. ### Method GET ### Endpoint /sessions ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **sessions** (array) - An array of session objects. #### Error Response (500) - A type that represents an error response. ### Request Example None ### Response Example ```json { "sessions": [ { "sessionId": "session-123", "userId": "user-abc" } ] } ``` ``` ```APIDOC ## DELETE /sessions/{sessionId} ### Description Deletes a specific session. ### Method DELETE ### Endpoint /sessions/{sessionId} ### Parameters #### Path Parameters - **sessionId** (string) - Required - The ID of the session to delete. #### Query Parameters None #### Request Body None ### Response #### Success Response (204) - A response with no content. #### Error Response (404, 500) - A type that represents an error response. ### Request Example None ### Response Example None (204 No Content) ``` ```APIDOC ## GET /sessions/user ### Description Retrieves all sessions for the current user. ### Method GET ### Endpoint /sessions/user ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **sessions** (array) - An array of session objects belonging to the user. #### Error Response (500) - A type that represents an error response. ### Request Example None ### Response Example ```json { "sessions": [ { "sessionId": "session-xyz", "userId": "user-abc" } ] } ``` ``` -------------------------------- ### Document Ingestion API Source: https://www.nutrient.io/api/ai-assistant/index.html Endpoints for ingesting PDF documents. ```APIDOC ## POST /ingest/pdf ### Description Ingests a PDF document into the AI Assistant. ### Method POST ### Endpoint /ingest/pdf ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **pdf_file** (file) - Required - The PDF file to ingest. - **layer_name** (string) - Optional - The name of the layer to associate with the document. ### Response #### Success Response (200) - **documentId** (string) - The ID of the ingested document. - **layerName** (string) - The name of the layer associated with the document. #### Error Response (400, 500) - A type that represents an error response. ### Request Example ``` --boundary Content-Disposition: form-data; name="pdf_file"; filename="document.pdf" Content-Type: application/pdf [PDF file content] --boundary Content-Disposition: form-data; name="layer_name" myLayer --boundary-- ``` ### Response Example ```json { "documentId": "new-document-id", "layerName": "myLayer" } ``` ``` ```APIDOC ## GET /ingest/pdf/status ### Description Checks the ingestion status of a PDF document. ### Method GET ### Endpoint /ingest/pdf/status ### Parameters #### Query Parameters - **documentId** (string) - Required - The ID of the document to check. #### Request Body None ### Response #### Success Response (200) - **status** (string) - The ingestion status (e.g., 'processing', 'completed', 'failed'). #### Error Response (400, 500) - A type that represents an error response. ### Request Example None ### Response Example ```json { "status": "completed" } ``` ``` ```APIDOC ## GET /ingest/pdf/{documentId}/engine ### Description Retrieves a PDF document ingested from the Nutrient Document Engine. ### Method GET ### Endpoint /ingest/pdf/{documentId}/engine ### Parameters #### Path Parameters - **documentId** (string) - Required - The ID of the document to retrieve. #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **pdf_content** (string) - The content of the PDF document (base64 encoded). #### Error Response (404, 500) - A type that represents an error response. ### Request Example None ### Response Example ```json { "pdf_content": "JVBERi0xLjQKJc..." } ``` ``` ```APIDOC ## GET /ingest/pdf/{documentId}/engine/{layerName} ### Description Retrieves a PDF document of a specific layer ingested from the Nutrient Document Engine. ### Method GET ### Endpoint /ingest/pdf/{documentId}/engine/{layerName} ### Parameters #### Path Parameters - **documentId** (string) - Required - The ID of the document to retrieve. - **layerName** (string) - Required - The name of the layer to retrieve. #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **pdf_content** (string) - The content of the PDF document (base64 encoded). #### Error Response (404, 500) - A type that represents an error response. ### Request Example None ### Response Example ```json { "pdf_content": "JVBERi0xLjQKJc..." } ``` ``` -------------------------------- ### Delete Document - API Endpoint Description Source: https://www.nutrient.io/api/ai-assistant/index.html This OpenAPI specification details the 'deleteDocument' operation for the AI Assistant API. It allows for the deletion of all data associated with a given document ID, including metadata, content, and AI-synthesized information. ```yaml paths: /server/api/v1/documents/{documentId}: delete: operationId: deleteDocument tags: - Documents summary: Delete Document description: Deletes the data associated with each layer of the given document, as well as the document default layer (no layer name) itself. security: - ApiAuthToken: [] parameters: - name: documentId in: path required: true schema: type: string example: "123456789abc" responses: "204": description: A response with no content. "400": description: A type that represents an error response. "404": description: A type that represents an error response. "500": description: A type that represents an error response. ``` -------------------------------- ### Documents API Source: https://www.nutrient.io/api/ai-assistant/index.html Endpoints for managing documents, including retrieval, deletion, and ingestion. ```APIDOC ## GET /server/api/v1/documents ### Description 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. ### Method GET ### Endpoint /server/api/v1/documents ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **documents** (array) - An array of document objects, each containing 'documentId' and 'layerName'. - **documentId** (string) - The unique identifier for the document. - **layerName** (string) - The name of the layer associated with the document. #### Error Response (500) - A type that represents an error response. ### Request Example None ### Response Example ```json { "documents": [ { "documentId": "123456789abc", "layerName": "myLayer" } ] } ``` ``` ```APIDOC ## DELETE /server/api/v1/documents/{documentId} ### Description 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. ### Method DELETE ### Endpoint /server/api/v1/documents/{documentId} ### Parameters #### Path Parameters - **documentId** (string) - Required - The ID of the document to delete. This ID is given when creating the document on the Document Engine. #### Query Parameters None #### Request Body None ### Response #### Success Response (204) - A response with no content. #### Error Response (400, 404, 500) - A type that represents an error response. ### Request Example None ### Response Example None (204 No Content) ``` -------------------------------- ### Health Check API Source: https://www.nutrient.io/api/ai-assistant/index.html Checks the health status of the Nutrient AI Assistant server. Returns a 200 with uptime and message on success, or 500 on error. No authorization is required. ```HTTP GET /healthcheck ``` ```JSON { "uptime": 123, "message": "OK", "timestamp": 1620000000000 } ``` -------------------------------- ### Delete Document Layer - API Endpoint Description Source: https://www.nutrient.io/api/ai-assistant/index.html This OpenAPI specification describes the 'deleteDocumentLayer' operation for the AI Assistant API. It enables the deletion of data associated with a specific layer of a given document, including all related contextual and AI-synthesized information. ```yaml paths: /server/api/v1/documents/{documentId}/layers/{layerName}: delete: operationId: deleteDocumentLayer tags: - Documents summary: Delete Document Layer description: Deletes the data associated with the given document layer. security: - ApiAuthToken: [] parameters: - name: documentId in: path required: true schema: type: string example: "123456789abc" - name: layerName in: path required: true schema: type: string ``` -------------------------------- ### DELETE /server/api/v1/documents/{documentId}/layers/{layerName} Source: https://www.nutrient.io/api/ai-assistant/index.html Deletes a specific layer from a document in the Nutrient AI Assistant database. The layer is identified by its name, which was assigned during its creation. ```APIDOC ## DELETE /server/api/v1/documents/{documentId}/layers/{layerName} ### Description Deletes a specific layer from a document in the Nutrient AI Assistant database. The layer is identified by its name, which was assigned during its creation. ### Method DELETE ### Endpoint /server/api/v1/documents/{documentId}/layers/{layerName} ### Parameters #### Path Parameters - **documentId** (string) - Required - The permanent ID of the document from which to delete the layer. - **layerName** (string) - Required - The name of the layer to delete. This layer name is given when creating a layer on the Document Engine. ### Response #### Success Response (204) - **NoContent** (object) - A response with no content, indicating successful deletion. #### Error Response (400, 404, 500) - **error** (object) - **type** (string) - The type of the error. - **message** (string) - The error message. ``` -------------------------------- ### Health Check API Source: https://www.nutrient.io/api/ai-assistant/index.html Endpoint to check the health status of the AI Assistant. ```APIDOC ## GET /health ### Description Performs a health check on the AI Assistant service. ### Method GET ### Endpoint /health ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - A response indicating the service is healthy. #### Error Response (500) - A response indicating the service is unhealthy. ### Request Example None ### Response Example ```json { "status": "healthy" } ``` ``` -------------------------------- ### DELETE /server/api/v1/sessions/{sessionId} Source: https://www.nutrient.io/api/ai-assistant/index.html Deletes all session data, including messages and metadata, for a specified Session ID. ```APIDOC ## DELETE /server/api/v1/sessions/{sessionId} ### Description Deletes all session data, including messages and metadata, for a specified Session ID. This action will remove the chat history for the given session. ### Method DELETE ### Endpoint /server/api/v1/sessions/{sessionId} ### Parameters #### Path Parameters - **sessionId** (string) - Required - The unique identifier for the session to be deleted. ### Response #### Success Response (204) - No content is returned upon successful deletion. #### Error Response (404, 500) - **error** (object) - Description of the error encountered. - **type** (string) - The type of the error. - **message** (string) - The error message. ``` -------------------------------- ### DELETE /server/api/v1/sessions/{sessionId} Source: https://www.nutrient.io/api/ai-assistant/index.html Deletes all session data for a specified Session ID, including messages and metadata, effectively removing the chat history. ```APIDOC ## DELETE /server/api/v1/sessions/{sessionId} ### Description 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. ### Method DELETE ### Endpoint /server/api/v1/sessions/{sessionId} ### Parameters #### Path Parameters - **sessionId** (string) - Required - The unique identifier for the session. This value is given as part of the AI Assistant configuration when initializing the Nutrient Web SDK. ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (204) - **No Content** - A response with no content. #### Error Responses - **404** - A type that represents an error response. - **500** - A type that represents an error response. #### Response Example ```json { "example": "{}" } ``` ``` -------------------------------- ### Delete Session API Source: https://www.nutrient.io/api/ai-assistant/index.html Deletes all session data for a given Session ID, including messages and metadata. Requires API authentication token and the session ID. Returns 204 on success, or 404/500 on error. ```HTTP DELETE /server/api/v1/sessions/{sessionId} ``` -------------------------------- ### DELETE /server/api/v1/documents/{documentId} Source: https://www.nutrient.io/api/ai-assistant/index.html Deletes all data associated with a specific document, including its layers, metadata, content, and AI-synthesized information. ```APIDOC ## DELETE /server/api/v1/documents/{documentId} ### Description 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. ### Method DELETE ### Endpoint /server/api/v1/documents/{documentId} ### Parameters #### Path Parameters - **documentId** (string) - Required - The ID of the document to delete. This ID is given when creating the document on the Document Engine. #### Query Parameters None #### Request Body None ### Response #### Success Response (204) - No content. #### Response Example (No content in response body) #### Error Response (400, 404, 500) - **error** (object) - **type** (string) - The type of the error. - **message** (string) - The error message. #### Response Example ```json { "error": { "type": "string", "message": "string" } } ``` ``` -------------------------------- ### DELETE /server/api/v1/documents/{documentId}/layers/{layerName} Source: https://www.nutrient.io/api/ai-assistant/index.html Deletes the data associated with a specific document layer, including metadata, content, and AI-synthesized information. ```APIDOC ## DELETE /server/api/v1/documents/{documentId}/layers/{layerName} ### Description 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. ### Method DELETE ### Endpoint /server/api/v1/documents/{documentId}/layers/{layerName} ### Parameters #### Path Parameters - **documentId** (string) - Required - The ID of the document to delete the layer from. This ID is given when creating the document on the Document Engine. - **layerName** (string) - Required - The name of the layer to delete. This layer name is given when creating a layer on the Document Engine. ### Responses #### Success Response (204) A response with no content. #### Error Responses - **400**: A type that represents an error response. - **404**: A type that represents an error response. - **500**: A type that represents an error response. ``` -------------------------------- ### DELETE /server/api/v1/documents/{documentId}/layers/{layerName} Source: https://www.nutrient.io/api/ai-assistant/index.html Deletes data associated with a specific layer of a document, including metadata, content, and AI-synthesized information. ```APIDOC ## DELETE /server/api/v1/documents/{documentId}/layers/{layerName} ### Description 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. ### Method DELETE ### Endpoint /server/api/v1/documents/{documentId}/layers/{layerName} ### Parameters #### Path Parameters - **documentId** (string) - Required - The ID of the document to delete the layer from. This ID is given when creating the document on the Document Engine. - **layerName** (string) - Required - The name of the layer to delete. #### Query Parameters None #### Request Body None ### Response #### Success Response (204) - No content. #### Response Example (No content in response body) #### Error Response (400, 404, 500) - **error** (object) - **type** (string) - The type of the error. - **message** (string) - The error message. #### Response Example ```json { "error": { "type": "string", "message": "string" } } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.