Create an account or zone dataset
POST/{accounts_or_zones}/{account_or_zone_id}/logs/explorer/datasets
Create a new Log Explorer dataset for the account or zone.
Use the /account or zones/{account or zone_id}/logs/explorer/datasets/available endpoint
to list dataset types you can create along with their available fields.
The fields property is optional. If not specified, all available fields
will be enabled.
For zone-level datasets use the zone-scoped endpoint: POST /zones/{zone_id}/logs/explorer/datasets
For dataset field definitions, see: https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
Accepted Permissions (at least one required)
Path Parameters
Create an account or zone dataset
curl https://api.cloudflare.com/client/v4/$ACCOUNTS_OR_ZONES/$ACCOUNT_OR_ZONE_ID/logs/explorer/datasets \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"dataset": "dataset"
}'{
"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",
"enabled": true,
"object_id": "object_id",
"object_type": "account",
"updated_at": "2019-12-27T18:11:19.117Z",
"fields": [
{
"enabled": true,
"name": "name"
}
]
}
}Returns Examples
{
"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",
"enabled": true,
"object_id": "object_id",
"object_type": "account",
"updated_at": "2019-12-27T18:11:19.117Z",
"fields": [
{
"enabled": true,
"name": "name"
}
]
}
}