# Aggiorna il contenuto del file in un Archivio Vettoriale

{% openapi src="/files/TgprWtaxn0x1jf4BJIMN" path="/vector-stores/{vector-store-id}/documents/{document-id}/" method="patch" %}
[rememberizer\_openapi.yml](https://2549770777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F57qWu8jBt3M3SWmz6Y83%2Fuploads%2Fgit-blob-4f45581f68048634d677b5e3d260a677eeb0242f%2Frememberizer_openapi.yml?alt=media\&token=7f673453-89b5-4d08-beab-3fb44863de41)
{% endopenapi %}

## Esempi di Richieste

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

```bash
curl -X PATCH \
  https://api.rememberizer.ai/api/v1/vector-stores/vs_abc123/documents/1234/ \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Panoramica del Prodotto Aggiornata"
  }'
```

{% hint style="info" %}
Sostituisci `YOUR_API_KEY` con la tua reale chiave API del Vector Store, `vs_abc123` con il tuo ID del Vector Store e `1234` con l'ID del documento.
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

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

updateDocument('vs_abc123', 1234, 'Panoramica del Prodotto Aggiornata');
```

{% hint style="info" %}
Sostituisci `YOUR_API_KEY` con la tua reale chiave API del Vector Store, `vs_abc123` con il tuo ID del Vector Store e `1234` con l'ID del documento.
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

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

update_document('vs_abc123', 1234, 'Panoramica del Prodotto Aggiornata')
```

{% hint style="info" %}
Sostituisci `YOUR_API_KEY` con la tua reale chiave API del Vector Store, `vs_abc123` con il tuo ID del Vector Store e `1234` con l'ID del documento.
{% endhint %}
{% endtab %}
{% endtabs %}

## Parametri del percorso

| Parametro       | Tipo    | Descrizione                                                       |
| --------------- | ------- | ----------------------------------------------------------------- |
| vector-store-id | string  | **Obbligatorio.** L'ID del vettore store contenente il documento. |
| document-id     | integer | **Obbligatorio.** L'ID del documento da aggiornare.               |

## Corpo della Richiesta

```json
{
  "name": "Panoramica del Prodotto Aggiornata"
}
```

| Parametro | Tipo   | Descrizione                     |
| --------- | ------ | ------------------------------- |
| name      | string | Il nuovo nome per il documento. |

## Formato di Risposta

```json
{
  "id": 1234,
  "name": "Panoramica del Prodotto Aggiornata",
  "type": "text/plain",
  "vector_store": "vs_abc123",
  "size": 173,
  "status": "indicizzato",
  "processing_status": "completato",
  "indexed_on": "2023-06-15T10:30:00Z",
  "status_error_message": null,
  "created": "2023-06-15T10:15:00Z",
  "modified": "2023-06-15T11:45:00Z"
}
```

## Autenticazione

Questo endpoint richiede autenticazione utilizzando una chiave API nell'intestazione `x-api-key`.

## Risposte di Errore

| Codice di Stato | Descrizione                                        |
| --------------- | -------------------------------------------------- |
| 400             | Richiesta Errata - Formato di richiesta non valido |
| 401             | Non Autorizzato - Chiave API non valida o mancante |
| 404             | Non Trovato - Vector Store o documento non trovato |
| 500             | Errore Interno del Server                          |

Questo endpoint ti consente di aggiornare i metadati di un documento nel tuo vector store. Attualmente, puoi solo aggiornare il nome del documento. Questo è utile per migliorare l'organizzazione e la reperibilità dei documenti senza dover ricaricare il documento.

{% hint style="info" %}
Nota: Questo endpoint aggiorna solo i metadati del documento, non il suo contenuto. Per aggiornare il contenuto, devi eliminare il documento esistente e caricarne uno nuovo.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.rememberizer.ai/it/risorse-per-sviluppatori/api-docs/vector-store/update-files-content-in-a-vector-store.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
