---
title: Magic Network Monitoring
---

[Skip to content](#_top)

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

Copy Markdown

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

---

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

# Magic Network Monitoring

#### Magic Network MonitoringVPC Flows

#### Magic Network MonitoringVPC FlowsTokens

##### [Generate authentication token for VPC flow logs export.](https://developers.cloudflare.com/api/python/resources/magic_network_monitoring/subresources/vpc_flows/subresources/tokens/methods/create)

magic\_network\_monitoring.vpc\_flows.tokens.create(TokenCreateParams\*\*kwargs) -> [TokenCreateResponse](<https://developers.cloudflare.com/api/python/resources/magic_network_monitoring#(resource)%20magic_network_monitoring.vpc_flows.tokens%20%3E%20(model)%20token_create_response%20%3E%20(schema)>)

POST/accounts/{account\_id}/mnm/vpc-flows/token

##### ModelsExpand Collapse

str

Authentication token to be used for VPC Flows export authentication.

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

#### Magic Network MonitoringConfigs

##### [List account configuration](https://developers.cloudflare.com/api/python/resources/magic_network_monitoring/subresources/configs/methods/get)

magic\_network\_monitoring.configs.get(ConfigGetParams\*\*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)>)

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

##### [Create account configuration](https://developers.cloudflare.com/api/python/resources/magic_network_monitoring/subresources/configs/methods/create)

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

##### [Update an entire account configuration](https://developers.cloudflare.com/api/python/resources/magic_network_monitoring/subresources/configs/methods/update)

magic\_network\_monitoring.configs.update(ConfigUpdateParams\*\*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)>)

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

##### [Update account configuration fields](https://developers.cloudflare.com/api/python/resources/magic_network_monitoring/subresources/configs/methods/edit)

magic\_network\_monitoring.configs.edit(ConfigEditParams\*\*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)>)

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

##### [Delete account configuration](https://developers.cloudflare.com/api/python/resources/magic_network_monitoring/subresources/configs/methods/delete)

magic\_network\_monitoring.configs.delete(ConfigDeleteParams\*\*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)>)

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

##### ModelsExpand 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)>)

#### Magic Network MonitoringConfigsFull

##### [List rules and account configuration](https://developers.cloudflare.com/api/python/resources/magic_network_monitoring/subresources/configs/subresources/full/methods/get)

magic\_network\_monitoring.configs.full.get(FullGetParams\*\*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)>)

GET/accounts/{account\_id}/mnm/config/full

#### Magic Network MonitoringRules

##### [List rules](https://developers.cloudflare.com/api/python/resources/magic_network_monitoring/subresources/rules/methods/list)

magic\_network\_monitoring.rules.list(RuleListParams\*\*kwargs) -> SyncSinglePage\[Optional\[MagicNetworkMonitoringRule]]

GET/accounts/{account\_id}/mnm/rules

##### [Get rule](https://developers.cloudflare.com/api/python/resources/magic_network_monitoring/subresources/rules/methods/get)

