---
title: Creates a new event
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/go)

[Cloudforce One](https://developers.cloudflare.com/api/go/resources/cloudforce_one)

[Threat Events](https://developers.cloudflare.com/api/go/resources/cloudforce_one/subresources/threat_events)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Creates a new event

client.CloudforceOne.ThreatEvents.New(ctx, params) (\*[ThreatEventNewResponse](<https://developers.cloudflare.com/api/go/resources/cloudforce_one#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)>), error)

POST/accounts/{account\_id}/cloudforce-one/events/create

To create a dataset, see the [`Create Dataset`](https://developers.cloudflare.com/api/resources/cloudforce_one/subresources/threat_events/subresources/datasets/methods/create/) endpoint. When `datasetId` parameter is unspecified, it will be created in a default dataset named `Cloudforce One Threat Events`.

##### Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. [Create a token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/).

**Example:**`Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY`

##### Accepted Permissions (at least one required)

`Cloudforce One Write``Cloudforce One Read`

##### ParametersExpand Collapse

<details>

<summary>

params ThreatEventNewParams

</summary>

PathAccountID param.Field\[string]

Path param: Account ID.

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20account_id">Link to this property</a>

Category param.Field\[string]

Body param

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20category">Link to this property</a>

Date param.Field\[<a href="https://developers.cloudflare.com/api/go/resources/cloudforce_one/subresources/threat_events/methods/create#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20date%20%3E%20(schema)">Time</a>]

Body param

formatdate-time

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20date">Link to this property</a>

Event param.Field\[string]

Body param

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20event">Link to this property</a>

<details>

<summary>

Raw param.Field\[<a href="https://developers.cloudflare.com/api/go/resources/cloudforce_one/subresources/threat_events/methods/create#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20raw%20%3E%20(schema)">ThreatEventNewParamsRaw</a>]

Body param

</summary>

Data map\[string, unknown]

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20raw%20%3E%20(schema)%20%3E%20(property)%20data">Link to this property</a>

Source stringOptional

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20raw%20%3E%20(schema)%20%3E%20(property)%20source">Link to this property</a>

TLP stringOptional

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20raw%20%3E%20(schema)%20%3E%20(property)%20tlp">Link to this property</a>

</details>

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20raw">Link to this property</a>

TLP param.Field\[string]

Body param

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20tlp">Link to this property</a>

BodyAccountID param.Field\[float64]Optional

Body param

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20accountId">Link to this property</a>

Attacker param.Field\[string]Optional

Body param

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20attacker">Link to this property</a>

AttackerCountry param.Field\[string]Optional

Body param

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20attackerCountry">Link to this property</a>

DatasetID param.Field\[string]Optional

Body param

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20datasetId">Link to this property</a>

Indicator param.Field\[string]Optional

Body param

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20indicator">Link to this property</a>

<details>

<summary>

Indicators param.Field\[\[]ThreatEventNewParamsIndicator]Optional

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

</summary>

IndicatorType string

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

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20indicators%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20indicatorType">Link to this property</a>

Value string

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

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20indicators%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20value">Link to this property</a>

</details>

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20indicators">Link to this property</a>

IndicatorType param.Field\[string]Optional

Body param

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20indicatorType">Link to this property</a>

Insight param.Field\[string]Optional

Body param

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20insight">Link to this property</a>

<details>

<summary>

Source param.Field\[<a href="https://developers.cloudflare.com/api/go/resources/cloudforce_one/subresources/threat_events/methods/create#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20source%20%3E%20(schema)">ThreatEventNewParamsSource</a>]Optional

Body param: Controlled provenance for an event and its indicators derived from a Threat Signals article.

</summary>

ResourceID string

formatuuid

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20source%20%3E%20(schema)%20%3E%20(property)%20resourceId">Link to this property</a>

ResourceType ThreatEventNewParamsSourceResourceType

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20source%20%3E%20(schema)%20%3E%20(property)%20resourceType">Link to this property</a>

System ThreatEventNewParamsSourceSystem

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20source%20%3E%20(schema)%20%3E%20(property)%20system">Link to this property</a>

Title stringOptional

Threat Signals article title; null for historical provenance without a stored title.

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20source%20%3E%20(schema)%20%3E%20(property)%20title">Link to this property</a>

</details>

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20source">Link to this property</a>

Tags param.Field\[\[]string]Optional

Body param

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20tags">Link to this property</a>

TargetCountry param.Field\[string]Optional

Body param

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20targetCountry">Link to this property</a>

TargetIndustry param.Field\[string]Optional

Body param

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20targetIndustry">Link to this property</a>

</details>

[Link to this property](<#(resource)%20cloudforce_one.threat_events%20%3E%20(method)%20create%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

type ThreatEventNewResponse struct{…}

</summary>

Attacker string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20attacker">Link to this property</a>

AttackerCountry string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20attackerCountry">Link to this property</a>

AttackerCountryAlpha3 string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20attackerCountryAlpha3">Link to this property</a>

Category string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20category">Link to this property</a>

DatasetID string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20datasetId">Link to this property</a>

Date string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20date">Link to this property</a>

Event string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20event">Link to this property</a>

HasChildren bool

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20hasChildren">Link to this property</a>

Indicator string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20indicator">Link to this property</a>

IndicatorType string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20indicatorType">Link to this property</a>

IndicatorTypeID float64

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20indicatorTypeId">Link to this property</a>

KillChain float64

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20killChain">Link to this property</a>

MitreAttack \[]string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20mitreAttack">Link to this property</a>

MitreCapec \[]string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20mitreCapec">Link to this property</a>

NumReferenced float64

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20numReferenced">Link to this property</a>

NumReferences float64

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20numReferences">Link to this property</a>

RawID string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20rawId">Link to this property</a>

Referenced \[]string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20referenced">Link to this property</a>

ReferencedIDs \[]float64

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20referencedIds">Link to this property</a>

References \[]string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20references">Link to this property</a>

ReferencesIDs \[]float64

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20referencesIds">Link to this property</a>

Tags \[]string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20tags">Link to this property</a>

TargetCountry string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20targetCountry">Link to this property</a>

TargetCountryAlpha3 string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20targetCountryAlpha3">Link to this property</a>

TargetIndustry string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20targetIndustry">Link to this property</a>

TLP string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20tlp">Link to this property</a>

UUID string

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20uuid">Link to this property</a>

Insight stringOptional

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20insight">Link to this property</a>

ReleasabilityID stringOptional

<a href="#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)%20%3E%20(property)%20releasabilityId">Link to this property</a>

</details>

[Link to this property](<#(resource)%20cloudforce_one.threat_events%20%3E%20(model)%20ThreatEventNewResponse%20%3E%20(schema)>)

### Creates a new event

Go

HTTPTypeScriptPythonGoTerraform

```
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"),
  )
  threatEvent, err := client.CloudforceOne.ThreatEvents.New(context.TODO(), cloudforce_one.ThreatEventNewParams{
    PathAccountID: cloudflare.F("account_id"),
    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.ThreatEventNewParamsRaw{
      Data: cloudflare.F(map[string]interface{}{
      "foo": "bar",
      }),
    }),
    TLP: cloudflare.F("amber"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", threatEvent.UUID)
}
```

200 example

```
{
  "attacker": "Flying Yeti",
  "attackerCountry": "CN",
  "attackerCountryAlpha3": "CHN",
  "category": "Domain Resolution",
  "datasetId": "dataset-example-id",
  "date": "2022-04-01T00:00:00Z",
  "event": "An attacker registered the domain domain.com",
  "hasChildren": true,
  "indicator": "domain.com",
  "indicatorType": "domain",
  "indicatorTypeId": 5,
  "killChain": 0,
  "mitreAttack": [
    " "
  ],
  "mitreCapec": [
    " "
  ],
  "numReferenced": 0,
  "numReferences": 0,
  "rawId": "453gw34w3",
  "referenced": [
    " "
  ],
  "referencedIds": [
    0
  ],
  "references": [
    " "
  ],
  "referencesIds": [
    0
  ],
  "tags": [
    "malware"
  ],
  "targetCountry": "US",
  "targetCountryAlpha3": "USA",
  "targetIndustry": "Agriculture",
  "tlp": "amber",
  "uuid": "12345678-1234-1234-1234-1234567890ab",
  "insight": "insight",
  "releasabilityId": "releasabilityId"
}
```

##### Returns Examples

200 example

```
{
  "attacker": "Flying Yeti",
  "attackerCountry": "CN",
  "attackerCountryAlpha3": "CHN",
  "category": "Domain Resolution",
  "datasetId": "dataset-example-id",
  "date": "2022-04-01T00:00:00Z",
  "event": "An attacker registered the domain domain.com",
  "hasChildren": true,
  "indicator": "domain.com",
  "indicatorType": "domain",
  "indicatorTypeId": 5,
  "killChain": 0,
  "mitreAttack": [
    " "
  ],
  "mitreCapec": [
    " "
  ],
  "numReferenced": 0,
  "numReferences": 0,
  "rawId": "453gw34w3",
  "referenced": [
    " "
  ],
  "referencedIds": [
    0
  ],
  "references": [
    " "
  ],
  "referencesIds": [
    0
  ],
  "tags": [
    "malware"
  ],
  "targetCountry": "US",
  "targetCountryAlpha3": "USA",
  "targetIndustry": "Agriculture",
  "tlp": "amber",
  "uuid": "12345678-1234-1234-1234-1234567890ab",
  "insight": "insight",
  "releasabilityId": "releasabilityId"
}
```