CDNShark Documentation

Customer API

← Back to Documentation

Purge Cache via API

POST /api/pullzones/{id}/purge (pullzones:write) removes cached copies from every edge, so the next request fetches from your origin.

BodyEffect
emptyPurges everything cached for the zone.
{"paths": ["/images/logo.png", "/css/app.css"]}Purges only those paths, up to 30 per call.
curl -X POST https://cdnshark.com/api/pullzones/53/purge \
  -H "Authorization: Bearer YOUR_TOKEN" -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"paths": ["/images/logo.png"]}'
{ "message": "Cache purged for 1 path(s).", "purged": ["/images/logo.png"], "failed_edges": 0 }

The purge runs on all edges before the call returns. If some edges could not be reached, the answer is 207 and failed_edges says how many: repeat the call. Find a zone's id with GET /api/pullzones.