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/v4The {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.
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.
| Operation | Method and endpoint / Description |
|---|---|
| List programs |
|
| Upload a program |
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 |
|
| Update a program |
|
| Delete a program |
|
| Delete all programs |
|
| Operation | Method and endpoint / Description |
|---|---|
| List rules |
|
| Create a rule |
|
| Get a rule |
|
| Update a rule |
|
| Delete a rule |
|
| Delete all rules |
|
| Operation | Method and endpoint / Description |
|---|---|
| Debug with PCAP |
|
The API operations that return a list of items use pagination. For more information on the available pagination query parameters, refer to Pagination.