Remove Redis Keys API – Bulk Delete Keys & Invalidate Cache in API Maker
Overview
The Remove Redis Key(s) API lets you delete single or multiple Redis keys with one request—perfect for cache invalidation, ending sessions, or removing temporary data in API Maker.
API Endpoint
Parameters Explained
Field | Type | Required | Description |
---|---|---|---|
keys | string or array | Yes | Redis keys to be deleted |
Step-by-Step Integration Example
-
Identify stale/session/cache keys to be removed.
-
Call the
removeRedisKeys
API with the key list. -
Confirm success via the API response or Redis monitoring tools.
-
Optionally re-populate cache using
setRedisKey
.
Example Requests Body Payload
Delete a single key:
Delete multiple keys:
Example Success Response
Success:
Example Usage in Scripts
For Single Key:
For Multiple Keys:
Bulk Delete and Performance Notes
-
For huge key sets, split deletes into batches (recommended ≤1,000 keys per call).
-
Non-existent keys are skipped without error.
-
Wildcards are not supported to avoid accidental or unintentional deletion of any redis content.
Best Practices
-
Use arrays to remove multiple keys in one call.
-
Use consistent key naming conventions for easy updates and deletions.
-
Pair with
getRedisKey
andsetRedisKey
for better cache lifecycle management. -
Use hooks to automatically clear cache after updates.
-
Review API Maker logs to debug deletion issues.
Debugging Tips
-
Verify your Redis connection settings in API Maker.
-
Ensure key names exactly match.
-
Check Redis cluster configuration if using a distributed setup.
-
Use API Maker logs to trace deletion requests.
FAQ
Q: What if the key doesn’t exist?
A: No error—such keys are simply skipped.
Q: Can I delete thousands of keys at once?
A: Yes, but batch large sets to optimize performance.
Q: Can it be used in workflows?
A: Yes, it’s fully supported in API Maker workflows and custom APIs.
Related APIs
-
getRedisKey/Keys
– Retrieve Redis key values. -
setRedisKey/Keys
– Create or update Redis keys. -
Cache reset APIs: