---
title: dangerously-delete-by-tag
product: vercel
url: /docs/rest-api/edge-cache/dangerously-delete-by-tag
canonical_url: "https://vercel.com/docs/rest-api/edge-cache/dangerously-delete-by-tag"
last_updated: 2026-11-15
type: reference
prerequisites:
  []
related:
  - /docs/rest-api
summary: Learn about dangerously-delete-by-tag on Vercel.
install_vercel_plugin: npx plugins add vercel/vercel-plugin
search_with_vercel_cli: npx vercel@latest docs search "<query>"
---

# Dangerously delete by tag

```http
POST /v1/edge-cache/dangerously-delete-by-tags
```

Marks a cache tag as deleted, causing cache entries associated with that tag to be revalidated in the foreground on the next request. Use this method with caution because one tag can be associated with many paths and deleting the cache can cause many concurrent requests to the origin leading to cache stampede problem. This method is for advanced use cases and is not recommended; prefer using `invalidateByTag` instead.

## Authentication

**bearerToken**: HTTP bearer

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `projectIdOrName` | string | Yes |  |
| `teamId` | string | No | The Team identifier to perform the request on behalf of. |
| `slug` | string | No | The Team slug to perform the request on behalf of. |


## Request body

Required: No

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "tags"
  ],
  "properties": {
    "revalidationDeadlineSeconds": {
      "type": "integer",
      "minimum": 0,
      "maximum": 31536000
    },
    "tags": {
      "oneOf": [
        {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 256
          }
        },
        {
          "type": "string",
          "maxLength": 8196
        }
      ]
    },
    "target": {
      "type": "string",
      "enum": [
        "production",
        "preview"
      ]
    }
  }
}
```

## Example request

### TypeScript

```typescript
const response = await fetch('https://api.vercel.com/v1/edge-cache/dangerously-delete-by-tags?projectIdOrName=string&teamId=string&slug=string', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "revalidationDeadlineSeconds": "123",
    "tags": [],
    "target": "production"
  }),
});

const data = await response.json();
console.log(data);
```

### Next.js

```typescript
'use server';

export async function callEndpoint() {
  const response = await fetch('https://api.vercel.com/v1/edge-cache/dangerously-delete-by-tags?projectIdOrName=string&teamId=string&slug=string', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.VERCEL_ACCESS_TOKEN}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      "revalidationDeadlineSeconds": "123",
      "tags": [],
      "target": "production"
    }),
    next: { revalidate: 3600 }
  });

  if (!response.ok) {
    throw new Error('Request failed');
  }

  return response.json();
}
```

### cURL

```bash
curl -X POST 'https://api.vercel.com/v1/edge-cache/dangerously-delete-by-tags?projectIdOrName=string&teamId=string&slug=string' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d "{
    \"revalidationDeadlineSeconds\": \"123\",
    \"tags\": [],
    \"target\": \"production\"
  }"
```

## Responses

### 200: No description

### 400: One of the provided values in the request body is invalid.
One of the provided values in the request query is invalid.

### 401: The request is not authorized.

### 403: You do not have permission to access this resource.

### 404: No description

### 410: No description

---

## Related

- [edge-cache endpoints](/docs/rest-api#edge-cache)

- [REST API overview](/docs/rest-api)

- [OpenAPI spec](https://vercel.com/openapi.json) (machine-readable, all endpoints)

## Search the docs from your terminal

Search the Vercel docs and read pages as Markdown with the Vercel CLI. No login required.

```bash
# Find docs pages by keyword
npx vercel@latest docs search "environment variables"
npx vercel@latest docs search "function timeout"

# Print a docs page as Markdown, by path or URL
npx vercel@latest docs inspect <page>
```

---

[View full sitemap](/docs/sitemap)


If you encounter incorrect information, can’t find what you need, need a capability Vercel doesn’t currently offer, or have any other feedback to report, please do it by following the instructions at https://vercel.com/feedback.md.
