# Remove a document in 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/{document-id}/" method="delete" %}
[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 DELETE \
  https://api.rememberizer.ai/api/v1/vector-stores/vs_abc123/documents/1234/ \
  -H "x-api-key: YOUR_API_KEY"
```

{% hint style="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.
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const deleteDocument = async (vectorStoreId, documentId) => {
  const response = await fetch(`https://api.rememberizer.ai/api/v1/vector-stores/${vectorStoreId}/documents/${documentId}/`, {
    method: 'DELETE',
    headers: {
      'x-api-key': 'YOUR_API_KEY'
    }
  });
  
  if (response.status === 204) {
    console.log("Document deleted successfully");
  } else {
    console.error("Failed to delete document");
  }
};

deleteDocument('vs_abc123', 1234);
```

{% hint style="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.
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests

def delete_document(vector_store_id, document_id):
    headers = {
        "x-api-key": "YOUR_API_KEY"
    }
    
    response = requests.delete(
        f"https://api.rememberizer.ai/api/v1/vector-stores/{vector_store_id}/documents/{document_id}/",
        headers=headers
    )
    
    if response.status_code == 204:
        print("Document deleted successfully")
    else:
        print(f"Failed to delete document: {response.text}")

delete_document('vs_abc123', 1234)
```

{% hint style="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.
{% endhint %}
{% endtab %}
{% endtabs %}

## 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 delete.                   |

## Response

A successful request returns a 204 No Content status code with no response body.

## Authentication

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

## Error Responses

| Status Code | Description                                    |
| ----------- | ---------------------------------------------- |
| 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 remove a document from your vector store. Once deleted, the document and its vector embeddings will no longer be available for search operations. This is useful for removing outdated, irrelevant, or sensitive content from your knowledge base.

{% hint style="warning" %}
Warning: Document deletion is permanent and cannot be undone. Make sure you have a backup of important documents before deleting them.
{% endhint %}
