Skip to content
Start here

Creates bulk events

client.CloudforceOne.ThreatEvents.BulkNew(ctx, params) (*ThreatEventBulkNewResponse, error)
POST/accounts/{account_id}/cloudforce-one/events/create/bulk

The datasetId parameter must be defined. To list existing datasets (and their IDs) in your account, use the List Datasets endpoint.

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)
Cloudforce One WriteCloudforce One Read
ParametersExpand Collapse
params ThreatEventBulkNewParams
AccountID param.Field[string]

Path param: Account ID.

Data param.Field[[]ThreatEventBulkNewParamsData]

Body param

Category string
Date Time
formatdate-time
Event string
Raw ThreatEventBulkNewParamsDataRaw
Data map[string, unknown]
Source stringoptional
TLP stringoptional
TLP string
AccountID float64optional
Attacker stringoptional
AttackerCountry stringoptional
DatasetID stringoptional
Indicator stringoptional
Indicators []ThreatEventBulkNewParamsDataIndicatoroptional

Array of indicators for this event. Supports multiple indicators per event for complex scenarios.

IndicatorType string

The type of indicator (e.g., DOMAIN, IP, JA3, HASH)

Value string

The indicator value (e.g., domain name, IP address, hash)

IndicatorType stringoptional
Insight stringoptional
Tags []stringoptional
TargetCountry stringoptional
TargetIndustry stringoptional
DatasetID param.Field[string]

Body param

IncludeCreatedEvents param.Field[bool]optional

Body param: When true, response includes array of created event UUIDs and shard IDs. Useful for tracking which events were created and where.

ReturnsExpand Collapse
type ThreatEventBulkNewResponse struct{…}

Detailed result of bulk event creation with auto-tag management

CreatedEventsCount float64

Number of events created

CreatedTagsCount float64

Number of new tags created in SoT

ErrorCount float64

Number of errors encountered

QueuedIndicatorsCount float64

Number of indicators queued for async processing

CreateBulkEventsRequestID stringoptional

Correlation ID for async indicator processing

formatuuid
CreatedEvents []ThreatEventBulkNewResponseCreatedEventoptional

Array of created events with UUIDs and shard locations. Only present when includeCreatedEvents=true

EventIndex float64

Original index in the input data array

ShardID string

Dataset ID of the shard where the event was created

UUID string

UUID of the created event

formatuuid
Errors []ThreatEventBulkNewResponseErroroptional

Array of error details

Error string

Error message

EventIndex float64

Index of the event that caused the error

Creates bulk events

package main

import (
  "context"
  "fmt"
  "time"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/cloudforce_one"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.CloudforceOne.ThreatEvents.BulkNew(context.TODO(), cloudforce_one.ThreatEventBulkNewParams{
    AccountID: cloudflare.F("account_id"),
    Data: cloudflare.F([]cloudforce_one.ThreatEventBulkNewParamsData{cloudforce_one.ThreatEventBulkNewParamsData{
      Category: cloudflare.F("Domain Resolution"),
      Date: cloudflare.F(time.Now()),
      Event: cloudflare.F("An attacker registered the domain domain.com"),
      Raw: cloudflare.F(cloudforce_one.ThreatEventBulkNewParamsDataRaw{
        Data: cloudflare.F(map[string]interface{}{
        "foo": "bar",
        }),
      }),
      TLP: cloudflare.F("amber"),
    }}),
    DatasetID: cloudflare.F("durableObjectName"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.CreatedEventsCount)
}
{
  "createdEventsCount": 0,
  "createdTagsCount": 0,
  "errorCount": 0,
  "queuedIndicatorsCount": 0,
  "createBulkEventsRequestId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "createdEvents": [
    {
      "eventIndex": 0,
      "shardId": "shardId",
      "uuid": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
    }
  ],
  "errors": [
    {
      "error": "error",
      "eventIndex": 0
    }
  ]
}
Returns Examples
{
  "createdEventsCount": 0,
  "createdTagsCount": 0,
  "errorCount": 0,
  "queuedIndicatorsCount": 0,
  "createBulkEventsRequestId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "createdEvents": [
    {
      "eventIndex": 0,
      "shardId": "shardId",
      "uuid": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
    }
  ],
  "errors": [
    {
      "error": "error",
      "eventIndex": 0
    }
  ]
}