---
title: Create account configuration
---

[Skip to content](#_top)

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

[Magic Network Monitoring](https://developers.cloudflare.com/api/go/resources/magic_network_monitoring)

[Configs](https://developers.cloudflare.com/api/go/resources/magic_network_monitoring/subresources/configs)

Copy Markdown

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

---

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

# Create account configuration

client.MagicNetworkMonitoring.Configs.New(ctx, params) (\*[Configuration](<https://developers.cloudflare.com/api/go/resources/magic_network_monitoring#(resource)%20magic_network_monitoring.configs%20%3E%20(model)%20configuration%20%3E%20(schema)>), error)

POST/accounts/{account\_id}/mnm/config

Create a new network monitoring configuration.

##### Security

API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**`X-Auth-Email: user@example.com`

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**`X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194`

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

`Magic Network Monitoring Admin`

##### ParametersExpand Collapse

<details>

<summary>

params ConfigNewParams

</summary>

AccountID param.Field\[string]

Path param

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

DefaultSampling param.Field\[float64]

Body param: Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.

minimum1

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

Name param.Field\[string]

Body param: The account name.

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

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

Body param

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

<details>

<summary>

WARPDevices param.Field\[\[]ConfigNewParamsWARPDevice]Optional

Body param

</summary>

ID string

Unique identifier for the warp device.

<a href="#(resource)%20magic_network_monitoring.configs%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20warp_devices%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20id">Link to this property</a>

Name string

Name of the warp device.

<a href="#(resource)%20magic_network_monitoring.configs%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20warp_devices%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20name">Link to this property</a>

RouterIP string

IPv4 CIDR of the router sourcing flow data associated with this warp device. Only /32 addresses are currently supported.

<a href="#(resource)%20magic_network_monitoring.configs%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20warp_devices%20%3E%20(schema)%20%3E%20(items)%20%3E%20(property)%20router_ip">Link to this property</a>

</details>

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

</details>

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

##### ReturnsExpand Collapse

<details>

<summary>

type Configuration struct{…}

</summary>

DefaultSampling float64

Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.

minimum1

<a href="#(resource)%20magic_network_monitoring.configs%20%3E%20(model)%20configuration%20%3E%20(schema)%20%3E%20(property)%20default_sampling">Link to this property</a>

Name string

The account name.

<a href="#(resource)%20magic_network_monitoring.configs%20%3E%20(model)%20configuration%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

RouterIPs \[]string

<a href="#(resource)%20magic_network_monitoring.configs%20%3E%20(model)%20configuration%20%3E%20(schema)%20%3E%20(property)%20router_ips">Link to this property</a>

<details>

<summary>

WARPDevices \[]ConfigurationWARPDevice

</summary>

ID string

Unique identifier for the warp device.

<a href="#(resource)%20magic_network_monitoring.configs%20%3E%20(model)%20configuration%20%3E%20(schema)%20%3E%20(property)%20warp_devices%20%3E%20(items)%20%3E%20(property)%20id">Link to this property</a>

Name string

Name of the warp device.

<a href="#(resource)%20magic_network_monitoring.configs%20%3E%20(model)%20configuration%20%3E%20(schema)%20%3E%20(property)%20warp_devices%20%3E%20(items)%20%3E%20(property)%20name">Link to this property</a>

RouterIP string

IPv4 CIDR of the router sourcing flow data associated with this warp device. Only /32 addresses are currently supported.

<a href="#(resource)%20magic_network_monitoring.configs%20%3E%20(model)%20configuration%20%3E%20(schema)%20%3E%20(property)%20warp_devices%20%3E%20(items)%20%3E%20(property)%20router_ip">Link to this property</a>

</details>

<a href="#(resource)%20magic_network_monitoring.configs%20%3E%20(model)%20configuration%20%3E%20(schema)%20%3E%20(property)%20warp_devices">Link to this property</a>

</details>

[Link to this property](<#(resource)%20magic_network_monitoring.configs%20%3E%20(model)%20configuration%20%3E%20(schema)>)

### Create account configuration

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
    option.WithAPIEmail("user@example.com"),
  )
  configuration, err := client.MagicNetworkMonitoring.Configs.New(context.TODO(), magic_network_monitoring.ConfigNewParams{
    AccountID: cloudflare.F("6f91088a406011ed95aed352566e8d4c"),
    DefaultSampling: cloudflare.F(1.000000),
    Name: cloudflare.F("cloudflare user's account"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", configuration.DefaultSampling)
}
```

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "default_sampling": 1,
    "name": "cloudflare user's account",
    "router_ips": [
      "203.0.113.1"
    ],
    "warp_devices": [
      {
        "id": "5360368d-b351-4791-abe1-93550dabd351",
        "name": "My warp device",
        "router_ip": "203.0.113.1"
      }
    ]
  },
  "success": true
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "default_sampling": 1,
    "name": "cloudflare user's account",
    "router_ips": [
      "203.0.113.1"
    ],
    "warp_devices": [
      {
        "id": "5360368d-b351-4791-abe1-93550dabd351",
        "name": "My warp device",
        "router_ip": "203.0.113.1"
      }
    ]
  },
  "success": true
}
```