You can build an API sequence rule via the Cloudflare dashboard.
-
In the Cloudflare dashboard, go to the Security rules page.
Go to Security rules ↗ -
To create a new empty rule, select Create rule > Custom rules.
-
Enter a descriptive name for the rule in Rule name.
-
Under When incoming requests match, use the Field drop-down list to filter by Sequences and select from:
- Current Operation
- Previous Operations
- Elapsed time
-
Under Value, select the edit icon to use Builder and build a sequence on the side panel.
-
Under Select a hostname for this sequence, choose all or a specific hostname from the dropdown list. Optionally, you can use the search bar to search for a specific hostname.
-
From the Methods dropdown list, choose all methods or a specific request method.
-
Select the checkbox for each endpoint in the order that you want them to appear in the sequence.
-
Set the time to complete.
-
Select Save.
-
Under Then take action, select the rule action in the Choose action dropdown. For example, selecting Block tells Cloudflare to refuse requests that match the conditions you specified.
-
(Optional) If you selected the Block action, you can configure a custom response.
-
Under Place at, select the order of when the rule will fire.
-
To save and deploy your rule, select Deploy. If you are not ready to deploy your rule, select Save as Draft.