> For the complete documentation index, see [llms.txt](https://docs.mindplug.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mindplug.io/api/storing-data.md).

# Storing Data

### Prerequisites

Requires a user auth token. See the [API Auth](/api/api-setup-text.md) section.

### Storing data - API

For now Mindplug handles the storing of text data only. You can store data given the following parameters:&#x20;

1. Database name: `db`
2. A collection name: `collection`
3. An text string to generate embedding for: `content`
4. `Metadata` which is any arbitrary object for the content
5. OPTIONAL: `chunkSize`
   1. Defaults to 1024. Represents the amount of characters stored per embedding. If you give content size of 1300 characters, this will make 2 embeddings of 1k and 300 characters respectively.

Mindplug uses recursive chunking to chunk the string content. Thus the `chunkSize` will vary slightly across different embeddings.&#x20;

For any project or collection that does not already exist, it will be auto created for the user without any additional work.

{% code lineNumbers="true" %}

```javascript
import mindplug from "@/src/mindplugAPI"; // base instance

mindplug.post("/data/store", {
    db: "walmart",
    collection: "office supplies",
    content: "Premium eraser: an eraser that works on both pen and pencil and leaves no crumbs",
    metadata: {
        lastStock: "June 2023",
        totalItems: 123
    }
});
```

{% endcode %}

An upload id and a list of stored vector IDs are returned for later use.

### Sample Response

```json
{
    "data": {
        "success": true,
        "vectorIds": [
            "8ad610a8-9dc8-4e3c-bae4-0e10146fd43a"
        ],
        "uploadId": "ea209649-8f38-40e0-9b84-0cdb1809db6c"
    }
}
```
