ReloadStore
Trigger a reload of the policy store to pick up changes from the underlying storage backend. This is useful when policies are updated externally (e.g., files modified on disk, database changes) and you want Cerbos to reload them without restarting the server.HTTP Request
Authentication
Requires BasicAuth credentials configured in the Cerbos server.Query Parameters
Wait until the reloading process finishes before returning the response. If
false or omitted, the API returns immediately and the reload happens asynchronously.Default: falseResponse
Returns an empty response object on success.Example Request - Asynchronous Reload
Example Request - Synchronous Reload
Use Cases
- File-based stores (disk, blob, git): Reload after updating policy files externally
- Database stores (mysql, postgres, sqlite3): Reload after making direct database changes
- CI/CD pipelines: Trigger reload after deploying new policies
- Hot-reload development: Automatically reload during policy development
PurgeStoreRevisions
Purge old revisions from the policy store to free up storage space. This is particularly useful for stores that maintain revision history, such as database-backed stores.HTTP Request
Authentication
Requires BasicAuth credentials configured in the Cerbos server.Query Parameters
Number of most recent revisions to keep for each policy. If not specified or set to zero, all revisions will be deleted (keeping only the current version).Example:
keepLast=5 will keep the 5 most recent revisions and delete all older onesResponse
Number of revision records deleted from the store
Example Request - Keep Last 10 Revisions
Example Request - Delete All Revisions
Example Response
Use Cases
- Storage management: Free up database space by removing old revisions
- Compliance: Implement data retention policies by purging old policy versions
- Performance optimization: Reduce database size for faster queries
- Scheduled maintenance: Run periodic purge operations to prevent unbounded growth
Important Notes
- This operation only affects stores that maintain revision history (primarily database stores)
- File-based stores typically don’t maintain internal revisions, so this operation has no effect
- The current version of each policy is never deleted
- Setting
keepLast=0deletes all historical revisions but keeps the current version - This operation is irreversible - deleted revisions cannot be recovered
Best Practices
- Regular purging: Schedule periodic purge operations (e.g., weekly or monthly)
- Keep recent revisions: Retain at least 5-10 recent revisions for rollback capability
- Monitor storage: Track store size before and after purging
- Backup before purging: Create backups before major purge operations
- Test in staging: Test purge operations in a non-production environment first