Call the DeleteVectors operation to delete specified vector data from a vector index.
Notes
You can delete vector data in batches.
The delete operation is irreversible. Use this command with caution.
Permissions
By default, an Alibaba Cloud account has all permissions. A Resource Access Management (RAM) user or RAM role under an Alibaba Cloud account has no permissions by default. The Alibaba Cloud account or an administrator must grant permissions using a RAM Policy or a Bucket Policy.
API | Action | Description |
DeleteVectors |
| Deletes vector data. |
Request syntax
POST /?deleteVectors HTTP/1.1
Host: examplebucket-123***456.cn-hangzhou.oss-vectors.aliyuncs.com
Date: GMT Date
Authorization: SignatureValue
Content-type: application/json
{
"indexName": "string",
"keys": [string, string, string]
}Request headers
This operation uses only common request headers. For more information, see Common HTTP headers.
Request parameters
Name | Data type | Required | Example | Description |
indexName | string | No | vectorindex1 | The name of the index. |
keys | container | Yes | ["doc-001", "doc-002"] | A list of vector primary keys. If a specified primary key corresponds to a vector that does not exist, no error is reported. Constraints: The number of unique keys must be in the range of 1 to 500. |
This operation also uses common request headers. For more information, see Common HTTP headers.
Response headers
This operation uses only common response headers. For more information, see Common HTTP headers.
Examples
Request example
POST /?deleteVectors HTTP/1.1
Host: examplebucket-123***456.cn-hangzhou.oss-vectors.aliyuncs.com
Date: Thu, 17 Apr 2025 01:33:47 GMT
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/oss/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c218
Content-type: application/json
{
"indexName": "vectorindex1",
"keys": ["doc-001", "doc-002", "doc-003"]
}Response example
HTTP/1.1 204 No Content
x-oss-request-id: 534B371674E88A4D8906****
Date: Thu, 17 Apr 2025 01:33:47 GMT
Connection: keep-alive
Server: AliyunOSSSDKs
The following SDKs support the DeleteVectors operation:
ossutil command-line interface
For the ossutil command that corresponds to the DeleteVectors operation, see delete-vectors.
Error codes
Error code | HTTP status code | Description |
VectorIndexParameterInvalid | 400 | The vector index parameter provided in the request is invalid. |
MalformedJson | 400 | The JSON format in the request body is invalid. |
AccessDenied | 403 | Possible causes for this error:
|
NoSuchVectorIndex | 404 | The specified vector index does not exist. |
QpsLimitExceeded | 503 | QPS limit exceeded. The request rate is limited. If the HTTP status code is 5xx, only some of the data in the batch request may be deleted. The write operation does not ensure atomicity. |