---
title: Delete an account or zone dataset
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/typescript)

[Logs](https://developers.cloudflare.com/api/typescript/resources/logs)

[Log Explorer](https://developers.cloudflare.com/api/typescript/resources/logs/subresources/log_explorer)

[Datasets](https://developers.cloudflare.com/api/typescript/resources/logs/subresources/log_explorer/subresources/datasets)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Delete an account or zone dataset

client.logs.logExplorer.datasets.delete(stringdatasetID, DatasetDeleteParams {account\_id, zone\_id } params?, RequestOptionsoptions?): [Dataset](<https://developers.cloudflare.com/api/typescript/resources/logs#(resource)%20logs.log_explorer.datasets%20%3E%20(model)%20dataset%20%3E%20(schema)>) {created\_at, dataset, dataset\_id, 8 more }

DELETE/{accounts\_or\_zones}/{account\_or\_zone\_id}/logs/explorer/datasets/{dataset\_id}

Deletes a Log Explorer dataset for the account or zone. Dataset deletion must not be protected.

##### Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. [Create a token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/).

**Example:**`Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY`

##### ParametersExpand Collapse

datasetID: string

[Link to this property](<#(resource)%20logs.log_explorer.datasets%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20dataset_id%20%3E%20(schema)>)

<details>

<summary>

params: DatasetDeleteParams {account\_id, zone\_id }

</summary>

account\_id?: string

The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.

<a href="#(resource)%20logs.log_explorer.datasets%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20account_id">Link to this property</a>

zone\_id?: string

The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.

<a href="#(resource)%20logs.log_explorer.datasets%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20zone_id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20logs.log_explorer.datasets%20%3E%20(method)%20delete%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

Dataset {created\_at, dataset, dataset\_id, 8 more }

A Log Explorer dataset summary. List endpoints return this type and omit field configuration; use the single-dataset endpoint to retrieve it.

</summary>

created\_at: string

RFC3339 timestamp recording when the API created this dataset.

formatdate-time

<a href="#(resource)%20logs.log_explorer.datasets%20%3E%20(model)%20dataset%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

dataset: string

Dataset type name (e.g. <code>http_requests</code>).

<a href="#(resource)%20logs.log_explorer.datasets%20%3E%20(model)%20dataset%20%3E%20(schema)%20%3E%20(property)%20dataset">Link to this property</a>

dataset\_id: string

Unique dataset ID.

<a href="#(resource)%20logs.log_explorer.datasets%20%3E%20(model)%20dataset%20%3E%20(schema)%20%3E%20(property)%20dataset_id">Link to this property</a>

deletion\_protection: boolean

Whether deletion is blocked. Set to <code>false</code> before deleting the dataset.

<a href="#(resource)%20logs.log_explorer.datasets%20%3E%20(model)%20dataset%20%3E%20(schema)%20%3E%20(property)%20deletion_protection">Link to this property</a>

enabled: boolean

Whether log ingest is currently active for this dataset.

<a href="#(resource)%20logs.log_explorer.datasets%20%3E%20(model)%20dataset%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

<details>

<summary>

fields: Array&lt;Field&gt;

The field configuration for this dataset.

</summary>

enabled: boolean

Whether the API includes this field in log ingest.

<a href="#(resource)%20logs.log_explorer.datasets%20%3E%20(model)%20dataset%20%3E%20(schema)%20%3E%20(property)%20fields%20%3E%20(items)%20%3E%20(property)%20enabled">Link to this property</a>

name: string

Field name in lowercase.

<a href="#(resource)%20logs.log_explorer.datasets%20%3E%20(model)%20dataset%20%3E%20(schema)%20%3E%20(property)%20fields%20%3E%20(items)%20%3E%20(property)%20name">Link to this property</a>

</details>

<a href="#(resource)%20logs.log_explorer.datasets%20%3E%20(model)%20dataset%20%3E%20(schema)%20%3E%20(property)%20fields">Link to this property</a>

object\_id: string

Public ID of the account or zone that owns this dataset.

<a href="#(resource)%20logs.log_explorer.datasets%20%3E%20(model)%20dataset%20%3E%20(schema)%20%3E%20(property)%20object_id">Link to this property</a>

<details>

<summary>

object\_type: "account"| "zone"

Whether this dataset belongs to an account or a zone.

</summary>

One of the following:

"account"

<a href="#(resource)%20logs.log_explorer.datasets%20%3E%20(model)%20dataset%20%3E%20(schema)%20%3E%20(property)%20object_type%20%3E%20(member)%200">Link to this property</a>

"zone"

<a href="#(resource)%20logs.log_explorer.datasets%20%3E%20(model)%20dataset%20%3E%20(schema)%20%3E%20(property)%20object_type%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20logs.log_explorer.datasets%20%3E%20(model)%20dataset%20%3E%20(schema)%20%3E%20(property)%20object_type">Link to this property</a>

updated\_at: string

RFC3339 timestamp recording when the API last updated this dataset.

formatdate-time

<a href="#(resource)%20logs.log_explorer.datasets%20%3E%20(model)%20dataset%20%3E%20(schema)%20%3E%20(property)%20updated_at">Link to this property</a>

filter?: string

The Logpush filter predicate applied to this dataset. Omitted when no filter is set.

<a href="#(resource)%20logs.log_explorer.datasets%20%3E%20(model)%20dataset%20%3E%20(schema)%20%3E%20(property)%20filter">Link to this property</a>

filter\_attack\_traffic?: boolean

Whether the Logpush job filters attack traffic. Omitted for datasets that do not support this option.

<a href="#(resource)%20logs.log_explorer.datasets%20%3E%20(model)%20dataset%20%3E%20(schema)%20%3E%20(property)%20filter_attack_traffic">Link to this property</a>

</details>

[Link to this property](<#(resource)%20logs.log_explorer.datasets%20%3E%20(model)%20dataset%20%3E%20(schema)>)

### Delete an account or zone dataset

TypeScript

HTTPTypeScriptPythonGoTerraform

```
import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const dataset = await client.logs.logExplorer.datasets.delete('dataset_id', {
  account_id: 'account_id',
});

console.log(dataset.dataset_id);
```

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "success": true,
  "result": {
    "created_at": "2019-12-27T18:11:19.117Z",
    "dataset": "dataset",
    "dataset_id": "dataset_id",
    "deletion_protection": true,
    "enabled": true,
    "fields": [
      {
        "enabled": true,
        "name": "name"
      }
    ],
    "object_id": "object_id",
    "object_type": "account",
    "updated_at": "2019-12-27T18:11:19.117Z",
    "filter": "filter",
    "filter_attack_traffic": true
  }
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "success": true,
  "result": {
    "created_at": "2019-12-27T18:11:19.117Z",
    "dataset": "dataset",
    "dataset_id": "dataset_id",
    "deletion_protection": true,
    "enabled": true,
    "fields": [
      {
        "enabled": true,
        "name": "name"
      }
    ],
    "object_id": "object_id",
    "object_type": "account",
    "updated_at": "2019-12-27T18:11:19.117Z",
    "filter": "filter",
    "filter_attack_traffic": true
  }
}
```