-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathai.openapi.json
More file actions
1 lines (1 loc) · 35.8 KB
/
Copy pathai.openapi.json
File metadata and controls
1 lines (1 loc) · 35.8 KB
1
{"openapi":"3.0.3","info":{"title":"RAG Management API","description":"This documentation provides a comprehensive description of the API for managing Retrieval-Augmented Generation (RAG) systems. Through the APIs, it is possible to create a RAG, retrieve its details, initiate file indexing, and delete it. It is also possible to view all of a user's RAGs. Furthermore, the APIs allow for document management, enabling the upload of both text documents and images. Additionally, metadata can be specified for each document to filter search queries. The service's three main endpoints are dedicated to querying the RAG. These endpoints allow users to submit queries and receive responses that combine the power of generative models (LLMs) with specific knowledge extracted from the indexed documents.","version":"1.4.0","termsOfService":"https://openapi.it/en/terms-and-conditions","contact":{"url":"https://openapi.it/en/support","name":"Support"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"servers":[{"url":"https://ai.openapi.com","description":"Production"},{"url":"https://test.ai.openapi.com","description":"Sandbox"}],"tags":[{"name":"RAG","description":"Endpoints related to the lifecycle management of RAG."},{"name":"Documents","description":"Endpoints for managing individual documents within a RAG."},{"name":"Search","description":"Endpoints dedicated to querying and searching for information within the RAG."}],"paths":{"/rag":{"get":{"tags":["RAG"],"summary":"Retrieve a list of RAG","description":"Retrieves a paginated list of all RAG for the authenticated user.","parameters":[{"name":"skip","in":"query","description":"Optional. Number of items to skip for pagination. If not specified, the default value is 0.","required":false,"schema":{"type":"integer","example":0}},{"name":"limit","in":"query","description":"Optional. Maximum number of items to return. If not specified, the default value is 100.","required":false,"schema":{"type":"integer","example":100}}],"responses":{"200":{"description":"A list of RAG.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RAG"}},"success":{"type":"boolean","description":"Operation success (true/false)."},"message":{"type":"string","description":"error message","example":""},"error":{"type":"integer","description":"error code","example":null}}}}}}}},"post":{"tags":["RAG"],"summary":"Create a new RAG","description":"Creates a new, empty RAG for the authenticated user. A maximum of 10 RAGs can be created per user. Should you require more, please reach out to support for assistance.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RAGCreate"}}}},"responses":{"200":{"description":"RAG created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RAGCreated"},"success":{"type":"boolean","description":"Operation success (true/false)."},"message":{"type":"string","description":"error message","example":""},"error":{"type":"integer","description":"error code","example":null}}}}}},"409":{"description":"Conflict, e.g., a RAG with this ID or name already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorRagConflict"}}}},"422":{"description":"Validation error on the submitted data (e.g., missing name, invalid options).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}},"/rag/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the RAG.","schema":{"type":"string","format":"objectid"}}],"get":{"tags":["RAG"],"summary":"Get RAG details","description":"Retrieves the full details of a single RAG by its ID.","responses":{"200":{"description":"RAG details.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RAGCreated"},"success":{"type":"boolean","description":"Operation success (true/false)."},"message":{"type":"string","description":"error message","example":""},"error":{"type":"integer","description":"error code","example":null}}}}}},"403":{"description":"The Rag ID does not belong to the authenticated user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorAuth"}}}},"404":{"description":"RAG not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}}},"422":{"description":"Validation error returned by the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}},"patch":{"tags":["RAG"],"summary":"Start RAG indexing","description":"Starts the indexing process for a specific RAG. This will process any files pending upload or deletion.","requestBody":{"description":"Requires `startIndexing` to be set to `true` to initiate the process.","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"startIndexing":{"type":"boolean","description":"Must be true to start indexing.","example":true}},"required":["startIndexing"]}}}},"responses":{"200":{"description":"Indexing started.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RAGIndexing"},"success":{"type":"boolean","description":"Operation success (true/false)."},"message":{"type":"string","description":"error message","example":""},"error":{"type":"integer","description":"error code","example":null}}}}}},"400":{"description":"Bad Request, e.g., database error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDB"}}}},"404":{"description":"RAG with this identifier not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}}},"409":{"description":"The RAG is already indexing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorIndexing"}}}},"422":{"description":"Validation error returned by the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"428":{"description":"Precondition Failed. Validation Error, e.g., startIndexing is not `true` or the RAG is not in a 'ready' state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}},"delete":{"tags":["RAG"],"summary":"Delete a RAG","description":"Deletes an entire RAG and all its associated documents. Requires explicit confirmation in the request body.","parameters":[{"name":"id","in":"path","required":true,"description":"ID of the RAG to delete.","schema":{"type":"string","format":"objectid"}},{"name":"deleteEntireRag","in":"query","required":false,"description":"Set to `true` to confirm the permanent deletion of the RAG and all data within it.","schema":{"type":"boolean","description":"Set to `true` to confirm the permanent deletion of the RAG and all data within it.","default":false,"title":"Confirm Full Deletion"}}],"responses":{"200":{"description":"RAG deleted successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"items":{},"type":"array","example":[]},"success":{"type":"boolean","description":"Operation success (true/false).","example":true},"message":{"type":"string","description":"error message","example":"The RAG with ID 68947e1e0dab7e743108abfb and all associated files have been deleted."},"error":{"type":"integer","description":"error code","example":null}}}}}},"400":{"description":"Bad Request, e.g., 'confirm_full_deletion' parameter is missing or false.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"RAG with this identifier not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}}},"422":{"description":"Unexpected error received from server.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUnexpectedAPI"}}}},"428":{"description":"Precondition Failed. Validation error on the submitted data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}},"/rag/{id}/documents":{"get":{"tags":["Documents"],"summary":"List documents in a RAG","description":"Retrieves a paginated list of document within a specific RAG.","parameters":[{"name":"id","in":"path","required":true,"description":"ID of the RAG.","schema":{"type":"string","format":"objectid"}},{"name":"skip","in":"query","description":"Optional. Number of items to skip for pagination. If not specified, the default value is 0.","required":false,"schema":{"type":"integer","example":0}},{"name":"limit","in":"query","description":"Optional. Maximum number of items to return. If not specified, the default value is 100.","required":false,"schema":{"type":"integer","example":100}}],"responses":{"200":{"description":"A list of document.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DocumentListInfo"}},"success":{"type":"boolean","description":"Operation success (true/false)."},"message":{"type":"string","description":"error message","example":""},"error":{"type":"integer","description":"error code","example":null}}}}}},"404":{"description":"The Rag ID does not exist in the database","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}}}}},"post":{"tags":["Documents"],"summary":"Upload a document","description":"Uploads a file by sending its content as a base64 encoded string in a JSON body.","parameters":[{"name":"id","in":"path","required":true,"description":"ID of the RAG where the document will be uploaded.","schema":{"type":"string","format":"objectid"}}],"requestBody":{"description":"Uploads a document. The server validates the file content. Only the following MIME types are permitted:\n\n* `image/png`\n* `application/pdf`\n* `text/plain`\n* `text/html`\n* `application/json`\n* `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)\n* `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` (XLSX)\n* `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)\n\nThe server will return a 415 error if the type is not supported.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"responses":{"200":{"description":"Document saved successfully. The file is now pending indexing.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"success":{"type":"boolean","description":"Operation success (true/false)."},"message":{"type":"string","description":"error message","example":""},"error":{"type":"integer","description":"error code","example":null}}}}}},"400":{"description":"Bad Request, e.g., invalid JSON metadata provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The Rag ID does not exist in the database.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}}},"409":{"description":"File ID already exists or RAG is indexing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorIndexing"}}}},"413":{"description":"The document size is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SizeError"}}}},"415":{"description":"Unsupported Media Type. The document's MIME type is not allowed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MimeTipeError"}}}},"422":{"description":"Validation error returned by the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"428":{"description":"Precondition Failed. Validation error on the submitted data (e.g., invalid base64, missing fields).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}},"/rag/{id}/documents/{fileId}":{"delete":{"tags":["Documents"],"summary":"Delete a single document","description":"Deletes a single document from a RAG. If the RAG is busy, the file is scheduled for deletion.","parameters":[{"name":"id","in":"path","required":true,"description":"ID of the RAG.","schema":{"type":"string","format":"objectid"}},{"name":"fileId","in":"path","required":true,"description":"ID of the file to delete.","schema":{"type":"string","format":"objectid"}}],"responses":{"200":{"description":"RAG deleted successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"items":{},"type":"array","example":[]},"success":{"type":"boolean","description":"Operation success (true/false).","example":true},"message":{"type":"string","description":"error message","example":"The file with ID 689af360b0ef3bdb09019770 has been deleted"},"error":{"type":"integer","description":"error code","example":null}}}}}},"404":{"description":"File or RAG not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}}},"422":{"description":"Validation error returned by the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}},"/rag-search":{"post":{"tags":["Search"],"summary":"Perform a simple search","description":"Performs a search query within a RAG and returns the relevant document snippets.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchQuery"}}}},"responses":{"200":{"description":"Search results containing snippets.","content":{"application/json":{"schema":{"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Search"}},"success":{"type":"boolean","description":"Operation success (true/false)."},"message":{"type":"string","description":"error message","example":""},"error":{"type":"integer","description":"error code","example":null}}}}}},"400":{"description":"Bad Request, e.g., invalid metadata filter syntax.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInvalidFilter"}}}},"403":{"description":"Invalid Rag ID for the current user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUser"}}}},"404":{"description":"RAG with this identifier not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}}},"422":{"description":"Validation error returned by the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"428":{"description":"Precondition Failed. Validation Error, e.g., missing query or invalid maxLen.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}},"/rag-search-with-answer":{"post":{"tags":["Search"],"summary":"Perform a search with a generated answer","description":"Performs a query, retrieves relevant documents, and generates a natural language answer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchAnswerQuery"}}}},"responses":{"200":{"description":"Generated answer and the source search results.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SearchAnswer"},"success":{"type":"boolean","description":"Operation success (true/false)."},"message":{"type":"string","description":"error message","example":""},"error":{"type":"integer","description":"error code","example":null}}}}}},"400":{"description":"Bad Request, e.g., invalid metadata filter syntax.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInvalidFilter"}}}},"403":{"description":"Invalid Rag ID for the current user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUser"}}}},"404":{"description":"RAG with this identifier not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}}},"422":{"description":"Validation error returned by the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"428":{"description":"Precondition Failed. Validation Error, e.g., missing query or invalid maxLen.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}},"/rag-conversation":{"post":{"tags":["Search"],"summary":"Perform a conversational search","description":"Performs a query that takes into account the history of a conversation to provide contextualized answers.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationQuery"}}}},"responses":{"200":{"description":"Conversational response, including the answer and the updated session ID.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SearchConversation"},"success":{"type":"boolean","description":"Operation success (true/false)."},"message":{"type":"string","description":"error message","example":""},"error":{"type":"integer","description":"error code","example":null}}}}}},"400":{"description":"Bad Request, e.g., invalid metadata filter syntax.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInvalidFilter"}}}},"401":{"description":"Unauthorized. The provided session ID is invalid or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInvalidSession"}}}},"403":{"description":"Invalid Rag ID for the current user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorUser"}}}},"404":{"description":"RAG with this identifier not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorNotFound"}}}},"422":{"description":"Validation error returned by the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"428":{"description":"Precondition Failed. Validation Error, e.g., missing query or invalid maxLen.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}}},"components":{"schemas":{"RAG":{"type":"object","description":"Represents a RAG.","properties":{"id":{"type":"string","description":"Unique ID of the RAG.","example":"68947e1e0dab7e743108abfb"},"name":{"type":"string","description":"User-defined name for the RAG.","example":"RAGTest"},"state":{"type":"string","description":"Current state of the RAG (e.g., 'ready', 'indexing').","example":"ready"},"options":{"$ref":"#/components/schemas/RAGOptions"},"totalDocuments":{"type":"integer","description":"Total number of documents uploaded to the RAG."},"totalIndexedDocuments":{"type":"integer","description":"Number of documents that have been successfully indexed."},"sizeByte":{"type":"number","format":"float","description":"Total size of all documents in the RAG, in bytes."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when the RAG was created."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of the last update."},"indexedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of the last indexed."}}},"RAGCreated":{"type":"object","description":"Represents a RAG.","properties":{"id":{"type":"string","description":"Unique ID of the RAG.","example":"68947e1e0dab7e743108abfb"},"name":{"type":"string","description":"User-defined name for the RAG.","example":"RAGTest"},"state":{"type":"string","description":"Current state of the RAG (e.g., 'ready', 'indexing').","example":"ready"},"options":{"$ref":"#/components/schemas/RAGOptions"},"totalDocuments":{"type":"integer","description":"Total number of documents uploaded to the RAG."},"totalIndexedDocuments":{"type":"integer","description":"Number of documents that have been successfully indexed."},"sizeByte":{"type":"number","format":"float","description":"Total size of all documents in the RAG, in bytes."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when the RAG was created."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of the last update."},"indexedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when the content was last successfully indexed."},"callback":{"$ref":"#/components/schemas/Callback"}}},"RAGIndexing":{"type":"object","description":"Represents a RAG.","properties":{"id":{"type":"string","description":"Unique ID of the RAG.","example":"68947e1e0dab7e743108abfb"},"name":{"type":"string","description":"User-defined name for the RAG.","example":"RAGTest"},"state":{"type":"string","description":"Current state of the RAG (e.g., 'ready', 'indexing').","example":"indexing"},"options":{"$ref":"#/components/schemas/RAGOptions"},"totalDocuments":{"type":"integer","description":"Total number of documents uploaded to the RAG."},"totalIndexedDocuments":{"type":"integer","description":"Number of documents that have been successfully indexed."},"sizeByte":{"type":"number","format":"float","description":"Total size of all documents in the RAG, in bytes."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when the RAG was created."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of the last update."},"callback":{"$ref":"#/components/schemas/Callback"}}},"RAGOptions":{"type":"object","description":"Configuration options for a RAG.","properties":{"ocr":{"type":"boolean","description":"If true, enables Optical Character Recognition on documents.","default":false},"autoIndexingIntervalHours":{"type":"integer","description":"Interval in hours for automatic re-indexing. 0 means disabled.","default":0}}},"Callback":{"type":"object","description":"Configuration for event notifications. Can be `false` if not set.","properties":{"method":{"type":"string","description":"Indicate through which method you want to receive data with the callback, by default it is POST","enum":["POST","JSON"]},"field":{"type":"string","description":"Name of the field containing the callback return data"},"url":{"type":"string","description":"Url where the callback call will be made","example":"https://www.mysite.it/callback.php"},"data":{"type":"object","description":"Object to be completed at your convenience with additional data that you can use back with the callback"}}},"RAGCreate":{"type":"object","description":"Schema for creating a new RAG.","required":["name"],"properties":{"name":{"type":"string","description":"Name for the new RAG.","example":"RAGTest"},"options":{"$ref":"#/components/schemas/RAGOptions"},"callback":{"$ref":"#/components/schemas/Callback"}}},"Document":{"type":"object","description":"Represents a document's metadata within a RAG.","properties":{"id":{"type":"string","description":"Unique ID of the document.","example":"6894aa2e0dab7e743108ac02"},"name":{"type":"string","description":"The original filename of the document.","example":"First Document"},"state":{"type":"string","description":"The current state of the document (e.g., 'wait', 'ready', 'to_remove', 'to_index').","example":"to_index"},"metadata":{"$ref":"#/components/schemas/Metadata"},"sizeByte":{"type":"number","format":"float","description":"Size of the document in byte","example":43536},"mimeType":{"type":"string","description":"The detected MIME type of the document (e.g., 'application/pdf').","example":"application/pdf"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when the document was created."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of the last update."},"paymentDueDate":{"type":"string","format":"date-time","description":"Timestamp indicating when the next storage payment is due."}}},"DocumentListInfo":{"type":"object","description":"Represents a document's metadata within a RAG.","properties":{"id":{"type":"string","description":"Unique ID of the document.","example":"6894aa2e0dab7e743108ac02"},"name":{"type":"string","description":"The original filename of the document.","example":"First Document"},"state":{"type":"string","description":"The current state of the document (e.g., 'wait', 'ready', 'to_remove', 'to_index').","example":"to_index"},"metadata":{"$ref":"#/components/schemas/Metadata"},"sizeByte":{"type":"number","format":"float","description":"Size of the document in bytes.","example":525225},"mimeType":{"type":"string","description":"The detected MIME type of the document (e.g., 'application/pdf').","example":"application/pdf"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when the document was created."},"paymentDueDate":{"type":"string","format":"date-time","description":"Timestamp indicating when the next storage payment is due."}}},"DocumentUpload":{"type":"object","description":"Schema for uploading a new document.","required":["fileName","fileContent"],"properties":{"fileName":{"type":"string","description":"The name of the file being uploaded.","example":"documentTest"},"fileContent":{"type":"string","format":"byte","description":"The base64 encoded content of the file.","example":"JVBERi0xLjQNCiX15Pb8DQoNCjkgMCBvYmoNCjw8DQovVHlwZSAvWE9iamVjdA0KL1N1YnR5cGUg...."},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"Metadata":{"type":"object","description":"A flexible object for custom metadata. Keys must match the defined custom types.","properties":{"customKeyStr":{"type":"string","description":"A custom string value."},"customKeyDate":{"type":"string","format":"date-time","description":"A custom date-time value in ISO 8601 format."},"customKeyInt":{"type":"integer","description":"A custom integer value."},"customKeyGeoLatitude":{"type":"number","description":"A geographic latitude value."},"customKeyGeoLongitude":{"type":"number","description":"A geographic longitude value."},"customKeyBool":{"type":"boolean","description":"A custom boolean value."}}},"SearchQuery":{"type":"object","description":"Schema for performing a search query.","required":["ragId","query","maxLen"],"properties":{"ragId":{"type":"string","description":"The ID of the RAG to perform the search on.","example":"688b2ab3bccc6a603202f87c"},"query":{"type":"string","description":"The text of the search query.","example":"che servizi ci sono?"},"maxLen":{"type":"integer","description":"The maximum number of results to return from the search.","example":5,"maximum":10},"metadataFilter":{"type":"string","description":"Allows filtering search results using a simplified syntax.\n\n**1. Available Keys:**\n`customKeyStr` (Text)\n`customKeyInt` (Integer)\n`customKeyDate` (Date)\n`customKeyBool` (Boolean)\n`customKeyGeoLatitude` (Number)\n`customKeyGeoLongitude` (Number)\n\n**2. Logical Operators:**\nUse `AND`, `OR`. Group with `()`.\n\n**3. Comparison Operators:**\n`=` (Equals)\n`!=` (Not equals)\n`>`, `<`, `>=`, `<=` (Only for `customKeyInt` and `customKeyDate`)\n\n**4. Values:**\n- **Text:** `value` (unquoted) or `\"value with spaces\"` (quoted).\n- **Boolean:** `true` or `false`.\n- **Date:** ISO 8601 string (e.g., `2025-10-31T23:59:59Z`).\n\n**5. Negation:**\nUse `!=` or the `-` prefix (e.g., `-(customKeyBool = true)`).\n\n**Example:**\n`(customKeyInt > 10 AND customKeyStr != \"exclude\") OR customKeyDate < 2025-01-01T00:00:00Z`","example":"(customKeInt<175 AND customKeyBool = \"true\") OR (customKeyInt<125 AND customKeyBool = \"false\")"}}},"SearchAnswerQuery":{"description":"Performs a search based on a natural language question and specifies the desired format for the answer.","allOf":[{"$ref":"#/components/schemas/SearchQuery"},{"type":"object","properties":{"settings":{"type":"object","properties":{"promptStyle":{"type":"string","description":"The style of prompt to use for generation.","default":"basic","enum":["empty","basic","brief","technical","non-technical","list-format"]},"answerFormat":{"type":"string","description":"Specifies the response format.","enum":["html","markdown"],"default":"markdown"}}}}}]},"ConversationQuery":{"description":"Extends a standard search query with a session ID for conversational context.","allOf":[{"$ref":"#/components/schemas/SearchQuery"},{"type":"object","properties":{"session":{"type":"string","description":"Session ID from a previous conversational response to maintain context."},"settings":{"type":"object","properties":{"promptStyle":{"type":"string","description":"The style of prompt to use for generation.","default":"basic","enum":["empty","basic","brief","technical","non-technical","list-format"]},"answerFormat":{"type":"string","description":"Specifies the response format.","enum":["html","markdown"],"default":"markdown"}}}}}]},"Search":{"type":"object","description":"Un singolo risultato di ricerca.","properties":{"snippets":{"type":"array","items":{"type":"string"},"description":"A list of relevant text excerpts from the searched documents.","example":"... service allows you to ascertain in real time whether any car is insured, with which company and any policy expiry date. All via API SIGN UP FREE ..."},"id":{"type":"string","description":"The ID of the matching document.","example":"689c70313f292734010a7dda"},"ragId":{"type":"string","description":"The ID of the RAG.","example":"689c6ed7b283ac0aa40c1555"},"name":{"type":"string","description":"The name of the matching document.","example":"documentTest"},"state":{"type":"string","description":"The state of the matching document.","example":"indexing"},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"SearchResult":{"type":"array","description":"A list of search results, where each item corresponds to a matching document.","items":{"type":"object","properties":{"index":{"type":"integer","description":"Reference index in the response"},"snippets":{"type":"array","items":{"type":"string"},"description":"A list of relevant text excerpts from the searched documents","example":"HomeProductsCompany Balance Sheet - Italy DOCUMENT EXAMPLE Company Balance Sheet - Italy..."},"id":{"type":"string","description":"The ID of the matching document.","example":"689c70313f292734010a7dda"},"ragId":{"type":"string","description":"The ID of the RAG.","example":"689c6ed7b283ac0aa40c1555"},"name":{"type":"string","description":"The name of the matching document.","example":"documentTest"},"state":{"type":"string","description":"The state of the matching document.","example":"indexing"},"metadata":{"$ref":"#/components/schemas/Metadata"}}}},"SearchAnswer":{"type":"object","description":"A response containing a generated answer and its source documents.","properties":{"answer":{"type":"string","description":"The natural language answer generated by the AI.","example":"Per richiedere un bilancio, è necessario il numero di partita IVA o il codice fiscale della società.[0]...."},"searchResult":{"$ref":"#/components/schemas/SearchResult"}}},"SearchConversation":{"type":"object","description":"Performs a search query within an existing conversation, using a session ID to maintain the context of previous questions and answers.","allOf":[{"$ref":"#/components/schemas/SearchAnswer"},{"type":"object","properties":{"session":{"type":"string","description":"The updated session ID to be used in the next turn of the conversation.","example":"14709352892326605"}}}]},"Error":{"type":"object","description":"A generic error response.","properties":{"success":{"type":"boolean","description":"Operation success (true/false).","example":false},"message":{"type":"string","description":"error message","example":"Internal Server Error"},"error":{"type":"integer","description":"error code","example":422}}},"ErrorIndexing":{"type":"object","description":"RAG indexing error response","properties":{"success":{"type":"boolean","description":"Operation success (true/false).","example":false},"message":{"type":"string","description":"error message","example":"Indexing is already in progress for this RAG."},"error":{"type":"integer","description":"error code","example":409}}},"ErrorAuth":{"type":"object","description":"Authentication error response.","properties":{"success":{"type":"boolean","description":"Operation success (true/false).","example":false},"message":{"type":"string","description":"error message","example":"The Rag ID does not belong to the authenticated user"},"error":{"type":"integer","description":"error code","example":229}}},"ErrorNotFound":{"type":"object","description":"File not found response.","properties":{"success":{"type":"boolean","description":"Operation success (true/false).","example":false},"message":{"type":"string","description":"error message","example":"Id not valid"},"error":{"type":"integer","description":"error code","example":222}}},"ErrorUser":{"type":"object","description":"RAG permission error response","properties":{"success":{"type":"boolean","description":"Operation success (true/false).","example":false},"message":{"type":"string","description":"error message","example":"The Rag ID does not belong to the authenticated user."},"error":{"type":"integer","description":"error code","example":229}}},"SizeError":{"type":"object","description":"File size error response.","properties":{"success":{"type":"boolean","description":"Operation success (true/false).","example":false},"message":{"type":"string","description":"error message","example":"The document size is too large."},"error":{"type":"integer","description":"error code","example":307}}},"MimeTipeError":{"type":"object","description":"Unsupported MIME type response","properties":{"success":{"type":"boolean","description":"Operation success (true/false).","example":false},"message":{"type":"string","description":"error message","example":"The document MIME type is not supported."},"error":{"type":"integer","description":"error code","example":308}}},"ValidationError":{"type":"object","description":"Data validation error response","properties":{"success":{"type":"boolean","description":"Operation success (true/false).","example":false},"message":{"type":"string","description":"error message","example":"RAG ID required"},"error":{"type":"integer","description":"error code","example":200}}},"ErrorToken":{"type":"object","description":"Error related to authentication token generation.","properties":{"success":{"type":"boolean","description":"Operation success (true/false).","example":false},"message":{"type":"string","description":"error message","example":"Token creation error"},"error":{"type":"integer","description":"error code","example":214}}},"ErrorDB":{"type":"object","description":"Error during a database operation.","properties":{"success":{"type":"boolean","description":"Operation success (true/false).","example":false},"message":{"type":"string","description":"error message","example":"Database error while fetching Rag status."},"error":{"type":"integer","description":"error code","example":227}}},"ErrorInvalidFilter":{"type":"object","description":"Bad Request, e.g., invalid metadata filter syntax.","properties":{"success":{"type":"boolean","description":"Operation success (true/false).","example":false},"message":{"type":"string","description":"error message","example":"Invalid metadata filter syntax."},"error":{"type":"integer","description":"error code","example":358}}},"ErrorInvalidSession":{"type":"object","description":"Invalid session error response.","properties":{"success":{"type":"boolean","description":"Operation success (true/false).","example":false},"message":{"type":"string","description":"error message","example":"Invalid session provided."},"error":{"type":"integer","description":"error code","example":350}}},"ErrorRagConflict":{"type":"object","description":"Conflict error, e.g., RAG ID already exists.","properties":{"success":{"type":"boolean","description":"Operation success (true/false).","example":false},"message":{"type":"string","description":"error message","example":"Rag with this identifier already exists."},"error":{"type":"integer","description":"error code","example":301}}},"ErrorUnexpectedAPI":{"type":"object","description":"Unexpected error received from server.","properties":{"success":{"type":"boolean","description":"Operation success (true/false).","example":false},"message":{"type":"string","description":"error message","example":"Unexpected error received from server."},"error":{"type":"integer","description":"error code","example":303}}}}},"externalDocs":{"description":"First time here? Generate a new access token","url":"https://console.openapi.com/oauth"},"security":[{"bearerAuth":[]}]}