# purge

> For AI agents: the complete documentation index is at https://buddy.works/llms.txt

## Usage

```bash
bdy distro route purge [options] <identifier> <route-id>
```

Purge the CDN cache of a route: all of it (--all) or the given paths (--path) Required scopes: DISTRIBUTION_WRITE

## Arguments

| **Argument** | **Description** |
| :--- | :--- |
| `identifier` | Human-readable ID of the distribution (required) |
| `route-id` | ID of the route (find via "bdy distro route ls") (required) |

## Options

| **Option** | **Description** |
| :--- | :--- |
| `--context <name>` | Connection and scope context: default, git, link or a saved name. Overrides the globally active context for this invocation. |
| `--examples` | Show only examples; with this flag --format accepts text, json or jsonl |
| `--verbose` | Show REST API requests, responses, timing and retries on stderr |
| `-w, --workspace <domain>` | Workspace URL handle. Can be set via variable: BUDDY_WORKSPACE |
| `-p, --project <name>` | Project name. Can be set via variable: BUDDY_PROJECT |
| `--environment <identifier>` | Environment identifier of an environment-scoped distribution. Looked up in the project (--project, BUDDY_PROJECT, linked project), then - unless |
| `--project` | is given - among the workspace environments |
| `--scope <scope>` | Force scope (WORKSPACE, PROJECT, ENVIRONMENT). By default calculated by provided options and environmental variables (--project, --environment, BUDDY_PROJECT, linked project) |
| `--all` | Purge all cached content of the route |
| `--path <path>` | Path to purge (can be used multiple times) |
| `--format <text\|json>` | Output format: json, text. JSON CLI errors: {error:{code,message,hint}}, exit 1. Default: text (choices: "text", "json") |
| `-h, --help` | display help for command |

Documentation for bdy v1.26.3

## Examples

### Purge the whole cache of a route

```bash
bdy distro route purge distro-identifier route-id --all
```

### Purge given paths of a route of an environment distribution

```bash
bdy distro route purge distro-identifier route-id --environment staging --path /index.html --path /assets/app.js
```


---
Original source: https://buddy.works/docs/cli/distro/route/purge