---
title: Purge a service's staging environment through the API
summary: null
url: >-
  https://www.fastly.com/documentation/reference/changes/2026/10/purge-staging-environment
---

You can now purge the cache of a service's [staging environment](https://www.fastly.com/documentation/guides/getting-started/services/working-with-staging/) through the API, so that tests on a staged version see your latest content. Add the `Fastly-Purge-Environment: staging` header to a [purge everything](https://www.fastly.com/documentation/reference/api/purging/#purge-all), [purge by surrogate key tag](https://www.fastly.com/documentation/reference/api/purging/#purge-tag), or [purge multiple surrogate key tags](https://www.fastly.com/documentation/reference/api/purging/#bulk-purge-tag) request. Without this header, a purge applies to the production environment. To purge an individual URL from the staging environment, send the [purge a URL](https://www.fastly.com/documentation/reference/api/purging/#purge-single-url) request to the staging IP address of the service.
