Programmable Flow Protection

Last updated Oct 21, 2026 Use the Cloudflare API to configure Programmable Flow Protection.

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

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 tables in the following sections summarize the available operations.

Program versions

Each uploaded program starts at version 1. Updating a program with a PATCH request creates a new version under the same program ID. Program responses include the current version in the version field.

Each rule is pinned to a specific program version, which appears in the rule's program_version field. Creating a rule without program_version pins it to the program's current version. Updating a program does not update existing rules that reference it.

To move an existing rule to another successful version of its program, send a PATCH request to the rule endpoint with the target program_version. For an example, refer to Update a rule.

Program 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. Include the optional X-Program-Name header to specify a human-readable program name. If omitted, the API generates a UUID as the program name.
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.

Rule operations

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.

Debug operations

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.

Pagination

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

Was this helpful?

YesNo

On this page

Programmable Flow Protection - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/ddos-protection/advanced-ddos-systems/api/programmable-flow-protection/#page","headline":"Programmable Flow Protection","description":"Configure Programmable Flow Protection programs and rules using the Cloudflare API.","url":"https://developers.cloudflare.com/ddos-protection/advanced-ddos-systems/api/programmable-flow-protection/","inLanguage":"en","image":"https://developers.cloudflare.com/ddos-protection/advanced-ddos-systems/api/programmable-flow-protection/og.png?v=e687811cd6054974","dateModified":"2026-10-21","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Example API requests for managing Programmable Flow Protection programs and rules. title: Common API calls image: https://developers.cloudflare.com/ddos-protection/advanced-ddos-systems/api/programmable-flow-protection/examples/og.png?v=ed25b9329656ba65


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/ddos-protection/llms.txt
Use this file to discover all available pages before exploring further.