Creates bulk events
client.cloudforceOne.threatEvents.bulkCreate(ThreatEventBulkCreateParams { account_id, data, datasetId, includeCreatedEvents } params, RequestOptionsoptions?): ThreatEventBulkCreateResponse { createdEventsCount, createdTagsCount, errorCount, 4 more }
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:
Accepted Permissions (at least one required)
Creates bulk events
import Cloudflare from 'cloudflare';
const client = new Cloudflare({
apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});
const response = await client.cloudforceOne.threatEvents.bulkCreate({
account_id: 'account_id',
data: [
{
category: 'Domain Resolution',
date: '2022-04-01T00:00:00Z',
event: 'An attacker registered the domain domain.com',
raw: { data: { foo: 'bar' } },
tlp: 'amber',
},
],
datasetId: 'durableObjectName',
});
console.log(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
}
]
}