Invalidate CDN cache

View as Markdown
  • POST
  • /workspaces
  • /:workspace
  • /distributions
  • /:distribution_id
  • /routes
  • /:route_id
  • /cache

Invalidate the CDN cache of a single route in a distribution, so the next request to the route serves the freshly deployed content.

Request

REQUIRED SCOPES
DISTRIBUTION_WRITE
URL PARAMETERS
workspacerequiredstring
The human-readable ID of the workspace

Example: "my-company"

distribution_idrequiredstring
The ID of the distribution

Example: "nZrnl40Y"

route_idrequiredstring
The ID of the route

Example: "dybEM2bg"

GET PARAMETERS
project_namestring
Project name to filter distributions

Example: "my-project"

BODY PARAMETERS
purge_allboolean
Purge all cached content for this route
purge_pathsstring[]
List of paths to invalidate

Last modified on Aug 18, 2026

Examples

Example: Purge entire route cache

curl -X POST "https://api.buddy.works/workspaces/:workspace/distributions/:distribution_id/routes/:route_id/cache" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
  "purge_all": true
}'

Example: Purge specific paths

curl -X POST "https://api.buddy.works/workspaces/:workspace/distributions/:distribution_id/routes/:route_id/cache" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
  "purge_all": false,
  "purge_paths": [
    "/index.html",
    "/assets/*"
  ]
}'
STATUS
204 Route cache invalidation triggered