Skip to content

Purge via the API

The Content API exposes a single purge endpoint that handles purging by URL path, by cache key, and soft purges.

POST /v1/purge

Purge requests use the same authentication as the rest of the Content API — the Quant-Customer, Quant-Project, and Quant-Token headers. The token determines which project the purge applies to; you cannot purge a project you don’t hold credentials for.

curl -X POST https://api.quantcdn.io/v1/purge \
-H "Quant-Customer: [example-customer]" \
-H "Quant-Project: [example-project]" \
-H "Quant-Token: [project-token]" \
-H "Quant-Url: /content"

Set the Quant-Url header to the path you want to purge.

curl -X POST https://api.quantcdn.io/v1/purge \
-H "Quant-Customer: ..." -H "Quant-Project: ..." -H "Quant-Token: ..." \
-H "Quant-Url: /blog/my-post"

Use /* to purge the entire project:

curl -X POST https://api.quantcdn.io/v1/purge \
-H "Quant-Customer: ..." -H "Quant-Project: ..." -H "Quant-Token: ..." \
-H "Quant-Url: /*"

Set the Cache-Keys header to one or more space-separated keys. Every cached object tagged with any of those keys is purged. See Using cache keys for how tagging works.

curl -X POST https://api.quantcdn.io/v1/purge \
-H "Quant-Customer: ..." -H "Quant-Project: ..." -H "Quant-Token: ..." \
-H "Cache-Keys: env:production release:1.4.2"

A soft purge marks content as stale rather than evicting it immediately. Stale content can still be served — useful for keeping a site up if your origin is briefly unavailable. Add the Soft-Purge header:

curl -X POST https://api.quantcdn.io/v1/purge \
-H "Quant-Customer: ..." -H "Quant-Project: ..." -H "Quant-Token: ..." \
-H "Quant-Url: /content" \
-H "Soft-Purge: true"

Soft-Purge works with both Quant-Url and Cache-Keys purges.

A successful purge returns a 200 with a JSON body indicating the request was accepted:

{ "status": "accepted" }
Status Meaning
400 The request was missing both Quant-Url and Cache-Keys.
403 The Quant-Token did not match the supplied customer/project.