Cloudflare Docs
DDoS Protection
Visit DDoS Protection on GitHub
Set theme to dark (⇧+D)

Configuring Advanced TCP Protection via API

You can configure Advanced TCP Protection using the Advanced TCP Protection API.

The Advanced TCP Protection API only supports API token authentication. For more information on API authentication, refer to Getting Started: Requests in the Cloudflare API documentation.

For examples of API calls, refer to Common API calls.

​​ Endpoints

To obtain the complete endpoint, append the Advanced TCP Protection API endpoints listed below to the Cloudflare API base URL.

The Cloudflare API base URL is:

https://api.cloudflare.com/client/v4

The <ACCOUNT_ID> argument is the account ID (a hexadecimal string). You can find this value in the Cloudflare dashboard.

The tables in the following sections summarize the available operations.

​​ General operations

OperationMethod and endpoint / Description
Get Advanced TCP
Protection status
GET accounts/<ACCOUNT_ID>/magic/advanced_tcp_protection/configs/tcp_protection_status
Gets the global Advanced TCP Protection status (enabled or disabled).
Update Advanced
TCP Protection status
PATCH accounts/<ACCOUNT_ID>/magic/advanced_tcp_protection/configs/tcp_protection_status
Enables or disables Advanced TCP Protection.

​​ Prefix operations

OperationMethod and endpoint / Description
List prefixesGET accounts/<ACCOUNT_ID>/magic/advanced_tcp_protection/configs/prefixes
Fetches all Advanced TCP Protection prefixes in the account.
Add prefixes in bulkPOST accounts/<ACCOUNT_ID>/magic/advanced_tcp_protection/configs/prefixes/bulk
Adds prefixes in bulk to the account (up to 300 prefixes per request).
Get a prefixGET accounts/<ACCOUNT_ID>/magic/advanced_tcp_protection/configs/prefixes/<PREFIX_ID>
Fetches the details of an existing prefix.
Update a prefixPATCH accounts/<ACCOUNT_ID>/magic/advanced_tcp_protection/configs/prefixes/<PREFIX_ID>
Updates an existing prefix.
Delete a prefixDELETE accounts/<ACCOUNT_ID>/magic/advanced_tcp_protection/configs/prefixes/<PREFIX_ID>
Deletes an existing prefix.
Delete all prefixesDELETE accounts/<ACCOUNT_ID>/magic/advanced_tcp_protection/configs/prefixes
Deletes all existing prefixes from the account.

​​ Allowlist operations

OperationMethod and endpoint / Description
List allowlisted prefixesGET accounts/<ACCOUNT_ID>/configs/allowlist
Fetches all prefixes in the account allowlist.
Add an allowlisted prefixPOST accounts/<ACCOUNT_ID>/configs/allowlist
Adds a prefix to the allowlist.
Get an allowlisted prefixGET accounts/<ACCOUNT_ID>/configs/allowlist/<ALLOWLIST_ID>
Fetches the details of an existing prefix in the allowlist.
Update an allowlisted prefixPATCH accounts/<ACCOUNT_ID>/configs/allowlist/<ALLOWLIST_ID>
Updates an existing prefix in the allowlist.
Delete an allowlisted prefixDELETE accounts/<ACCOUNT_ID>/configs/allowlist/<ALLOWLIST_ID>
Deletes an existing prefix from the allowlist.
Delete all allowlisted prefixesDELETE accounts/<ACCOUNT_ID>/configs/allowlist
Deletes all existing prefixes from the allowlist.

​​ SYN Flood Protection operations

OperationMethod and endpoint / Description
List SYN flood rulesGET accounts/<ACCOUNT_ID>/configs/syn_protection/rules
Fetches all SYN flood rules in the account.
Add a SYN flood rulePOST accounts/<ACCOUNT_ID>/configs/syn_protection/rules
Adds a SYN flood rule to the account.
Get a SYN flood ruleGET accounts/<ACCOUNT_ID>/configs/syn_protection/rules/<RULE_ID>
Fetches the details of an existing SYN flood rule in the account.
Update a SYN flood rulePATCH accounts/<ACCOUNT_ID>/configs/syn_protection/rules/<RULE_ID>
Updates an existing SYN flood rule in the account.
Delete a SYN flood ruleDELETE accounts/<ACCOUNT_ID>/configs/syn_protection/rules/<RULE_ID>
Deletes an existing SYN flood rule from the account.
Delete all SYN flood rulesDELETE accounts/<ACCOUNT_ID>/configs/syn_protection/rules
Deletes all existing SYN flood rules from the account.

​​ Out-of-state TCP Protection operations

OperationMethod and endpoint / Description
List out-of-state TCP rulesGET accounts/<ACCOUNT_ID>/configs/tcp_flow_protection/rules
Fetches all out-of-state TCP rules in the account.
Add an out-of-state TCP rulePOST accounts/<ACCOUNT_ID>/configs/tcp_flow_protection/rules
Adds an out-of-state TCP rule to the account.
Get an out-of-state TCP ruleGET accounts/<ACCOUNT_ID>/configs/tcp_flow_protection/rules/<RULE_ID>
Fetches the details of an existing out-of-state TCP rule in the account.
Update an out-of-state TCP rulePATCH accounts/<ACCOUNT_ID>/configs/tcp_flow_protection/rules/<RULE_ID>
Updates an existing out-of-state TCP rule in the account.
Delete an out-of-state TCP ruleDELETE accounts/<ACCOUNT_ID>/configs/tcp_flow_protection/rules/<RULE_ID>
Deletes an existing out-of-state TCP rule from the account.
Delete all out-of-state TCP rulesDELETE accounts/<ACCOUNT_ID>/configs/tcp_flow_protection/rules
Deletes all existing out-of-state TCP rules from the account.

​​ Pagination

The API operations that return a list of items use pagination. For more information on the available pagination query parameters, refer to Requests: Pagination in the API documentation.