> This page is for Entria API Reference.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.navipartner.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.navipartner.com/_mcp/server.

# Clear CloudFlare cache

DELETE https://api.entria.app/api/cache

Purges your own store's cached Entria data. Requires `Authorization: Bearer <token>` (from `POST /oauth/token`) minted for the store named on the `x-entria` header. Two modes, and they cannot be combined: set `tag` (`entria-products`, `entria-categories`, `entria-agreements`, or `entria-members` for the 5-minute member lookups and renewal lists) to purge your store's copy of that tag, or set `key` to drop a single cached item — `cart_…` ids are supported, and the response reports `purged: false` when nothing was cached for that key, which is not an error. `purgedTags` in the response always names the tag that was actually purged.

Reference: https://docs.navipartner.com/entria-api/entria-api-reference/misc/delete-clear-cache

## Authentication

- `Authorization` header (bearer token, required) — OAuth client token, for a partner backend only. A short-lived access token for endpoints that return personal data about any member. Obtain one from POST /oauth/token (RFC 7523 JWT-bearer), signing the assertion with the private key of the key pair registered for your store. Sent as `Authorization: Bearer <token>`. This is separate from the `x-entria` store header, which is still required.

## Request

### Query parameters

- `tag` (ApiCacheDeleteParametersTag, optional) — The catalog Cache-Tag to purge for your store. Required unless `key` is set.
- `key` (string, optional) — Purge one individually-cached item instead of a tag. The entity is taken from the id prefix; `cart_…` is the only one supported. Cannot be combined with `tag`.

### Headers

- `x-entria` (string, required) — Identifies which store this request is for. Required on every store-scoped route. It is not authentication and not a secret — it grants no privileges and is safe to send from a browser. You receive the value once your Entria backend has been created and configured. Missing header returns 400; an unknown store returns 404.

## Response

### 200

Cache cleared successfully

- `message` (string, required)
- `purgedTags` (list of string, required)
- `purgedKey` (string, optional) — Set when `key` was purged.
- `purged` (boolean, optional) — Set when `key` was purged: false means nothing was cached for it, which is not an error.

## Errors

### 400 Bad Request Error

The `x-entria` header is missing, neither or both of `tag` and `key` were given, or the key is not a supported id.

- `error` (string, required)
- `code` (string, optional)
- `details` (list of ErrorResponseDetailsItems, optional) — Per-field validation failures; present when code is VALIDATION_ERROR.
- `success` (boolean, optional, deprecated) — Deprecated. Use code === VALIDATION_ERROR.
- `errors` (list of any, optional, deprecated) — Deprecated. Raw zod issues; use details instead.

### 401 Unauthorized Error

Missing or invalid Bearer token

- `error` (string, required)
- `code` (string, optional)
- `details` (list of ErrorResponseDetailsItems, optional) — Per-field validation failures; present when code is VALIDATION_ERROR.
- `success` (boolean, optional, deprecated) — Deprecated. Use code === VALIDATION_ERROR.
- `errors` (list of any, optional, deprecated) — Deprecated. Raw zod issues; use details instead.

### 403 Forbidden Error

The access token is valid but was minted for a different store, or API auth is not enabled for this store.

- `error` (string, required)
- `code` (string, optional)
- `details` (list of ErrorResponseDetailsItems, optional) — Per-field validation failures; present when code is VALIDATION_ERROR.
- `success` (boolean, optional, deprecated) — Deprecated. Use code === VALIDATION_ERROR.
- `errors` (list of any, optional, deprecated) — Deprecated. Raw zod issues; use details instead.

### 404 Not Found Error

The `x-entria` store handle is not a known store.

- `error` (string, required)
- `code` (string, optional)
- `details` (list of ErrorResponseDetailsItems, optional) — Per-field validation failures; present when code is VALIDATION_ERROR.
- `success` (boolean, optional, deprecated) — Deprecated. Use code === VALIDATION_ERROR.
- `errors` (list of any, optional, deprecated) — Deprecated. Raw zod issues; use details instead.

### 500 Internal Server Error

Error clearing cache. The response carries a fixed message; the detail is reported to Entria.

- `error` (string, required)
- `code` (string, optional)
- `details` (list of ErrorResponseDetailsItems, optional) — Per-field validation failures; present when code is VALIDATION_ERROR.
- `success` (boolean, optional, deprecated) — Deprecated. Use code === VALIDATION_ERROR.
- `errors` (list of any, optional, deprecated) — Deprecated. Raw zod issues; use details instead.

### 503 Service Unavailable Error

This environment cannot serve the request, and answering 200 would report a purge that did not happen. Two causes: a `key` purge where no cart-cache binding is configured, and any request where the API auth secret is not configured. Both are operator-side; retrying will not clear either.

- `error` (string, required)
- `code` (string, optional)
- `details` (list of ErrorResponseDetailsItems, optional) — Per-field validation failures; present when code is VALIDATION_ERROR.
- `success` (boolean, optional, deprecated) — Deprecated. Use code === VALIDATION_ERROR.
- `errors` (list of any, optional, deprecated) — Deprecated. Raw zod issues; use details instead.

## Types

### ApiCacheDeleteParametersTag

The catalog Cache-Tag to purge for your store. Required unless `key` is set.

- enum
  - Allowed values: `entria-products`, `entria-categories`, `entria-agreements`, `entria-members`
- enum
  - Allowed values: ``

### ErrorResponseDetailsItems

- `path` (string, required)
- `message` (string, required)

## Examples

**Response**

```json
{
  "message": "string",
  "purgedTags": [
    "string"
  ],
  "purgedKey": "string",
  "purged": true
}
```

**SDK Code**

```python
import requests

url = "https://api.entria.app/api/cache"

headers = {
    "x-entria": "x-entria",
    "Authorization": "Bearer <token>"
}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.entria.app/api/cache';
const options = {
  method: 'DELETE',
  headers: {'x-entria': 'x-entria', Authorization: 'Bearer <token>'}
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.entria.app/api/cache"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("x-entria", "x-entria")
	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.entria.app/api/cache")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["x-entria"] = 'x-entria'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.entria.app/api/cache")
  .header("x-entria", "x-entria")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.entria.app/api/cache', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'x-entria' => 'x-entria',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.entria.app/api/cache");
var request = new RestRequest(Method.DELETE);
request.AddHeader("x-entria", "x-entria");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-entria": "x-entria",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.entria.app/api/cache")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```