# PurgeApi
> [!NOTE]
> All URIs are relative to `https://api.fastly.com`
Method | HTTP request | Description
------ | ------------ | -----------
[**bulk_purge_tag**](PurgeApi.md#bulk_purge_tag) | **POST** /service/{service_id}/purge | Purge multiple surrogate key tags
[**purge_all**](PurgeApi.md#purge_all) | **POST** /service/{service_id}/purge_all | Purge everything from a service
[**purge_single_url**](PurgeApi.md#purge_single_url) | **POST** /purge/{cached_url} | Purge a URL
[**purge_tag**](PurgeApi.md#purge_tag) | **POST** /service/{service_id}/purge/{surrogate_key} | Purge by surrogate key tag
## bulk_purge_tag
Instant Purge a particular service of items tagged with surrogate keys. Up to 256 surrogate keys can be purged in one batch request. As an alternative to sending the keys in a JSON object in the body of the request, this endpoint also supports listing keys in a Surrogate-Key
request header, e.g. Surrogate-Key: key_1 key_2 key_3
.
```rust
let cfg = &Configuration::default();
let params = BulkPurgeTagParams {
// parameters
};
bulk_purge_tag(cfg, params)
```
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**service_id** | **String** | Alphanumeric string identifying the service. | [required] |
**fastly_soft_purge** | Option\<**i32**> | If present, this header triggers the purge to be 'soft', which marks the affected object as stale rather than making it inaccessible. Typically set to \"1\" when used, but the value is not important. | |
**surrogate_key** | Option\<**String**> | Purge multiple surrogate key tags using a request header. Not required if a JSON POST body is specified. | |
**purge_response** | Option\<[**PurgeResponse**](PurgeResponse.md)> | | |
### Return type
**::std::collections::HashMap**
### Authorization
[token](../README.md#token)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
## purge_all
Instant Purge everything from a service. Purge-all requests cannot be done in soft mode and will always immediately invalidate all cached content associated with the service. To do a soft-purge-all, consider applying a constant [surrogate key](https://docs.fastly.com/en/guides/getting-started-with-surrogate-keys) tag (e.g., `\"all\"`) to all objects.
```rust
let cfg = &Configuration::default();
let params = PurgeAllParams {
// parameters
};
purge_all(cfg, params)
```
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**service_id** | **String** | Alphanumeric string identifying the service. | [required] |
### Return type
[**crate::models::InlineResponse200**](InlineResponse200.md)
### Authorization
[token](../README.md#token)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
## purge_single_url
Instant Purge an individual URL.
```rust
let cfg = &Configuration::default();
let params = PurgeSingleUrlParams {
// parameters
};
purge_single_url(cfg, params)
```
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**cached_url** | **String** | URL of object in cache to be purged. | [required] |
**fastly_soft_purge** | Option\<**i32**> | If present, this header triggers the purge to be 'soft', which marks the affected object as stale rather than making it inaccessible. Typically set to \"1\" when used, but the value is not important. | |
### Return type
[**crate::models::PurgeResponse**](PurgeResponse.md)
### Authorization
[token](../README.md#token)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
## purge_tag
Instant Purge a particular service of items tagged with a Surrogate Key. Only one surrogate key can be purged at a time. Multiple keys can be purged using a batch surrogate key purge request.
```rust
let cfg = &Configuration::default();
let params = PurgeTagParams {
// parameters
};
purge_tag(cfg, params)
```
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**service_id** | **String** | Alphanumeric string identifying the service. | [required] |
**surrogate_key** | **String** | Surrogate keys are used to efficiently purge content from cache. Instead of purging your entire site or individual URLs, you can tag related assets (like all images and descriptions associated with a single product) with surrogate keys, and these grouped URLs can be purged in a single request. | [required] |
**fastly_soft_purge** | Option\<**i32**> | If present, this header triggers the purge to be 'soft', which marks the affected object as stale rather than making it inaccessible. Typically set to \"1\" when used, but the value is not important. | |
### Return type
[**crate::models::PurgeResponse**](PurgeResponse.md)
### Authorization
[token](../README.md#token)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)