---
title: "Delete cached responses in bulk"
method: DELETE
path: "/api/caches/bulk/"
tags: ["Caches"]
---

# Delete cached responses in bulk

`DELETE /api/caches/bulk/`

## Request

- Base URL: `https://api.respan.ai`
- URL: `https://api.respan.ai/api/caches/bulk/`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Delete cached responses using exactly one selector: `cache_keys`, `ids`, or `all: true`. Up to 1,000 keys or IDs can be deleted per request. `ids` uses internal integer IDs and is JWT-only; API-key clients should use `cache_keys` or `all`. Rate limit: 60 requests per minute per organization for API-key calls (shared across API keys) and per user for JWT calls.

## Request body

- object: Exactly one deletion mode is required.
  - `cache_keys` string[]: Cache keys to delete. Supported for API key and JWT authentication.
  - `ids` integer[]: Internal numeric cache entry IDs to delete. JWT only.
  - `all` boolean: Set to true to delete all cached responses for the current organization. The server rejects false.

## Response `200`

Cached responses were deleted synchronously.

- BulkDeleteResponse: Canonical result envelope for a bulk operation.
  - `success_count` integer, required: Number of items successfully processed.
  - `error_count` integer, required: Number of items that failed.
  - `errors` BulkItemError[], required: Item-level failures, keyed by zero-based input index.
    - `index` integer, required: Zero-based index of the failed item in the submitted array.
    - `error` string, required: Error message for the failed item.
  - `deleted_count` integer, required: Number of resources matched and processed for deletion.
  - `message` string, required: Human-readable deletion result.

## Other responses

- `400`: The selector is invalid, more than one selector was supplied, or API-key authentication was used with `ids`.
- `403`: The API key is missing, invalid or expired, or it can't delete cached responses.
- `422`: The request contains more than 1,000 cache keys or IDs.
- `429`: Rate limit exceeded.

## Changes

- **2026-10-21** `c30bcb383ee8`: 9 breaking, 5 info
  - request body became required
  - the `cache_keys` request property's minItems was increased to `1`
  - the `ids` request property's minItems was increased to `1`
  - the response's body type changed from `object` to no type for status `200`
  - …10 more
- **2026-10-02** `b830b79cfd52`: 1 breaking, 2 info
  - the response's body type changed from no type to `object` for status `403`
  - removed the non-success response with the status `401`
  - added the required property `detail` to the response with the `403` status
- **2026-09-17** `6fa8242da8c2`: 1 warning, 1 info
  - deleted the `header` request parameter `Authorization`
  - the endpoint scheme security `RespanApiKey` was added to the API
- **2026-09-12** `22b868ef3f22`: 1 info
  - api operation id `bulk-delete-cached-responses` removed and replaced with `caches_bulkDeleteCachedResponses`

[Operation history](https://skmtc.dev/respan/apis/respan-api/changes/api/caches/bulk/delete.md)

---

[API](https://skmtc.dev/respan/apis/respan-api.md) - [All operations](https://skmtc.dev/respan/apis/respan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/respan/apis/respan-api/revisions/900841387635?raw)
