Skip to navigation

Purge CDN cache

Purges matching cache content synchronously for a distribution in the selected workspace. For a normal single-page application deployment, use mode: url with paths: ["/index.html"]. Do not purge fingerprinted assets such as /assets/app.a91c3.js; use paths: ["/*"] only for an emergency full-cache invalidation.

# Example request with curl (set IBEE_API_TOKEN to a platform API token and WORKSPACE_ID to the workspace first).
# DISTRIBUTION_ID: CDN distribution ID
curl -X POST "https://api.ibee.ai/v1/cdn/distributions/$DISTRIBUTION_ID/purge?workspace_id=$WORKSPACE_ID" \
-H "Authorization: Bearer $IBEE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"mode": "url"}'

Authentication

AuthorizationBearer

IBEE platform API token. Production tokens start with ibee_prod_key_; development tokens start with ibee_dev_key_. Use a token only with its matching gateway environment.

Path parameters

distribution_idstringRequired>=1 character
CDN distribution ID.

Query parameters

workspace_idstringRequiredformat: "^[1-9][0-9]*$">=1 character

The positive numeric workspace ID to scope this request to. Zero, negative, and non-numeric values are rejected.

Request

This endpoint expects an object.
modeenumRequired
  • url: purge the paths in paths.
  • hostname: purge everything for the hostnames in hostnames.
  • tag: purge content tagged with tags.
  • prefix: purge paths starting with prefixes.
  • all: purge the whole distribution.
Allowed values:
pathslist of stringsOptional

Paths to purge, for url mode.

hostnameslist of stringsOptional

Hostnames to purge, for hostname mode.

tagslist of stringsOptional

Cache tags to purge, for tag mode.

prefixeslist of stringsOptional

Path prefixes to purge, for prefix mode.

Response

Cache purge completed.
successboolean
True when the purge was accepted.
modeenum

Purge mode that was applied.

  • url
  • hostname
  • tag
  • prefix
  • all
Allowed values:
purgedlist of strings or nullOptional
Items that were purged, when the mode lists them.
messagestring or nullOptional

Human-readable result.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
413
Content Too Large Error
422
Unprocessable Entity Error
423
Locked Error
429
Too Many Requests Error
500
Internal Server Error
502
Bad Gateway Error
503
Service Unavailable Error
504
Gateway Timeout Error