Clear a project's edge cache
const url = 'https://api.deploybase.eu/api/v1/api/v1/projects/example/cache/purge';const options = {method: 'POST', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.deploybase.eu/api/v1/api/v1/projects/example/cache/purge \ --header 'Authorization: <Authorization>'Purges every production hostname of the project (its platform address and every custom domain) from the CDN. Asynchronous: the purge usually lands within a minute; poll GET on the same path. The next visit from each location is slower while the cache refills. A deploy already clears the cache, so use this when a page still looks old. Previews are not affected. Limited to 5 per project per 10 minutes.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Project ID (UUID)
Responses
Section titled “ Responses ”Accepted
object
object
object
Example
{ "data": { "status": "queued" }}FORBIDDEN when the role is too low; DEPLOYS_PAUSED_FOR_REVIEW, ACCOUNT_SUSPENDED, TEAM_AWAITING_PAYMENT or TEAM_LAPSED when the team may not change what it serves
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}PROJECT_NOT_FOUND
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}PROJECT_NOT_LIVE: nothing is in production yet
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}CACHE_PURGE_RATE_LIMITED, with a Retry-After header and details.retry_after_seconds
object
object
object
Example generated
{ "code": "example", "details": { "retry_after_seconds": 1 }, "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}CACHE_PURGE_UNAVAILABLE: the CDN is not configured on this instance
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Live 022265e7 built