Skip to content
Start here

Fetch all datasets

zero_trust.dlp.datasets.list(DatasetListParams**kwargs) -> SyncSinglePage[Dataset]
GET/accounts/{account_id}/dlp/datasets

Lists all DLP datasets configured for the account, including custom word lists and EDM datasets.

Security
API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Zero Trust ReadZero Trust Write
ParametersExpand Collapse
account_id: str
ReturnsExpand Collapse
class Dataset:
id: str
formatuuid
columns: List[Column]
entry_id: str
formatuuid
header_name: str
num_cells: int
formatint64
upload_status: Literal["empty", "uploading", "pending", 3 more]
One of the following:
"empty"
"uploading"
"pending"
"processing"
"failed"
"complete"
created_at: datetime
formatdate-time
encoding_version: int
formatint32
minimum0
name: str
num_cells: int
formatint64
secret: bool
status: Literal["empty", "uploading", "pending", 3 more]
One of the following:
"empty"
"uploading"
"pending"
"processing"
"failed"
"complete"
updated_at: datetime

Stores when the dataset was last updated.

This includes name or description changes as well as uploads.

formatdate-time
uploads: List[Upload]
num_cells: int
formatint64
status: Literal["empty", "uploading", "pending", 3 more]
One of the following:
"empty"
"uploading"
"pending"
"processing"
"failed"
"complete"
version: int
formatint64
case_sensitive: Optional[bool]
description: Optional[str]

The description of the dataset.

Fetch all datasets

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
page = client.zero_trust.dlp.datasets.list(
    account_id="account_id",
)
page = page.result[0]
print(page.id)
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "columns": [
        {
          "entry_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "header_name": "header_name",
          "num_cells": 0,
          "upload_status": "empty"
        }
      ],
      "created_at": "2019-12-27T18:11:19.117Z",
      "encoding_version": 0,
      "name": "name",
      "num_cells": 0,
      "secret": true,
      "status": "empty",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "uploads": [
        {
          "num_cells": 0,
          "status": "empty",
          "version": 0
        }
      ],
      "case_sensitive": true,
      "description": "description"
    }
  ]
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "columns": [
        {
          "entry_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "header_name": "header_name",
          "num_cells": 0,
          "upload_status": "empty"
        }
      ],
      "created_at": "2019-12-27T18:11:19.117Z",
      "encoding_version": 0,
      "name": "name",
      "num_cells": 0,
      "secret": true,
      "status": "empty",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "uploads": [
        {
          "num_cells": 0,
          "status": "empty",
          "version": 0
        }
      ],
      "case_sensitive": true,
      "description": "description"
    }
  ]
}