## 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`](https://developers.cloudflare.com/api/resources/cloudforce_one/subresources/threat_events/subresources/datasets/methods/list/) endpoint. ### Parameters - `params ThreatEventBulkNewParams` - `AccountID param.Field[string]` Path param: Account ID. - `Data param.Field[[]ThreatEventBulkNewParamsData]` Body param - `Category string` - `Date Time` - `Event string` - `Raw ThreatEventBulkNewParamsDataRaw` - `Data map[string, unknown]` - `Source string` - `TLP string` - `TLP string` - `AccountID float64` - `Attacker string` - `AttackerCountry string` - `DatasetID string` - `Indicator string` - `Indicators []ThreatEventBulkNewParamsDataIndicator` 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 string` - `Insight string` - `Tags []string` - `TargetCountry string` - `TargetIndustry string` - `DatasetID param.Field[string]` Body param - `IncludeCreatedEvents param.Field[bool]` Body param: When true, response includes array of created event UUIDs and shard IDs. Useful for tracking which events were created and where. ### Returns - `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 string` Correlation ID for async indicator processing - `CreatedEvents []ThreatEventBulkNewResponseCreatedEvent` 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 - `Errors []ThreatEventBulkNewResponseError` Array of error details - `Error string` Error message - `EventIndex float64` Index of the event that caused the error ### Example ```go 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) } ``` #### Response ```json { "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 } ] } ```