Skip to content
Start here

Update details about a dataset

client.zeroTrust.dlp.datasets.update(stringdatasetId, DatasetUpdateParams { account_id, case_sensitive, description, name } params, RequestOptionsoptions?): Dataset { id, columns, created_at, 9 more }
PUT/accounts/{account_id}/dlp/datasets/{dataset_id}

Updates the configuration of an existing DLP dataset, such as its name, description, or detection settings.

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 Write
ParametersExpand Collapse
datasetId: string
formatuuid
params: DatasetUpdateParams { account_id, case_sensitive, description, name }
account_id: string

Path param

case_sensitive?: boolean

Body param: Determines if the words should be matched in a case-sensitive manner.

Only required for custom word lists.

description?: string | null

Body param: The description of the dataset.

name?: string | null

Body param: The name of the dataset, must be unique.

ReturnsExpand Collapse
Dataset { id, columns, created_at, 9 more }
id: string
formatuuid
columns: Array<Column>
entry_id: string
formatuuid
header_name: string
num_cells: number
formatint64
upload_status: "empty" | "uploading" | "pending" | 3 more
One of the following:
"empty"
"uploading"
"pending"
"processing"
"failed"
"complete"
created_at: string
formatdate-time
encoding_version: number
formatint32
minimum0
name: string
num_cells: number
formatint64
secret: boolean
status: "empty" | "uploading" | "pending" | 3 more
One of the following:
"empty"
"uploading"
"pending"
"processing"
"failed"
"complete"
updated_at: string

Stores when the dataset was last updated.

This includes name or description changes as well as uploads.

formatdate-time
uploads: Array<Upload>
num_cells: number
formatint64
status: "empty" | "uploading" | "pending" | 3 more
One of the following:
"empty"
"uploading"
"pending"
"processing"
"failed"
"complete"
version: number
formatint64
case_sensitive?: boolean
description?: string | null

The description of the dataset.

Update details about a dataset

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.zeroTrust.dlp.datasets.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
  account_id: 'account_id',
});

console.log(dataset.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"
  }
}