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/purgeAuthentication
Section titled “Authentication”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"Purge by URL
Section titled “Purge by URL”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 (quote it in a shell):
curl -X POST https://api.quantcdn.io/v1/purge \ -H "Quant-Customer: ..." -H "Quant-Project: ..." -H "Quant-Token: ..." \ -H "Quant-Url: /*"Paths, wildcards and query strings
Section titled “Paths, wildcards and query strings”- A path purge clears that path for every domain of the project.
/*is the whole project on both platforms.- On QuantCDN,
/*is the only wildcard. Any other path, such as/blog/*, is purged as that exact URL, so it clears nothing under/blog/(the request still succeeds). To purge a group of pages, use cache keys. - On QuantGov, a trailing
*purges every path that starts with the prefix:/blog/*purges everything under/blog/. - Each query-string variant is a separate cache entry. Purging
/newsdoes not purge/news?page=2. Purge that exact URL, use a cache key, or purge/*.
Purge by cache key
Section titled “Purge by cache key”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"Soft purge
Section titled “Soft purge”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. Soft purge is available on QuantCDN. On QuantGov the header is ignored and every purge removes the content.
Response and timing
Section titled “Response and timing”A successful purge returns a 200 with a JSON body indicating the request was accepted:
{ "status": "accepted" }Errors
Section titled “Errors”| Status | Meaning |
|---|---|
400 |
The request was missing both Quant-Url and Cache-Keys. |
403 |
The Quant-Token did not match the supplied customer/project. |
See also
Section titled “See also”- Using cache keys — tagging content so you can purge by key.
- Purge via the dashboard — the interactive equivalent.
- Deploy via CI/CD — purging from a deployment pipeline.
