Use the Cloudflare API to configure Programmable Flow Protection.
For examples of API calls, refer to Common API calls .
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 tables in the following sections summarize the available operations.
Operation Method and endpoint / Description List programs GET accounts/{account_id}/magic/programmable_flow_protection/configs/programs
Fetches all Programmable Flow Protection programs in the account.Upload a program POST accounts/{account_id}/magic/programmable_flow_protection/configs/programs
Uploads a new program to the account.Get a program GET accounts/{account_id}/magic/programmable_flow_protection/configs/programs/{program_id}
Fetches the details of an existing program.Update a program PATCH accounts/{account_id}/magic/programmable_flow_protection/configs/programs/{program_id}
Updates an existing program.Delete a program DELETE accounts/{account_id}/magic/programmable_flow_protection/configs/programs/{program_id}
Deletes an existing program from the account.Delete all programs DELETE accounts/{account_id}/magic/programmable_flow_protection/configs/programs
Deletes all existing programs from the account.
Operation Method and endpoint / Description List rules GET accounts/{account_id}/magic/programmable_flow_protection/configs/rules
Fetches all Programmable Flow Protection rules in the account.Create a rule POST accounts/{account_id}/magic/programmable_flow_protection/configs/rules
Creates a new rule in the account.Get a rule GET accounts/{account_id}/magic/programmable_flow_protection/configs/rules/{rule_id}
Fetches the details of an existing rule.Update a rule PATCH accounts/{account_id}/magic/programmable_flow_protection/configs/rules/{rule_id}
Updates an existing rule in the account.Delete a rule DELETE accounts/{account_id}/magic/programmable_flow_protection/configs/rules/{rule_id}
Deletes an existing rule from the account.Delete all rules DELETE accounts/{account_id}/magic/programmable_flow_protection/configs/rules
Deletes all existing rules from the account.
Operation Method and endpoint / Description Debug with PCAP POST accounts/{account_id}/magic/programmable_flow_protection/configs/programs/{program_id}/pcap
Runs a program against a PCAP file and returns an annotated PCAP with program verdicts.
The API operations that return a list of items use pagination. For more information on the available pagination query parameters, refer to Pagination .