Skip to content
Cloudflare Docs

Programmable Flow Protection (Beta)

Use the Cloudflare API to configure Programmable Flow Protection via API.

For examples of API calls, refer to the Programmable Flow Protection documentation.

Endpoints

To obtain the complete endpoint, append the Programmable Flow Protection API endpoints listed below to the Cloudflare API base URL:

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 following table summarizes the available operations.

Program API endpoints

OperationVerb + Endpoint
Upload a programPOST /accounts/{account_id}/magic/programmable_flow_protection/configs/programs
Update a programPATCH /accounts/{account_id}/magic/programmable_flow_protection/configs/programs/{program_id}
List programsGET /accounts/{account_id}/magic/programmable_flow_protection/configs/programs
Delete a programDELETE /accounts/{account_id}/magic/programmable_flow_protection/configs/programs/{program_id}
Delete all programsDELETE /accounts/{account_id}/magic/programmable_flow_protection/configs/programs

Rule API endpoints

OperationVerb + Endpoint
Create a rulePOST /accounts/{account_id}/magic/programmable_flow_protection/configs/rules
Update a rulePATCH /accounts/{account_id}/magic/programmable_flow_protection/configs/rules/{rule_id}
List rulesGET /accounts/{account_id}/magic/programmable_flow_protection/configs/rules
Delete a ruleDELETE /accounts/{account_id}/magic/programmable_flow_protection/configs/rules/{rule_id}
Delete all rulesDELETE /accounts/{account_id}/magic/programmable_flow_protection/configs/rules

Debug Packet CAPture (PCAP) API endpoint

OperationVerb + Endpoint
Debug Packet CAPture (PCAP)POST /accounts/{account_id}/magic/programmable_flow_protection/configs/programs/{program_id}/pcap?ip_offset={ip_offset_value}