Upsert Documents
This API allows you to upsert documents to a specific chatbot's namespace.
Generate your own API Key
The first thing you have to do to access Ollabot API, is by generating your own API Key. You can generate your API Key by following the steps here: Generate API Key.
Upsert Documents API Guide
The Upsert Documents API allows you to upload and process documents by making a POST request to the /api/v1/upsert-docs
endpoint using the user's API key.
Endpoint
POST https://app.ollabot.com/api/v1/upsert-docs
Request Headers
The API request must include the following headers:
- Authorization: Bearer
<Your-Secret-Key>
- The user's API key for authenticating the request. - Content-Type: multipart/form-data - The content type of the request payload.
Parameters
The request body should contain the following parameters:
- files (array of file, required): The list of files to be uploaded. Maximum of 3 files allowed.
- use_metadata (boolean, optional): Indicates if metadata extractors should be used. Default is
False
. - namespace (string, optional): The namespace to which the documents belong. If not provided, the
botId
will be used as the namespace. - botId (string, required): The unique identifier of the chatbot.
Example Request
JavaScript
Python
Shell
Response
The API response will be a JSON object with the following structure:
The message
field in the response contains details about the processing status and the number of nodes upserted to the Pinecone index and namespace.
Error Handling
If there are any errors during the API request, appropriate HTTP status codes will be returned along with error messages in the response body. Make sure to handle these errors gracefully in your application.