# Add new text document to a Vector Store

{% openapi src="<https://2952947711-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyNqpTh7Mh66N0RnO0k24%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media&token=cbad765b-1613-4222-b591-9ae17a3b7cfa>" path="/vector-stores/{vector-store-id}/documents/create" method="post" %}
[rememberizer\_openapi.yml](https://2952947711-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyNqpTh7Mh66N0RnO0k24%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=cbad765b-1613-4222-b591-9ae17a3b7cfa)
{% endopenapi %}

## Example Requests

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

```bash
curl -X POST \
  https://api.rememberizer.ai/api/v1/vector-stores/vs_abc123/documents/create \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Product Overview",
    "text": "Our product is an innovative solution for managing vector embeddings. It provides seamless integration with your existing systems and offers powerful semantic search capabilities."
  }'
```

{% hint style="info" %}
Replace `YOUR_API_KEY` with your actual Vector Store API key and `vs_abc123` with your Vector Store ID.
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const addTextDocument = async (vectorStoreId, name, text) => {
  const response = await fetch(`https://api.rememberizer.ai/api/v1/vector-stores/${vectorStoreId}/documents/create`, {
    method: 'POST',
    headers: {
      'x-api-key': 'YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: name,
      text: text
    })
  });
  
  const data = await response.json();
  console.log(data);
};

addTextDocument(
  'vs_abc123',
  'Product Overview',
  'Our product is an innovative solution for managing vector embeddings. It provides seamless integration with your existing systems and offers powerful semantic search capabilities.'
);
```

{% hint style="info" %}
Replace `YOUR_API_KEY` with your actual Vector Store API key and `vs_abc123` with your Vector Store ID.
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def add_text_document(vector_store_id, name, text):
    headers = {
        "x-api-key": "YOUR_API_KEY",
        "Content-Type": "application/json"
    }
    
    payload = {
        "name": name,
        "text": text
    }
    
    response = requests.post(
        f"https://api.rememberizer.ai/api/v1/vector-stores/{vector_store_id}/documents/create",
        headers=headers,
        data=json.dumps(payload)
    )
    
    data = response.json()
    print(data)

add_text_document(
    'vs_abc123',
    'Product Overview',
    'Our product is an innovative solution for managing vector embeddings. It provides seamless integration with your existing systems and offers powerful semantic search capabilities.'
)
```

{% hint style="info" %}
Replace `YOUR_API_KEY` with your actual Vector Store API key and `vs_abc123` with your Vector Store ID.
{% endhint %}
{% endtab %}
{% endtabs %}

## Path Parameters

| Parameter       | Type   | Description                                                      |
| --------------- | ------ | ---------------------------------------------------------------- |
| vector-store-id | string | **Required.** The ID of the vector store to add the document to. |

## Request Body

```json
{
  "name": "Product Overview",
  "text": "Our product is an innovative solution for managing vector embeddings. It provides seamless integration with your existing systems and offers powerful semantic search capabilities."
}
```

| Parameter | Type   | Description                                     |
| --------- | ------ | ----------------------------------------------- |
| name      | string | **Required.** The name of the document.         |
| text      | string | **Required.** The text content of the document. |

## Response Format

```json
{
  "id": 1234,
  "name": "Product Overview",
  "type": "text/plain",
  "vector_store": "vs_abc123",
  "size": 173,
  "status": "processing",
  "processing_status": "queued",
  "indexed_on": null,
  "status_error_message": null,
  "created": "2023-06-15T10:15:00Z",
  "modified": "2023-06-15T10:15:00Z"
}
```

## Authentication

This endpoint requires authentication using an API key in the `x-api-key` header.

## Error Responses

| Status Code | Description                                             |
| ----------- | ------------------------------------------------------- |
| 400         | Bad Request - Missing required fields or invalid format |
| 401         | Unauthorized - Invalid or missing API key               |
| 404         | Not Found - Vector Store not found                      |
| 500         | Internal Server Error                                   |

This endpoint allows you to add text content directly to your vector store. It's particularly useful for storing information that might not exist in file format, such as product descriptions, knowledge base articles, or custom content. The text will be automatically processed into vector embeddings, making it searchable using semantic similarity.
