> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.erlcrussia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CDN in CI/CD and cache reset

> Release publishing and spot cleaning of the Cloudflare and CDN cache.

Release order: build with new RELEASE\_ID, download files sequentially, check SHA-256 and HTTP, then switch HTML to new build. Save old chunks for open tabs. Store keys only in CI/CD secrets.

## Verified custom domain

Pass exact file paths in JSON paths, maximum 100. Do not use query prefix: this route does not support it. Missing or empty paths means the entire domain.

```bash theme={null}
curl -X POST "$API_BASE/v3/cdn/webhook/purge" \
  -H "erlcrussia-api-cdn-token: $CDN_DEPLOY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"paths":["releases/RELEASE_ID/logo.png"]}'
```

With a custom key, the same JSON is sent to `POST /v3/cdn/custom-domains/{id}/purge` via the erlcrussia-api-key header.

The response contains success, domain, cloudflarePurged, edgePurged and timestamp. HTTP 200 does not guarantee success: success=false means an error at one or both levels. Check every flag. The browser cache is not cleared by this request.

## Regular namespace and file groups

`POST /v3/cdn/assets/purge?domain=YOUR_TEAM_SLUG&prefix=releases/RELEASE_ID/` accepts prefix and schedules a CDN cache purge. This is a different contract. Without ids/path/prefix, the entire namespace is selected. success means acceptance of the operation; check subsequent delivery.

The new release URL is more reliable than replacing the old immutable file. HTTP 429 requires waiting Retry-After; HTTP 409 means an existing object, not a successful download.

Without ids/path/prefix, a whole-namespace purge runs in the background: HTTP 202, status=queued, acceptedCount counts selected assets, not completed work. One request per minute per team and namespace; respect Retry-After on 429. Completion or failure is recorded in the API audit log. Targeted purge keeps HTTP 200 and purgedCount. A new unique release URL usually needs no purge immediately after upload: doing so evicts the warmed cache.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.