Skip to main content

Updating an Index

How to Update an Index

Updating an index in ConverseCart requires a few steps, including authentication and sending the correct file format. Follow these instructions to update your index.

Obtain an API Key

First, ensure you have an API key, which is required for authentication. You can obtain this key from your account settings on the ConverseCart platform.

Prepare the Index Update File

Ensure your file is ready for upload. This file should contain the updated data for your index. Supported formats include JSON, CSV, and XML. More coming soon.

Example JSON structure:

{
[
{ "id": "1", "title": "Document 1", "content": "Content of document 1" },
{ "id": "2", "title": "Document 2", "content": "Content of document 2" }
]
}

Make a POST Request to Update the Index

Using the API key and the file, make a POST request to the index update endpoint. Include the indexID to specify which index you want to update. You can do that using cURL, python or Node.js as shown below.

curl -X POST -H "API_KEY: YOUR_API_KEY" -F "indexID=YOUR_INDEX_ID" -F "file=@path_to_your_update_file" https://api.conversecart.com:8002/index/update

Note: Always ensure your API key is kept secure and never exposed in client-side code. Verify that your update file matches the required format and structure for your index.