---
title: TCP Flow Protection
---

[Skip to content](#%5Ftop) 

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

[DDoS Protection](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection)

[Advanced TCP Protection](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection/subresources/advanced%5Ftcp%5Fprotection)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# TCP Flow Protection

#### TCP Flow ProtectionFilters

##### [List all TCP Flow Protection filters.](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection/subresources/advanced%5Ftcp%5Fprotection/subresources/tcp%5Fflow%5Fprotection/subresources/filters/methods/list)

ddos\_protection.advanced\_tcp\_protection.tcp\_flow\_protection.filters.list(FilterListParams\*\*kwargs)  \-> SyncV4PagePaginationArray\[[FilterListResponse](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection#%28resource%29%20ddos%5Fprotection.advanced%5Ftcp%5Fprotection.tcp%5Fflow%5Fprotection.filters%20%3E%20%28model%29%20filter%5Flist%5Fresponse%20%3E%20%28schema%29)\]

GET/accounts/{account\_id}/magic/advanced\_tcp\_protection/configs/tcp\_flow\_protection/filters

##### [Create a TCP Flow Protection filter.](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection/subresources/advanced%5Ftcp%5Fprotection/subresources/tcp%5Fflow%5Fprotection/subresources/filters/methods/create)

ddos\_protection.advanced\_tcp\_protection.tcp\_flow\_protection.filters.create(FilterCreateParams\*\*kwargs)  \-> [FilterCreateResponse](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection#%28resource%29%20ddos%5Fprotection.advanced%5Ftcp%5Fprotection.tcp%5Fflow%5Fprotection.filters%20%3E%20%28model%29%20filter%5Fcreate%5Fresponse%20%3E%20%28schema%29)

POST/accounts/{account\_id}/magic/advanced\_tcp\_protection/configs/tcp\_flow\_protection/filters

##### [Delete all TCP Flow Protection filters.](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection/subresources/advanced%5Ftcp%5Fprotection/subresources/tcp%5Fflow%5Fprotection/subresources/filters/methods/bulk%5Fdelete)

ddos\_protection.advanced\_tcp\_protection.tcp\_flow\_protection.filters.bulk\_delete(FilterBulkDeleteParams\*\*kwargs)  \-> [FilterBulkDeleteResponse](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection#%28resource%29%20ddos%5Fprotection.advanced%5Ftcp%5Fprotection.tcp%5Fflow%5Fprotection.filters%20%3E%20%28model%29%20filter%5Fbulk%5Fdelete%5Fresponse%20%3E%20%28schema%29)

DELETE/accounts/{account\_id}/magic/advanced\_tcp\_protection/configs/tcp\_flow\_protection/filters

##### ModelsExpand Collapse 

class FilterListResponse: …

id: str

The unique ID of the expression filter.

created\_on: datetime

The creation timestamp of the expression filter.

formatdate-time

expression: str

The filter expression.

mode: str

The filter’s mode. Must be one of ‘enabled’, ‘disabled’, ‘monitoring’.

modified\_on: datetime

The last modification timestamp of the expression filter.

formatdate-time

class FilterCreateResponse: …

id: str

The unique ID of the expression filter.

created\_on: datetime

The creation timestamp of the expression filter.

formatdate-time

expression: str

The filter expression.

mode: str

The filter’s mode. Must be one of ‘enabled’, ‘disabled’, ‘monitoring’.

modified\_on: datetime

The last modification timestamp of the expression filter.

formatdate-time

class FilterBulkDeleteResponse: …

errors: List\[Error\]

code: int

minimum1000

message: str

documentation\_url: Optional\[str\]

source: Optional\[ErrorSource\]

pointer: Optional\[str\]

messages: List\[Message\]

code: int

minimum1000

message: str

documentation\_url: Optional\[str\]

source: Optional\[MessageSource\]

pointer: Optional\[str\]

success: Literal\[true\]

Whether the API call was successful.

#### TCP Flow ProtectionFiltersItems

##### [Get TCP Flow Protection filter.](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection/subresources/advanced%5Ftcp%5Fprotection/subresources/tcp%5Fflow%5Fprotection/subresources/filters/subresources/items/methods/get)

ddos\_protection.advanced\_tcp\_protection.tcp\_flow\_protection.filters.items.get(strfilter\_id, ItemGetParams\*\*kwargs)  \-> [ItemGetResponse](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection#%28resource%29%20ddos%5Fprotection.advanced%5Ftcp%5Fprotection.tcp%5Fflow%5Fprotection.filters.items%20%3E%20%28model%29%20item%5Fget%5Fresponse%20%3E%20%28schema%29)

GET/accounts/{account\_id}/magic/advanced\_tcp\_protection/configs/tcp\_flow\_protection/filters/{filter\_id}

##### [Update TCP Flow Protection filter.](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection/subresources/advanced%5Ftcp%5Fprotection/subresources/tcp%5Fflow%5Fprotection/subresources/filters/subresources/items/methods/edit)

ddos\_protection.advanced\_tcp\_protection.tcp\_flow\_protection.filters.items.edit(strfilter\_id, ItemEditParams\*\*kwargs)  \-> [ItemEditResponse](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection#%28resource%29%20ddos%5Fprotection.advanced%5Ftcp%5Fprotection.tcp%5Fflow%5Fprotection.filters.items%20%3E%20%28model%29%20item%5Fedit%5Fresponse%20%3E%20%28schema%29)

PATCH/accounts/{account\_id}/magic/advanced\_tcp\_protection/configs/tcp\_flow\_protection/filters/{filter\_id}

##### [Delete TCP Flow Protection filter.](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection/subresources/advanced%5Ftcp%5Fprotection/subresources/tcp%5Fflow%5Fprotection/subresources/filters/subresources/items/methods/delete)

ddos\_protection.advanced\_tcp\_protection.tcp\_flow\_protection.filters.items.delete(strfilter\_id, ItemDeleteParams\*\*kwargs)  \-> [ItemDeleteResponse](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection#%28resource%29%20ddos%5Fprotection.advanced%5Ftcp%5Fprotection.tcp%5Fflow%5Fprotection.filters.items%20%3E%20%28model%29%20item%5Fdelete%5Fresponse%20%3E%20%28schema%29)

DELETE/accounts/{account\_id}/magic/advanced\_tcp\_protection/configs/tcp\_flow\_protection/filters/{filter\_id}

##### ModelsExpand Collapse 

class ItemGetResponse: …

id: str

The unique ID of the expression filter.

created\_on: datetime

The creation timestamp of the expression filter.

formatdate-time

expression: str

The filter expression.

mode: str

The filter’s mode. Must be one of ‘enabled’, ‘disabled’, ‘monitoring’.

modified\_on: datetime

The last modification timestamp of the expression filter.

formatdate-time

class ItemEditResponse: …

id: str

The unique ID of the expression filter.

created\_on: datetime

The creation timestamp of the expression filter.

formatdate-time

expression: str

The filter expression.

mode: str

The filter’s mode. Must be one of ‘enabled’, ‘disabled’, ‘monitoring’.

modified\_on: datetime

The last modification timestamp of the expression filter.

formatdate-time

class ItemDeleteResponse: …

errors: List\[Error\]

code: int

minimum1000

message: str

documentation\_url: Optional\[str\]

source: Optional\[ErrorSource\]

pointer: Optional\[str\]

messages: List\[Message\]

code: int

minimum1000

message: str

documentation\_url: Optional\[str\]

source: Optional\[MessageSource\]

pointer: Optional\[str\]

success: Literal\[true\]

Whether the API call was successful.

#### TCP Flow ProtectionRules

##### [List all TCP Flow Protection rules.](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection/subresources/advanced%5Ftcp%5Fprotection/subresources/tcp%5Fflow%5Fprotection/subresources/rules/methods/list)

ddos\_protection.advanced\_tcp\_protection.tcp\_flow\_protection.rules.list(RuleListParams\*\*kwargs)  \-> SyncV4PagePaginationArray\[[RuleListResponse](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection#%28resource%29%20ddos%5Fprotection.advanced%5Ftcp%5Fprotection.tcp%5Fflow%5Fprotection.rules%20%3E%20%28model%29%20rule%5Flist%5Fresponse%20%3E%20%28schema%29)\]

GET/accounts/{account\_id}/magic/advanced\_tcp\_protection/configs/tcp\_flow\_protection/rules

##### [Create TCP Flow Protection rule.](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection/subresources/advanced%5Ftcp%5Fprotection/subresources/tcp%5Fflow%5Fprotection/subresources/rules/methods/create)

ddos\_protection.advanced\_tcp\_protection.tcp\_flow\_protection.rules.create(RuleCreateParams\*\*kwargs)  \-> [RuleCreateResponse](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection#%28resource%29%20ddos%5Fprotection.advanced%5Ftcp%5Fprotection.tcp%5Fflow%5Fprotection.rules%20%3E%20%28model%29%20rule%5Fcreate%5Fresponse%20%3E%20%28schema%29)

POST/accounts/{account\_id}/magic/advanced\_tcp\_protection/configs/tcp\_flow\_protection/rules

##### [Delete all TCP Flow Protection rules.](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection/subresources/advanced%5Ftcp%5Fprotection/subresources/tcp%5Fflow%5Fprotection/subresources/rules/methods/bulk%5Fdelete)

ddos\_protection.advanced\_tcp\_protection.tcp\_flow\_protection.rules.bulk\_delete(RuleBulkDeleteParams\*\*kwargs)  \-> [RuleBulkDeleteResponse](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection#%28resource%29%20ddos%5Fprotection.advanced%5Ftcp%5Fprotection.tcp%5Fflow%5Fprotection.rules%20%3E%20%28model%29%20rule%5Fbulk%5Fdelete%5Fresponse%20%3E%20%28schema%29)

DELETE/accounts/{account\_id}/magic/advanced\_tcp\_protection/configs/tcp\_flow\_protection/rules

##### ModelsExpand Collapse 

class RuleListResponse: …

id: str

The unique ID of the TCP Flow Protection rule.

burst\_sensitivity: str

The burst sensitivity. Must be one of ‘low’, ‘medium’, ‘high’.

created\_on: datetime

The creation timestamp of the TCP Flow Protection rule.

formatdate-time

mode: str

The mode for TCP Flow Protection. Must be one of ‘enabled’, ‘disabled’, ‘monitoring’.

modified\_on: datetime

The last modification timestamp of the TCP Flow Protection rule.

formatdate-time

name: str

The name of the TCP Flow Protection rule. Value is relative to the ‘scope’ setting. For ‘global’ scope, name should be ‘global’. For either the ‘region’ or ‘datacenter’ scope, name should be the actual name of the region or datacenter, e.g., ‘wnam’ or ‘lax’.

rate\_sensitivity: str

The rate sensitivity. Must be one of ‘low’, ‘medium’, ‘high’.

scope: str

The scope for the TCP Flow Protection rule. Must be one of ‘global’, ‘region’, or ‘datacenter’.

class RuleCreateResponse: …

id: str

The unique ID of the TCP Flow Protection rule.

burst\_sensitivity: str

The burst sensitivity. Must be one of ‘low’, ‘medium’, ‘high’.

created\_on: datetime

The creation timestamp of the TCP Flow Protection rule.

formatdate-time

mode: str

The mode for TCP Flow Protection. Must be one of ‘enabled’, ‘disabled’, ‘monitoring’.

modified\_on: datetime

The last modification timestamp of the TCP Flow Protection rule.

formatdate-time

name: str

The name of the TCP Flow Protection rule. Value is relative to the ‘scope’ setting. For ‘global’ scope, name should be ‘global’. For either the ‘region’ or ‘datacenter’ scope, name should be the actual name of the region or datacenter, e.g., ‘wnam’ or ‘lax’.

rate\_sensitivity: str

The rate sensitivity. Must be one of ‘low’, ‘medium’, ‘high’.

scope: str

The scope for the TCP Flow Protection rule. Must be one of ‘global’, ‘region’, or ‘datacenter’.

class RuleBulkDeleteResponse: …

errors: List\[Error\]

code: int

minimum1000

message: str

documentation\_url: Optional\[str\]

source: Optional\[ErrorSource\]

pointer: Optional\[str\]

messages: List\[Message\]

code: int

minimum1000

message: str

documentation\_url: Optional\[str\]

source: Optional\[MessageSource\]

pointer: Optional\[str\]

success: Literal\[true\]

Whether the API call was successful.

#### TCP Flow ProtectionRulesItems

##### [Get TCP Flow Protection rule.](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection/subresources/advanced%5Ftcp%5Fprotection/subresources/tcp%5Fflow%5Fprotection/subresources/rules/subresources/items/methods/get)

ddos\_protection.advanced\_tcp\_protection.tcp\_flow\_protection.rules.items.get(strrule\_id, ItemGetParams\*\*kwargs)  \-> [ItemGetResponse](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection#%28resource%29%20ddos%5Fprotection.advanced%5Ftcp%5Fprotection.tcp%5Fflow%5Fprotection.rules.items%20%3E%20%28model%29%20item%5Fget%5Fresponse%20%3E%20%28schema%29)

GET/accounts/{account\_id}/magic/advanced\_tcp\_protection/configs/tcp\_flow\_protection/rules/{rule\_id}

##### [Update TCP Flow Protection rule.](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection/subresources/advanced%5Ftcp%5Fprotection/subresources/tcp%5Fflow%5Fprotection/subresources/rules/subresources/items/methods/edit)

ddos\_protection.advanced\_tcp\_protection.tcp\_flow\_protection.rules.items.edit(strrule\_id, ItemEditParams\*\*kwargs)  \-> [ItemEditResponse](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection#%28resource%29%20ddos%5Fprotection.advanced%5Ftcp%5Fprotection.tcp%5Fflow%5Fprotection.rules.items%20%3E%20%28model%29%20item%5Fedit%5Fresponse%20%3E%20%28schema%29)

PATCH/accounts/{account\_id}/magic/advanced\_tcp\_protection/configs/tcp\_flow\_protection/rules/{rule\_id}

##### [Delete TCP Flow Protection rule.](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection/subresources/advanced%5Ftcp%5Fprotection/subresources/tcp%5Fflow%5Fprotection/subresources/rules/subresources/items/methods/delete)

ddos\_protection.advanced\_tcp\_protection.tcp\_flow\_protection.rules.items.delete(strrule\_id, ItemDeleteParams\*\*kwargs)  \-> [ItemDeleteResponse](https://developers.cloudflare.com/api/python/resources/ddos%5Fprotection#%28resource%29%20ddos%5Fprotection.advanced%5Ftcp%5Fprotection.tcp%5Fflow%5Fprotection.rules.items%20%3E%20%28model%29%20item%5Fdelete%5Fresponse%20%3E%20%28schema%29)

DELETE/accounts/{account\_id}/magic/advanced\_tcp\_protection/configs/tcp\_flow\_protection/rules/{rule\_id}

##### ModelsExpand Collapse 

class ItemGetResponse: …

id: str

The unique ID of the TCP Flow Protection rule.

burst\_sensitivity: str

The burst sensitivity. Must be one of ‘low’, ‘medium’, ‘high’.

created\_on: datetime

The creation timestamp of the TCP Flow Protection rule.

formatdate-time

mode: str

The mode for TCP Flow Protection. Must be one of ‘enabled’, ‘disabled’, ‘monitoring’.

modified\_on: datetime

The last modification timestamp of the TCP Flow Protection rule.

formatdate-time

name: str

The name of the TCP Flow Protection rule. Value is relative to the ‘scope’ setting. For ‘global’ scope, name should be ‘global’. For either the ‘region’ or ‘datacenter’ scope, name should be the actual name of the region or datacenter, e.g., ‘wnam’ or ‘lax’.

rate\_sensitivity: str

The rate sensitivity. Must be one of ‘low’, ‘medium’, ‘high’.

scope: str

The scope for the TCP Flow Protection rule. Must be one of ‘global’, ‘region’, or ‘datacenter’.

class ItemEditResponse: …

id: str

The unique ID of the TCP Flow Protection rule.

burst\_sensitivity: str

The burst sensitivity. Must be one of ‘low’, ‘medium’, ‘high’.

created\_on: datetime

The creation timestamp of the TCP Flow Protection rule.

formatdate-time

mode: str

The mode for TCP Flow Protection. Must be one of ‘enabled’, ‘disabled’, ‘monitoring’.

modified\_on: datetime

The last modification timestamp of the TCP Flow Protection rule.

formatdate-time

name: str

The name of the TCP Flow Protection rule. Value is relative to the ‘scope’ setting. For ‘global’ scope, name should be ‘global’. For either the ‘region’ or ‘datacenter’ scope, name should be the actual name of the region or datacenter, e.g., ‘wnam’ or ‘lax’.

rate\_sensitivity: str

The rate sensitivity. Must be one of ‘low’, ‘medium’, ‘high’.

scope: str

The scope for the TCP Flow Protection rule. Must be one of ‘global’, ‘region’, or ‘datacenter’.

class ItemDeleteResponse: …

errors: List\[Error\]

code: int

minimum1000

message: str

documentation\_url: Optional\[str\]

source: Optional\[ErrorSource\]

pointer: Optional\[str\]

messages: List\[Message\]

code: int

minimum1000

message: str

documentation\_url: Optional\[str\]

source: Optional\[MessageSource\]

pointer: Optional\[str\]

success: Literal\[true\]

Whether the API call was successful.