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:
curl -X POST https://api.quantcdn.io/v1/purge \ -H "Quant-Customer: ..." -H "Quant-Project: ..." -H "Quant-Token: ..." \ -H "Quant-Url: /*"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.
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.
