Update file's content in a Vector Store¶
PATCH /vector-stores/{vector-store-id}/documents/{document-id}/¶
Update a specific document in a vector store.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
vector-store-id |
path | string | yes | The ID of the vector store. |
document-id |
path | integer | yes | The ID of the document. |
x-api-key |
header | string | yes | The API key for authentication. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | The new name for the document. |
Responses
200— Document updated successfully.
Example Requests¶
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": "Updated Product Overview"
}'
Info
Replace YOUR_API_KEY with your actual Vector Store API key, vs_abc123 with your Vector Store ID, and 1234 with the document ID.
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, 'Updated Product Overview');
Info
Replace YOUR_API_KEY with your actual Vector Store API key, vs_abc123 with your Vector Store ID, and 1234 with the document ID.
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, 'Updated Product Overview')
Info
Replace YOUR_API_KEY with your actual Vector Store API key, vs_abc123 with your Vector Store ID, and 1234 with the document ID.
Path Parameters¶
| Parameter | Type | Description |
|---|---|---|
| vector-store-id | string | Required. The ID of the vector store containing the document. |
| document-id | integer | Required. The ID of the document to update. |
Request Body¶
| Parameter | Type | Description |
|---|---|---|
| name | string | The new name for the document. |
Response Format¶
{
"id": 1234,
"name": "Updated Product Overview",
"type": "text/plain",
"vector_store": "vs_abc123",
"size": 173,
"status": "indexed",
"processing_status": "completed",
"indexed_on": "2023-06-15T10:30:00Z",
"status_error_message": null,
"created": "2023-06-15T10:15:00Z",
"modified": "2023-06-15T11:45:00Z"
}
Authentication¶
This endpoint requires authentication using an API key in the x-api-key header.
Error Responses¶
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid request format |
| 401 | Unauthorized - Invalid or missing API key |
| 404 | Not Found - Vector Store or document not found |
| 500 | Internal Server Error |
This endpoint allows you to update the metadata of a document in your vector store. Currently, you can only update the document's name. This is useful for improving document organization and discoverability without needing to re-upload the document.
Info
Note: This endpoint only updates the document's metadata, not its content. To update the content, you need to delete the existing document and upload a new one.