> For the complete documentation index, see [llms.txt](https://docs.rememberizer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rememberizer.ai/es/recursos-para-desarrolladores/api-docs/vector-store/add-new-text-document-to-a-vector-store.md).

# Agregar nuevo documento de texto a un Almacén de Vectores

{% openapi src="/files/5V7ybptH1vsfKadO6dio" path="/vector-stores/{vector-store-id}/documents/create" method="post" %}
[rememberizer\_openapi.yml](https://983989491-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeFTiuIsKOMpUEE73g7bP%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=03079f98-60fe-4914-9e1b-443e008fd108)
{% endopenapi %}

## Ejemplos de Solicitudes

{% 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": "Descripción del Producto",
    "text": "Nuestro producto es una solución innovadora para gestionar incrustaciones vectoriales. Proporciona una integración fluida con sus sistemas existentes y ofrece potentes capacidades de búsqueda semántica."
  }'
```

{% hint style="info" %}
Reemplace `YOUR_API_KEY` con su clave API real de Vector Store y `vs_abc123` con su ID de Vector Store.
{% 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',
  'Descripción del Producto',
  'Nuestro producto es una solución innovadora para gestionar incrustaciones vectoriales. Proporciona una integración fluida con sus sistemas existentes y ofrece potentes capacidades de búsqueda semántica.'
);
```

{% hint style="info" %}
Reemplace `YOUR_API_KEY` con su clave API real de Vector Store y `vs_abc123` con su ID de Vector Store.
{% 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',
    'Descripción del Producto',
    'Nuestro producto es una solución innovadora para gestionar incrustaciones vectoriales. Proporciona una integración fluida con sus sistemas existentes y ofrece potentes capacidades de búsqueda semántica.'
)
```

{% hint style="info" %}
Reemplace `YOUR_API_KEY` con su clave API real de Vector Store y `vs_abc123` con su ID de Vector Store.
{% endhint %}
{% endtab %}
{% endtabs %}

## Parámetros de Ruta

| Parámetro       | Tipo   | Descripción                                                                  |
| --------------- | ------ | ---------------------------------------------------------------------------- |
| vector-store-id | string | **Requerido.** El ID del almacén de vectores al que se añadirá el documento. |

## Cuerpo de la Solicitud

```json
{
  "name": "Descripción del Producto",
  "text": "Nuestro producto es una solución innovadora para gestionar incrustaciones vectoriales. Proporciona una integración fluida con sus sistemas existentes y ofrece potentes capacidades de búsqueda semántica."
}
```

| Parámetro | Tipo   | Descripción                                         |
| --------- | ------ | --------------------------------------------------- |
| name      | string | **Requerido.** El nombre del documento.             |
| text      | string | **Requerido.** El contenido de texto del documento. |

## Formato de Respuesta

```json
{
  "id": 1234,
  "name": "Descripción del Producto",
  "type": "text/plain",
  "vector_store": "vs_abc123",
  "size": 173,
  "status": "procesando",
  "processing_status": "en cola",
  "indexed_on": null,
  "status_error_message": null,
  "created": "2023-06-15T10:15:00Z",
  "modified": "2023-06-15T10:15:00Z"
}
```

## Autenticación

Este endpoint requiere autenticación utilizando una clave API en el encabezado `x-api-key`.

## Respuestas de Error

| Código de Estado | Descripción                                                        |
| ---------------- | ------------------------------------------------------------------ |
| 400              | Solicitud Incorrecta - Faltan campos requeridos o formato inválido |
| 401              | No Autorizado - Clave API inválida o faltante                      |
| 404              | No Encontrado - Almacén de Vectores no encontrado                  |
| 500              | Error Interno del Servidor                                         |

Este endpoint te permite agregar contenido de texto directamente a tu almacén de vectores. Es particularmente útil para almacenar información que podría no existir en formato de archivo, como descripciones de productos, artículos de base de conocimientos o contenido personalizado. El texto se procesará automáticamente en incrustaciones vectoriales, lo que lo hará buscable utilizando similitud semántica.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.rememberizer.ai/es/recursos-para-desarrolladores/api-docs/vector-store/add-new-text-document-to-a-vector-store.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
