## Create a new dataset `client.zeroTrust.dlp.datasets.create(DatasetCreateParamsparams, RequestOptionsoptions?): DatasetCreation` **post** `/accounts/{account_id}/dlp/datasets` Creates a new DLP (Data Loss Prevention) dataset for storing custom detection patterns. Datasets can contain exact match data, word lists, or EDM (Exact Data Match) configurations. ### Parameters - `params: DatasetCreateParams` - `account_id: string` Path param - `name: string` Body param - `case_sensitive?: boolean` Body param: Only applies to custom word lists. Determines if the words should be matched in a case-sensitive manner Cannot be set to false if `secret` is true or undefined - `description?: string | null` Body param: The description of the dataset. - `encoding_version?: number` Body param: Dataset encoding version Non-secret custom word lists with no header are always version 1. Secret EDM lists with no header are version 1. Multicolumn CSV with headers are version 2. Omitting this field provides the default value 0, which is interpreted the same as 1. - `secret?: boolean` Body param: Generate a secret dataset. If true, the response will include a secret to use with the EDM encoder. If false, the response has no secret and the dataset is uploaded in plaintext. ### Returns - `DatasetCreation` - `dataset: Dataset` - `id: string` - `columns: Array` - `entry_id: string` - `header_name: string` - `num_cells: number` - `upload_status: "empty" | "uploading" | "pending" | 3 more` - `"empty"` - `"uploading"` - `"pending"` - `"processing"` - `"failed"` - `"complete"` - `created_at: string` - `encoding_version: number` - `name: string` - `num_cells: number` - `secret: boolean` - `status: "empty" | "uploading" | "pending" | 3 more` - `"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. - `uploads: Array` - `num_cells: number` - `status: "empty" | "uploading" | "pending" | 3 more` - `"empty"` - `"uploading"` - `"pending"` - `"processing"` - `"failed"` - `"complete"` - `version: number` - `case_sensitive?: boolean` - `description?: string | null` The description of the dataset. - `encoding_version: number` Encoding version to use for dataset. - `max_cells: number` - `version: number` The version to use when uploading the dataset. - `secret?: string` The secret to use for Exact Data Match datasets. This is not present in Custom Wordlists. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const datasetCreation = await client.zeroTrust.dlp.datasets.create({ account_id: 'account_id', name: 'name', }); console.log(datasetCreation.dataset); ``` #### Response ```json { "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": { "dataset": { "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" }, "encoding_version": 0, "max_cells": 0, "version": 0, "secret": "secret" } } ```