magic\_network\_monitoring.rules.get(strrule\_id, RuleGetParams\*\*kwargs) -> [MagicNetworkMonitoringRule](<https://developers.cloudflare.com/api/python/resources/magic_network_monitoring#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)>)

GET/accounts/{account\_id}/mnm/rules/{rule\_id}

##### [Create rules](https://developers.cloudflare.com/api/python/resources/magic_network_monitoring/subresources/rules/methods/create)

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

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

##### [Update rules](https://developers.cloudflare.com/api/python/resources/magic_network_monitoring/subresources/rules/methods/update)

magic\_network\_monitoring.rules.update(RuleUpdateParams\*\*kwargs) -> [MagicNetworkMonitoringRule](<https://developers.cloudflare.com/api/python/resources/magic_network_monitoring#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)>)

PUT/accounts/{account\_id}/mnm/rules

##### [Update rule](https://developers.cloudflare.com/api/python/resources/magic_network_monitoring/subresources/rules/methods/edit)

magic\_network\_monitoring.rules.edit(strrule\_id, RuleEditParams\*\*kwargs) -> [MagicNetworkMonitoringRule](<https://developers.cloudflare.com/api/python/resources/magic_network_monitoring#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)>)

PATCH/accounts/{account\_id}/mnm/rules/{rule\_id}

##### [Delete rule](https://developers.cloudflare.com/api/python/resources/magic_network_monitoring/subresources/rules/methods/delete)

magic\_network\_monitoring.rules.delete(strrule\_id, RuleDeleteParams\*\*kwargs) -> [MagicNetworkMonitoringRule](<https://developers.cloudflare.com/api/python/resources/magic_network_monitoring#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)>)

DELETE/accounts/{account\_id}/mnm/rules/{rule\_id}

##### ModelsExpand Collapse

<details>

<summary>

class MagicNetworkMonitoringRule: …

</summary>

id: str

The id of the rule. Must be unique.

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

automatic\_advertisement: Optional\[bool]

Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20automatic_advertisement">Link to this property</a>

name: str

The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (\_), dash (-), period (.), and tilde (\~). You can’t have a space in the rule name. Max 256 characters.

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

prefixes: List\[str]

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20prefixes">Link to this property</a>

<details>

<summary>

type: Literal\["threshold", "zscore", "advanced\_ddos"]

MNM rule type.

</summary>

One of the following:

"threshold"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%200">Link to this property</a>

"zscore"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%201">Link to this property</a>

"advanced\_ddos"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20type">Link to this property</a>

bandwidth\_threshold: Optional\[float]

The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.

minimum1

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20bandwidth_threshold">Link to this property</a>

<details>

<summary>

duration: Optional\[Literal\["1m", "5m", "10m", 5 more]]

The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values \[“1m”,“5m”,“10m”,“15m”,“20m”,“30m”,“45m”,“60m”].

</summary>

One of the following:

"1m"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20duration%20%3E%20(member)%200">Link to this property</a>

"5m"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20duration%20%3E%20(member)%201">Link to this property</a>

"10m"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20duration%20%3E%20(member)%202">Link to this property</a>

"15m"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20duration%20%3E%20(member)%203">Link to this property</a>

"20m"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20duration%20%3E%20(member)%204">Link to this property</a>

"30m"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20duration%20%3E%20(member)%205">Link to this property</a>

"45m"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20duration%20%3E%20(member)%206">Link to this property</a>

"60m"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20duration%20%3E%20(member)%207">Link to this property</a>

</details>

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20duration">Link to this property</a>

packet\_threshold: Optional\[float]

The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.

minimum1

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20packet_threshold">Link to this property</a>

<details>

<summary>

prefix\_match: Optional\[Literal\["exact", "subnet", "supernet"]]

Prefix match type to be applied for a prefix auto advertisement when using an advanced\_ddos rule.

</summary>

One of the following:

"exact"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20prefix_match%20%3E%20(member)%200">Link to this property</a>

"subnet"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20prefix_match%20%3E%20(member)%201">Link to this property</a>

"supernet"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20prefix_match%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20prefix_match">Link to this property</a>

<details>

<summary>

zscore\_sensitivity: Optional\[Literal\["low", "medium", "high"]]

Level of sensitivity set for zscore rules.

</summary>

One of the following:

"low"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20zscore_sensitivity%20%3E%20(member)%200">Link to this property</a>

"medium"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20zscore_sensitivity%20%3E%20(member)%201">Link to this property</a>

"high"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20zscore_sensitivity%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20zscore_sensitivity">Link to this property</a>

<details>

<summary>

zscore\_target: Optional\[Literal\["bits", "packets"]]

Target of the zscore rule analysis.

</summary>

One of the following:

"bits"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20zscore_target%20%3E%20(member)%200">Link to this property</a>

"packets"

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20zscore_target%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(model)%20magic_network_monitoring_rule%20%3E%20(schema)%20%3E%20(property)%20zscore_target">Link to this property</a>

</details>

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

#### Magic Network MonitoringRulesAdvertisements

##### [Update advertisement for rule](https://developers.cloudflare.com/api/python/resources/magic_network_monitoring/subresources/rules/subresources/advertisements/methods/edit)

magic\_network\_monitoring.rules.advertisements.edit(strrule\_id, AdvertisementEditParams\*\*kwargs) -> [Advertisement](<https://developers.cloudflare.com/api/python/resources/magic_network_monitoring#(resource)%20magic_network_monitoring.rules.advertisements%20%3E%20(model)%20advertisement%20%3E%20(schema)>)

PATCH/accounts/{account\_id}/mnm/rules/{rule\_id}/advertisement

##### ModelsExpand Collapse

<details>

<summary>

class Advertisement: …

</summary>

automatic\_advertisement: Optional\[bool]

Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.

<a href="#(resource)%20magic_network_monitoring.rules.advertisements%20%3E%20(model)%20advertisement%20%3E%20(schema)%20%3E%20(property)%20automatic_advertisement">Link to this property</a>

</details>

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