# Store File in Vector Database

## Parse File

Use this endpoint to add a PDF, CSV, TXT or DOC/DOCX document to the Qolaba AI database. The API will parse the document and store it in the vector database, returning a unique ID that can be used to retrieve information from the document using the Large Language Model (LLM).

Please note the following guidelines when indexing Document:

* The PDF, DOC/DOCX file should not exceed 200 pages.
* The CSV file should not contain more than 30 columns and 500 rows.
* When uploading a CSV file to the API, the first row must contain the column names. This helps the Large Language Model (LLM) better understand the values in each row of the CSV file.&#x20;
* Ensure that the document does not contain any sensitive or confidential information.

The unique ID returned after indexing the document can be used in subsequent requests to the Chatbot API to retrieve relevant information from the document, after ensuring enable\_tool and search\_doc to be true.

<br>

<mark style="color:green;">`POST`</mark> `/pdfVectorStore`

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

| Name  | Type   | Description                                                          |
| ----- | ------ | -------------------------------------------------------------------- |
| `url` | string | The `url` parameter specifies the URL of the document to be indexed. |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "output": null, 
  "error": null, 
  "error_data": null
}
```

{% endtab %}

{% tab title="500" %}

```json
{
  "output": null, 
  "error": string, 
  "error_data": string
}
```

{% endtab %}
{% endtabs %}

Upon successfully indexing a document, the API will return a response with the unique identifier of the indexed document in `output` parameter.

You can use the unique identifier in subsequent requests to the Chat API to retrieve information from the indexed PDF.

## Run the API

To test this API, please use the following link:

{% embed url="<https://app.theneo.io/api-runner/qolaba/ml-apis/api-reference/store-file-in-vector-database>" %}
