/vectors/{collection}/deleteDelete Vectors by Metadata
Deletes the rows of a _-prefixed vector collection that match every equality in filters, and answers { deleted, collection } with the count removed.
filters must include at least one metadata.<key> equality. id, contentHash and source.<key> can narrow it but are refused on their own, and an empty filters is refused rather than deleting everything.
Each row goes with its vector, text, metadata and content hash.
Needs the same vectors write grant on the collection as an upsert.
Each call writes one audit event with the collection and the count, never the filter.
| collection * | path | The derived collection's name. It starts with |
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
| filters * | object | Equality filters; every one must match. At least one Each key is a path and each value the string, number or boolean it must equal. An empty object, or one with no |
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | Success | |
| 400 | K9O_INVALID_FIELD_VALUE | The project identifier in the request path is not valid. |
| 400 | K9O_INVALID_FIELD_VALUE | filters is empty or has no metadata.<key> equality; id, contentHash and source.<key> can only narrow one. |
| 400 | K9O_INVALID_FIELD_VALUE | The filters object referenced an unsupported path; only id, contentHash, source.<key>, and metadata.<key> are allowed. |
| 403 | K9O_RESERVED_COLUMN_WRITE_PROHIBITED | Vector deletes are only allowed in an extension's own '_'-prefixed derived collection; this collection name is not one. |
| 403 | K9O_ACCESS_DENIED | The caller is not a member of this project. |
| 403 | K9O_EXTENSION_PERMISSION_DENIED | An extension token without the vectors write grant on this collection. |
| 403 | K9O_IAM_POLICY_DENIED | The caller's project role can read vector data but not change it (reason read_only_role): only admin, editor, member and author roles write, as for storage objects. |
| 404 | K9O_COLLECTION_NOT_FOUND | This derived vector collection has never been upserted into, so there is nothing to delete. |
| data * | object | |
| deleted * | integer | How many chunks were removed, with their stored text, vectors and content hashes. 0 when nothing matched. |
| collection * | string | The derived collection deleted from. |
| meta * | any | Request metadata: request id, trace id, timing and cost. |
curl -X POST 'https://<org>.api-<region>.k9o.io/@storefront/vectors/products/delete' \
-H 'Authorization: Bearer $K9O_TOKEN' \
-H 'Content-Type: application/json' \
-d '{}'Showing example in cURL
{}{
"data": {
"deleted": 0,
"collection": "string"
}
}