Using
Deletes every live key whose raw form starts with `prefix`, optionally narrowed by a case-sensitive `contains` substring filter on the key — the same selection `GET …/keys?prefix=&contains=` would show. Atomic: either every matched key is gone, or (a 413) none is. Returns the number of keys deleted.
applies to v0.5.1DELETE
/store-api/kv/{domain}/keys
const url = 'https://example.com/store-api/kv/example/keys?prefix=example';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url 'https://example.com/store-api/kv/example/keys?prefix=example' \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”domain
required
string
Domain name
Query Parameters
Section titled “Query Parameters”prefix
required
string
Key prefix — required, must not be empty. A domain-emptying request needs the admin-only DELETE /store-api/domains/{name} instead.
contains
string
Case-sensitive substring filter on the user key, applied to the prefix scan’s results before the cap check
Responses
Section titled “Responses”Matched keys deleted atomically (one write batch); an empty selection is a no-op
Media typeapplication/json
object
deleted
required
integer
Example generated
{ "deleted": 1}Missing or empty prefix
Media typetext/plain
string
Domain not found
Media typetext/plain
string
Domain is being deleted
Media typetext/plain
string
The selection exceeds max_bulk_delete_keys; no key was deleted
Media typetext/plain
string
Rate limit exceeded
Media typetext/plain
string
Headers
Section titled “Headers”Retry-After
integer format: int64
Insufficient Storage — disk space or memory runs short; the write was not applied. Reads go on; retry after the seconds in Retry-After.
Media typetext/plain
string
Headers
Section titled “Headers”Retry-After
integer