Clear system cache

POST https://app.speybooks.com/api/v1/admin/system/clear-cache

Flush all server-side in-memory caches. Clears both the main application cache (fastify.cache) and the tenant cache (fastify.tenantCache) if they exist.

Returns the number of keys cleared (from the main cache stats, if available).

Use Cases

  • After manual database edits
  • After system setting changes that affect cached data
  • During incident response

Side Effects

  • Writes CACHE_CLEARED to admin_audit_log
  • Subsequent requests will incur cache-miss latency until the cache warms up

Response

200 All in-memory caches flushed. Returns number of keys cleared.
Show response fields
keysCleared integer
message string

Error codes

400 Cache flush failed.