Delete items in bulk by prefix and/or age
DELETE
/api/v2/organizations/{organization}/projects/{project}/kv/{store_id}/items
const url = 'https://dashboard.quantcdn.io/api/v2/organizations/test-org/projects/test-project/kv/0000/items?prefix=oauth_state%3A&older_than=24h';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://dashboard.quantcdn.io/api/v2/organizations/test-org/projects/test-project/kv/0000/items?prefix=oauth_state%3A&older_than=24h' \ --header 'Authorization: Bearer <token>'Deletes every item matching the filters. With no filters the whole store is cleared. A small purge finishes in the request and returns 200; a large one returns 202 with the counts so far and continues in the background. Idempotent.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”organization
required
string
Organization identifier
Example
test-orgproject
required
string
Project identifier
Example
test-projectstore_id
required
string
Example
0000Query Parameters
Section titled “Query Parameters”prefix
string
Only delete keys that start with this string.
Example
oauth_state:older_than
string
Only delete keys last updated before this instant. ISO 8601, or a duration with unit s, m, h or d.
Example
24hResponses
Section titled “Responses”The purge finished.
Media typeapplication/json
object
status
string
deleted
integer
scanned
integer
Example
{ "status": "complete", "deleted": 12, "scanned": 40}The purge continues in the background.
Media typeapplication/json
object
status
string
deleted
integer
scanned
integer
Example
{ "status": "in_progress", "deleted": 21825, "scanned": 22000}The server could not understand the request due to invalid syntax.
Media typeapplication/json
object
message
required
Error message
string
error
required
Error flag
boolean
Example
{ "message": "The requested resource was not found", "error": true}Insufficient permissions.
Media typeapplication/json
object
message
required
Error message
string
error
required
Error flag
boolean
Example
{ "message": "The requested resource was not found", "error": true}