Skip to content

Clear a project's edge cache

POST
/api/v1/projects/{id}/cache/purge
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.

id
required
string

Project ID (UUID)

Accepted

Media type application/json
object
data
meta
object
request_id
string
timestamp
string
trace_id
string
data
object
hosts
Array<string>
id
string
requested_at
string
status
string
Allowed values: queued

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

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string

Example generated

{
"code": "example",
"details": "example",
"error": "example",
"meta": {
"request_id": "example",
"timestamp": "example",
"trace_id": "example"
}
}

PROJECT_NOT_FOUND

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string

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

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string

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

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
details
object
retry_after_seconds
integer

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

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string

Example generated

{
"code": "example",
"details": "example",
"error": "example",
"meta": {
"request_id": "example",
"timestamp": "example",
"trace_id": "example"
}
}

Live 022265e7 built