---
title: Create account configuration
---

[Skip to content](#_top)

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

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

[Configs](https://developers.cloudflare.com/api/python/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

magic\_network\_monitoring.configs.create(ConfigCreateParams\*\*kwargs) -> [Configuration](<https://developers.cloudflare.com/api/python/resources/magic_network_monitoring#(resource)%20magic_network_monitoring.configs%20%3E%20(model)%20configuration%20%3E%20(schema)>)

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

account\_id: str

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

default\_sampling: float

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

minimum1

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

name: str

The account name.

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

router\_ips: Optional\[Sequence\[str]]

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

<details>

<summary>

warp\_devices: Optional\[Iterable\[WARPDevice]]

</summary>

id: str

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: str

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>

router\_ip: str

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>

[Link to this property](<#(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)>)

##### ReturnsExpand Collapse

<details>

<summary>

class Configuration: …

</summary>

default\_sampling: float

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: str

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>

router\_ips: List\[str]

<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>

warp\_devices: List\[WARPDevice]

</summary>

id: str

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: str

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>

router\_ip: str

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

Python

HTTPTypeScriptPythonGoTerraform

```
import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_email=os.environ.get("CLOUDFLARE_EMAIL"),  # This is the default and can be omitted
    api_key=os.environ.get("CLOUDFLARE_API_KEY"),  # This is the default and can be omitted
)
configuration = client.magic_network_monitoring.configs.create(
    account_id="6f91088a406011ed95aed352566e8d4c",
    default_sampling=1,
    name="cloudflare user's account",
)
print(configuration.default_sampling)
```

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
}
```