Bunny.net pull zone not found (404) in CI
Bunny.net could not find the pull zone: a 404 on a pull-zone operation means the zone id does not exist for the account the API key belongs to, usually a stale id, a typo, or a key for a different account.
What this error means
A GET/POST to /pullzone/{id} (or a per-zone purge) returns HTTP 404 Not Found. Account-wide calls with the same key succeed, so the key is valid but the id is wrong.
HTTP/1.1 404 Not Found
# request: POST https://api.bunny.net/pullzone/999999/purgeCache
# the pull zone id 999999 does not exist for this accountCommon causes
The pull zone id is stale or misspelled
A hard-coded id no longer matches an existing zone (deleted, recreated, or a typo), so the endpoint returns 404.
The key belongs to a different account
The zone exists under one account, but the API key is for another, so it is not visible.
How to fix it
Resolve the id from the pull-zone list
- List pull zones and read the id for the zone name you deploy.
- Store that id as a secret or config value.
- Use it in the purge or update call.
curl -sS "https://api.bunny.net/pullzone" -H "AccessKey: ${BUNNY_API_KEY}" \
| jq '.[] | {Id, Name}'Confirm the key and account match the zone
Ensure the API key belongs to the account that owns the zone before retrying.
curl -s -o /dev/null -w '%{http_code}\n' \
"https://api.bunny.net/pullzone/${ZONE_ID}" -H "AccessKey: ${BUNNY_API_KEY}"How to prevent it
- Source the pull zone id from the API or config, not a literal.
- Keep the API key and zone in the same account.
- Validate the id with a list call in a preflight step.