Skip to content
Start here

List available account or zone datasets

client.logs.logExplorer.datasets.available.list(AvailableListParams { account_id, zone_id } params?, RequestOptionsoptions?): SinglePage<AvailableDataset { dataset, object_type, schema, timestamp_field } >
GET/{accounts_or_zones}/{account_or_zone_id}/logs/explorer/datasets/available

Returns all dataset types that this account or zone can create. Each entry includes the dataset schema and timestamp field.

The schema shows all possible fields for a dataset. However, not all fields may be available for your account or zone. When creating or updating a dataset, only fields available to your account or zone can be enabled. If you request a field that is not available, you will receive an error.

Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
Accepted Permissions (at least one required)
Logs WriteLogs Read
ParametersExpand Collapse
params: AvailableListParams { account_id, zone_id }
account_id?: string

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

zone_id?: string

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

ReturnsExpand Collapse
AvailableDataset { dataset, object_type, schema, timestamp_field }

A dataset type that the account or zone can create.

dataset: string

Dataset type name (e.g. http_requests).

object_type: "account" | "zone"

Whether this dataset type is account-scoped or zone-scoped.

One of the following:
"account"
"zone"
schema: Schema { properties, required, type }

JSON Schema that describes the fields this dataset exposes.

properties?: Record<string, unknown>
required?: Array<string>
type?: "object"
timestamp_field: string

The primary timestamp field name for this dataset.

List available account or zone datasets

import Cloudflare from 'cloudflare';

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

// Automatically fetches more pages as needed.
for await (const availableDataset of client.logs.logExplorer.datasets.available.list({
  account_id: 'account_id',
})) {
  console.log(availableDataset.dataset);
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "success": true,
  "result": [
    {
      "dataset": "dataset",
      "object_type": "account",
      "schema": {
        "properties": {
          "foo": "bar"
        },
        "required": [
          "string"
        ],
        "type": "object"
      },
      "timestamp_field": "timestamp_field"
    }
  ]
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "success": true,
  "result": [
    {
      "dataset": "dataset",
      "object_type": "account",
      "schema": {
        "properties": {
          "foo": "bar"
        },
        "required": [
          "string"
        ],
        "type": "object"
      },
      "timestamp_field": "timestamp_field"
    }
  ]
}