---
title: "Run a cache management action"
method: POST
path: "/configuration/cache"
tags: ["Admin Configuration"]
---

# Run a cache management action

`POST /configuration/cache`

## Request

- Base URL: `http://localhost:8000/api/admin`
- URL: `http://localhost:8000/api/admin/configuration/cache`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-admin-api/docs/configuration/cache/post.ts> (a function with typed inputs; its response is checked against the schema)

Runs one cache action, the same set the Cache Management screen offers. Clear actions: `clear-all`, `clear-config`, `clear-cache`, `clear-compiled`, `clear-events`, `clear-routes`, `clear-views`. Build actions: `build-all`, `build-config`, `build-routes`, `build-views`. Any other value returns 422 with `success: false`; a command that fails also returns 422 with its output.

## Request body

- object
  - `action` 'clear-all' | 'clear-config' | 'clear-cache' | 'clear-compiled' | 'clear-events' | 'clear-routes' | 'clear-views' | 'build-all' | 'build-config' | 'build-routes' | 'build-views', required

## Response `200`

The action ran.

## Other responses

- `400`: Invalid input
- `401`: Unauthenticated.
- `403`: Missing the configuration permission.
- `422`: Missing, unknown or failed action.

## Changes

- **2026-10-28** `3198f11be70f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/bagisto/apis/bagisto-admin-api/changes/configuration/cache/post.md)

---

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