API Reference
POST
purge-varnish Purge Cache
Purge Cache is a POST request to https://api.sharkcluster.com/purge-varnish in the Server Management section of the SharkCluster API. Immediately flushes all cached objects from memory (Global Purge). It takes 1 parameter, 1 required (server_id).
Request URL
POST
https://api.sharkcluster.com/purge-varnishHow do you call Purge Cache?
- 1Get a token from the login endpoint (POST /login) and send it as Authorization: Bearer <token>. See Login.
- 2Send a POST request to https://api.sharkcluster.com/purge-varnish.
- 3Include the required parameter: server_id.
Request parameters
| Parameter | Type | Description |
|---|---|---|
server_idRequired | string | The Internal Unique ID of the server. |
What does Purge Cache return?
A successful call returns a JSON object with the fields success, message and output. Check that success is true in the body: like many SharkCluster endpoints, a failure can come back with HTTP 200 and success: false.
Request sample
const axios = require('axios');
const serverId = "0000-1111-2222";
// Example: Purging the entire Varnish cache
axios.post('https://api.sharkcluster.com/purge-varnish', {
server_id: serverId
}, {
headers: { 'Authorization': 'Bearer YOUR_TOKEN' }
})
.then(res => console.log("Cache Result:", res.data.message))
.catch(err => console.error("Purge Failed:", err.response?.data || err.message));
Response
{
"success": true,
"message": "Varnish cache purged successfully",
"output": ".....\nCould not get hold of varnishd, is it running?\nConnection failed (localhost:6082): Connection refused\n"
}Related Server Management endpoints
Stuck on an integration?
Raise a ticket from the panel with the endpoint and the response you got back — it reaches an engineer with your server already attached.